Instant messaging channels (imchannels)
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new channel
Request
Field description: imchannel entity
POST /rest/v1/uc/imchannels HTTP/1.1
Content-Type: application/json; charset=utf-8
imchannel entity
Response
Field description: imchannel entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "3005a447-017b-e5f8-472b-7cd30a921f58",
"code": "telegram",
"mode": "request",
"recv_strategy": "",
"send_strategy": "",
"opts": {
"title": "",
"comment": "",
"after_read_timeout": 100,
"max_account_mps": 30,
"max_remoteparty_mps": 1
},
"ext": {
"ct": "2021-09-14T20:20:58.79Z",
"lwt": "2021-09-14T20:20:58.79Z"
}
}
Getting the list of channels
Request
| Name | Type | Description |
|---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, code, mode, recv_strategy, send_strategy, opts.title, opts.comment, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to output. |
|
|
Maximum number of resources in the list. |
|
|
Sorting order of resources in the list. |
|
|
Transformation of composite fields to flat form. |
GET /rest/v1/uc/imchannels?offset=0&limit=2 HTTP/1.1
Response
Field description: imchannel entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "3005a447-017b-e5f8-472b-7cd30a921f58",
"code": "telegram",
"mode": "request",
"recv_strategy": "",
"send_strategy": "",
"opts": {
"title": "",
"comment": ""
},
"ext": {
"ct": "2021-09-14T20:20:58.79Z",
"lwt": "2021-09-14T20:20:58.79Z"
}
},
{
"id": "3005a447-017b-e5f8-472b-7cd30a921f58",
"code": "custom_site_messager",
"mode": "request",
"recv_strategy": "custom_site_messager_recv",
"send_strategy": "custom_site_messager_recv",
"opts": {
"title": "",
"comment": ""
},
"ext": {
"ct": "2021-10-22T15:47:30.41Z",
"lwt": "2021-10-22T15:47:30.41Z"
}
}
]
Getting channel data
Request
| Name | Type | Description |
|---|---|---|
|
|
List of fields to output. |
|
|
Transformation of composite fields to flat form. |
GET /rest/v1/uc/imchannels/3005a447-017b-e5f8-472b-7cd30a921f58 HTTP/1.1
Response
Field description: imchannel entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "3005a447-017b-e5f8-472b-7cd30a921f58",
"code": "telegram",
"mode": "request",
"recv_strategy": "",
"send_strategy": "",
"opts": {
"title": "",
"comment": "",
"after_read_timeout": 100,
"max_account_mps": 30,
"max_remoteparty_mps": 1
},
"ext": {
"ct": "2021-09-14T20:20:58.79Z",
"lwt": "2021-09-14T20:20:58.79Z"
}
}
Modifying channel data
Fields prohibited for modification: id
Request
Field description: imchannel entity
PATCH /rest/v1/uc/imchannels/3005a447-017b-e5f8-472b-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
imchannel entity
Response
Field description: imchannel entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "3005a447-017b-e5f8-472b-7cd30a921f58",
"code": "telegram",
"mode": "request",
"recv_strategy": "my_telegram_recv_scriptcode",
"send_strategy": "my_telegram_send_scriptcode",
"opts": {
"title": "",
"comment": "",
"after_read_timeout": 1000,
"max_account_mps": 30,
"max_remoteparty_mps": 1
},
"ext": {
"ct": "2021-09-14T20:20:58.79Z",
"lwt": "2021-09-14T20:20:58.79Z"
}
}