Skip to main content

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
FIELDTYPE ALLOWEDDESCRIPTION
fromJSON ObjectProduct used to send the message
avatarStringURL of the sender’s avatar (image)
descriptionStringDescription of the user profile
nameStringName of the sender
usernameStringUsername of the sender
messageJSON ObjectDetailed information from the message content
idStringUnique code for the IdMessage
interactiveJSON ObjectFor message type Interactive
bodyJSON ObjectFor the message contained in the body
textStringContent of the message
footerJSON ObjectFor the message contained in the footer
textStringContent of the footer
titleStringTitle displayed in footer
headerJSON ObjectFor the message contained in the header
media_urlStringURL to stored media (image, video, audio, document)
textStringHeader text content
typeStringType of the header content (text, image, video, document)
itemsStringList button content
locationJSON ObjectFor Message type Location
addressStringDisplayed address/phone number
latitudeFloatLatitude coordinate
live_periodIntegerType Location (specifically for live location period)
longitudeFloatLongitude coordinate
nameStringName of the location
mediaJSON ObjectFor message type Media ( image, video, audio, document)
animatedBooleanIndicates whether the media is animated
idStringA unique identifier for the media file
mime_typeStringType for the media : image/video/audio/document/voice
nameStringDisplayed Media Filename
sizeIntegerSize of the Media File
urlStringURL used to access the media file (image, video, audio, document, or voice).
postbackJSON ObjectFor message type postback
keyStringtype key postback
titleStringTitle for the postback type
typeStringType of postback
valueStringvalue type postback
reply_idStringUnique code for the postback type
textStringcontent of the reply message
timesIntegerFormat = Unix Timestamp from time delivery
timestampTimestampFormat = Date Time of message delivery from the user (customer)
typeStringtext/image/video/audio/document/voice/ location/postback
reply_tokenStringA 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": ""
}