Message queuing
Description
GET /messagesqueue
The resource allows getting all messages that are queued to send.
Messages on our servers are stored for 24 hours.
URL resource:
https://app.api-messenger.com/messagesqueue
Input data
Parameter | Required | Value |
---|---|---|
files | No | Get the files only Text messages only are displayed by default if the parameter hasn’t been specified. |
page | No | The results page number to show in the response. If the page number specified exceeds the total pages found number, there is displayed an error. Default value: 1. |
Output data
Output data structure is shown below.
{
"status": "{enum}",
"pager":
{
"currentPage": {int32},
"pagesCount": {int32},
"pageSize": {int32},
"totalsMessage": {int32}
},
"messages":
[
{
"chatId": "{string}",
"message": "{string}",
"filename": "{string}",
},
...
]
}
Parameters description:
Parameter | Value |
---|---|
status | Response status. Possible values:
|
pager | Search results brief. |
messages | Messages list which meet the search criteria. |
Parameters nested in pager | |
currentPage | Output results page number. In case if the messages satisfying the search conditions specified in the query haven’t been found or use the following parameter new , parameter is not displayed. |
pagesCount | Pages number with the results. In case if the messages satisfying the search conditions specified in the query haven’t been found or use the following parameter new , parameter is not displayed. |
pageSize | The messages number displayed on the page. In case if the messages satisfying the search conditions specified in the query haven’t been found or use the following parameter new , parameter is not displayed. |
totalsMessage | Total number of messages found. In case if the messages satisfying the search conditions specified in the query haven’t been found, parameter value: 0. |
Parameters nested in messages | |
chatId | Individual chat ID |
message | Text message. If the query uses the parameter files , parameter message is not displayed. |
filename | File name. The parameter is displayed if the query contains a parameter files |
Errors description
The server returns an HTTP response code and a brief error description in the event of error.
Examples
Query example:
curl -i -H 'Content-Type: application/json' -X GET 'https://app.api-messenger.com/messagesqueue?files=true'
Response example:
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
...
{
"status": "OK",
"pager":
{
"currentPage": 1,
"pagesCount": 1,
"pageSize": 50,
"totalsMessage": 1
},
"messages":
[
{
"chatId": "1456353397@c.us",
"filename": "4X4.jpg"
}
]
}