This API allows you to receive / send a message to a contact and also receive the entire history of correspondence with the selected contact.
...
Code Block |
---|
POST https://api.smartsender.com/v1/contacts/{contactId}/send |
Параметры URL:
Name | Description |
---|---|
contactId | Contact ID |
Main parameters:
Name | Description | Validation |
---|---|---|
type | Message type | Available types
|
watermark | Message priority timestamp (default, use current timestamp) | Timestamp |
media | Attachment URL | Mandatory if media message. If the type does not match the file format, it will be sent as a “document” |
title | Place name | Mandatory if location type |
latitude | Width | Mandatory if location type |
longitude | Longitude | Mandatory if location type |
content | Text | Required if type is text |
fullName | Full name | Required if type is contact |
phoneNumber | Phone number | Required if type is contact |
In case of a successful response, get an object of type Message.
Receipt (via contact).
Allows you to receive a message through a contact.
...
Code Block |
---|
GET https://api.smartsender.com/v1/contacts/{contactId}/messages |
Main parameters:
Name | Description | Validation |
---|---|---|
page | Requested Page | Minimum value 1 |
limitation | Amount of data to display per page | Minimum value 1, maximum 20 |
activities | A switch that sets whether system messages should be added to the result | Optional, Boolean/Integer, default false |
In case of a successful response, you will receive the following:
...
Code Block |
---|
{ "cursor": Cursor, "collection": Message[] } |
Answer description:
Receiving (via chat).
Allows you to receive a message via chat.
...
Code Block |
---|
GET https://api.smartsender.com/v1/chats/{chatId}/messages |
Main parameters:
Name | Description | Validation |
---|---|---|
page | Requested Page | Minimum value 1 |
limitation | Amount of data to display per page | Minimum value 1, maximum 20 |
activities | A switch that sets whether system messages should be added to the result | Optional, Boolean/Integer, default false |
In case of a successful response, you will receive the following:
...
Code Block |
---|
{ "cursor": Cursor, "collection": Message[] } |
Answer description: