Skip to main content

Forward Content WhatsApp

This API is used to forward WhatsApp content from end-user (customers) to the user (client).

Requirement

Following the sending of a message, the customer may choose to reply. You will receive content (a reply from your customer) that will be sent with the following parameters. Before that, the client is required to create an endpoint that can be accessed by Sprint to send the content.


Request

Request for Content

This section describes the request parameters and provides JSON request that will be sent and processed by Sprint to forward the message content.

Description Parameter Request
FIELDTYPE ALLOWEDDESCRIPTION
fromJSON ObjectProduct used to send the message. Value is always WhatsApp
avatarStringURL of the sender’s avatar (image)
descriptionStringDescription of the user profile
nameStringName of the sender
usernameStringUsername of the sender
messageJSON ObjectDetails information from metadata
idStringUnique code for the IdMessage
interactiveJSON ObjectUniq id from conversation
bodyJSON ObjectDetails information from body
textStringContent of the message
footerJSON ObjectDetails information from footer
textStringContent of the footer
titleStringTitle displayed in footer
headerJSON ObjectDetails information from 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 ObjectDetails information from statuses
addressStringDisplayed address/phone number
latitudeFloatLatitude coordinate
live_periodIntegerType Location (specifically for live location period)
longitudeFloatLongitude coordinate
nameStringName of the location
mediaJSON ObjectDetails information from media
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 ObjectDetails information from 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 for Content
{
"from": {
"avatar": "",
"description": "",
"name": "al",
"username": "628131141XXXXX"
},
"message": {
"id": "wamid.HBgNNjI4OTUwNDI4ODE1MhNFNUE==",
"interactive": {
"body": {
"text": ""
},
"footer": {
"text": "",
"title": ""
},
"header": {
"media_url": "",
"text": "",
"type": ""
},
"items": null
},
"location": {
"address": "",
"latitude": 0,
"live_period": 0,
"longitude": 0,
"name": ""
},
"media": {
"animated": false,
"id": "",
"mime_type": "",
"name": "",
"size": 0,
"url": ""
},
"postback": {
"key": "",
"title": "",
"type": "",
"value": ""
},
"reply_id": "",
"text": "Oke ka",
"times": 0,
"timestamp": "2024-10-01T04:22:33Z",
"type": "text"
},
"reply_token": ""
}

Request for Content using the Pass Thru Format (optional)

This section describes the request parameters and provides JSON request that will be sent by Sprint directly from the provider (WhatsApp) without being processed by Sprint to forward message content

Description Parameter Request
FIELDTYPE ALLOWEDDESCRIPTION
ContactArrayDetails information from contacts
profileJSON ObjectDetails information from profile
nameStringName of the sender.
wa_idStringCode unique form id WhatsApp
messageArrayDetails information from message
fromStringPhone number sender
idStringCode unique form sender
textJSON ObjectDetails information from text
bodyStringContent of the message.
timestampUnix timestampDate for the status message
typeStringType content of the message
messaging_productStringProduct used to send the message. Value is always WhatsApp
metadataJSON ObjectDetails information from metadata
display_phone_numberStringDisplayed phone number
phone_number_idStringunique id from phone number
Sample JSON Request for Content using the Pass Thru Format (optional)
{
"contacts": [
{
"profile": {
"name": "qwerty"
},
"wa_id": "628963849xxxx"
}
],
"messages": [
{
"from": "62858xxxxxxxx ",
"id": "wamid.HBgNNjI4OTYzODQ5NDIxNxUCA",
"text": {
"body": "testing content"
},
"timestamp": "1717579667",
"type": "text"
}
],
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "62858xxxxxxxx ",
"phone_number_id": "10147161972xxxx"
}
}