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
FIELD | TYPE ALLOWED | DESCRIPTION |
---|---|---|
from | JSON Object | Product used to send the message. Value is always WhatsApp |
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 | Details information from metadata |
id | String | Unique code for the IdMessage |
interactive | JSON Object | Uniq id from conversation |
body | JSON Object | Details information from body |
text | String | Content of the message |
footer | JSON Object | Details information from footer |
text | String | Content of the footer |
title | String | Title displayed in footer |
header | JSON Object | Details information from 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 | Details information from statuses |
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 | Details information from media |
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 | Details information from 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 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
FIELD | TYPE ALLOWED | DESCRIPTION |
---|---|---|
Contact | Array | Details information from contacts |
profile | JSON Object | Details information from profile |
name | String | Name of the sender. |
wa_id | String | Code unique form id WhatsApp |
message | Array | Details information from message |
from | String | Phone number sender |
id | String | Code unique form sender |
text | JSON Object | Details information from text |
body | String | Content of the message. |
timestamp | Unix timestamp | Date for the status message |
type | String | Type content of the message |
messaging_product | String | Product used to send the message. Value is always WhatsApp |
metadata | JSON Object | Details information from metadata |
display_phone_number | String | Displayed phone number |
phone_number_id | String | unique 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"
}
}