URL: /services/rest/user/allMessages
Works for POST and application/x-www-form-urlencoded
parameters, or GET and query parameters
name | description | example value | validation rules |
---|---|---|---|
username | Username of registered user | 1234321@reseller | Cannot be null or empty, cannot contain spaces, user must exist |
password | Password | password | Cannot be null or empty, must match user's password |
since | Epoch, number of seconds since 1st Jan 1970 GMT | 1364545939 | Required, must be an integer number |
Response in JSON:
{ "newestMessageTimestamp": 1366624802, "hasMoreMessages": false, "incomingMessages": [ { "documentId": "51750a01e4b0d1406c9c5fdb", "text": " ggghhh", "timestamp": 1366624769, "from": "61555879987", "originDocumentId": "517509fee4b0b1be3f128ef5" } ], "outgoingMessages": [ { "documentId": "517509fee4b0b1be3f128ef5", "text": "Reply> ggghhh", "timestamp": 1366624766, "recpipent": "61555879987" }, { "documentId": "51750a22e4b0b1be3f128ef6", "text": "Hello mommy", "timestamp": 1366624802, "recpipent": "61255588885" } ], "status": 0 }
Response parameters
name | description |
---|---|
newestMessageTimestamp | timestamp of the newest returned message |
hasMoreMessages | true if there are more messages to retrieve from server, false otherwise |
status | 0 if everything is OK, error code otherwise |
incomingMessages | list of received messages |
outgoingMessages | list of sent messages |
Parameters of single incoming message
name | description |
---|---|
from | number of message sender |
documentId | message ID |
originDocumentId | ID of the message this message is reply for |
timestamp | timestamp of the message |
text | message text |
Parameters of single outgoing message
name | description |
---|---|
documentId | message ID |
text | message text |
timestamp | timestamp when message was sent |
recipient | number the message was sent to |
Possible statuses
0, 1, 2, 3, 200, 220, 9999
Status codes and their meaning: User and Reseller REST API Response Status Codes