Incoming Message
This API is used to receive incoming messages from end-users.
Requirement
To receive incoming messages from customers, the client must create an endpoint that is accessible by Sprint to deliver the message content.
This section describes the request parameters and provides examples of JSON requests used for receiving incoming messages.
Description Parameter Request
FIELD | TYPE ALLOWED | DESCRIPTION |
---|---|---|
from | JSON Object | Product used to send the message |
avatar | String | URL of the sender’s avatar (image) |
description | String | Description of the user profile |
name | String | Name of the sender |
username | String | Username of the sender |
message | JSON Object | Detailed information from the message content |
id | String | Unique code for the IdMessage |
interactive | JSON Object | For message type Interactive |
body | JSON Object | For the message contained in the body |
text | String | Content of the message |
footer | JSON Object | For the message contained in the footer |
text | String | Content of the footer |
title | String | Title displayed in footer |
header | JSON Object | For the message contained in the header |
media_url | String | URL to stored media (image, video, audio, document) |
text | String | Header text content |
type | String | Type of the header content (text, image, video, document) |
items | String | List button content |
location | JSON Object | For Message type Location |
address | String | Displayed address/phone number |
latitude | Float | Latitude coordinate |
live_period | Integer | Type Location (specifically for live location period) |
longitude | Float | Longitude coordinate |
name | String | Name of the location |
media | JSON Object | For message type Media ( image, video, audio, document) |
animated | Boolean | Indicates whether the media is animated |
id | String | A unique identifier for the media file |
mime_type | String | Type for the media : image/video/audio/document/voice |
name | String | Displayed Media Filename |
size | Integer | Size of the Media File |
url | String | URL used to access the media file (image, video, audio, document, or voice). |
postback | JSON Object | For message type postback |
key | String | type key postback |
title | String | Title for the postback type |
type | String | Type of postback |
value | String | value type postback |
reply_id | String | Unique code for the postback type |
text | String | content of the reply message |
times | Integer | Format = Unix Timestamp from time delivery |
timestamp | Timestamp | Format = Date Time of message delivery from the user (customer) |
type | String | text/image/video/audio/document/voice/ location/postback |
reply_token | String | A token used to identify and validate the reply session. |
Sample JSON Request
{
"from": {
"avatar": "",
"description": "",
"name": "{name}",
"username": "{username}"
},
"message": {
"id": "{message_id}",
// Type Interactive
"interactive": {
"body": {
"text": ""
},
"footer": {
"text": "",
"title": ""
},
"header": {
"media_url": "",
"text": "",
"type": ""
},
"items": null
},
// Type location
"location": {
"address": "",
"latitude": 0,
"live_period": 0,
"longitude": 0,
"name": ""
},
// Type Media (image, video, audio, document)
"media": {
"animated": false,
"id": "",
"mime_type": "",
"name": "",
"size": 0,
"url": ""
},
// Type postback
"postback": {
"key": "",
"title": "",
"type": "",
"value": ""
},
"reply_id": "",
"text": "{message_text}",
"times": 0,
"timestamp": "{message_time}",
"type": "{message_type}"
},
"reply_token": ""
}