Quick 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 a 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 be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
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"
}
}
]
Receiving channel data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
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"
}
}
Changing 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"
}
}
Searching for channel ID
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, code, name
Request
LOOKUP /rest/v1/uc/imchannels HTTP/1.1
Content-Type: application/json; charset=utf-8
"telegram"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"3005a447-017b-e5f8-472b-7cd30a921f58"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}