Updated on 2025-11-13 GMT+08:00

Interface for Receiving and Processing Upstream Messages Sent by Gupshup

Function

This interface is invoked to receive and process upstream messages sent by Gupshup.

Usage Description

  • Prerequisites

    The WhatsApp channel configuration has been created and the service provider has been set to Gupshup.

  • For details, see the official document at https://docs.gupshup.io/docs/overview.

Interface Authentication

This authentication mode is used for WhatsApp access through the Gupshup integrator.

Instructions:

In the AICC, the webhook password is configured on the Channel Configuration page.

The request header Authorization is added to the request and the WhatsAppAdapter interface is invoked. The value of Authorization is the webhook password.

Request Header Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Default Value

Description

Content-Type

Yes

String

None

The value is fixed at application/json; charset=UTF-8.

Authorization

Yes

String

None

Webhook authentication password configured on the Channel Configuration page in the AICC.

Interface Prototype

Table 2 Interface prototype description

Method

POST

URL

https://IP address:Port number/social/on/whatsapp/{whatsAppBsp}/message/{channelId}

IP address:Port number indicates the IP address and port number of the NSLB exposed externally. {whatsAppBsp} indicates the integrator.

{channelId} indicates the channel ID.

Request Body Parameters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

timestamp

Yes

Long

Sending time of a message. The value is a Unix timestamp, in seconds.

type

Yes

String

Message type: message.

payload

Yes

object

Message carrier. For details, see Table 4.

Table 4 Payload parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Unique code of a customer message.

source

Yes

String

Mobile number when the customer registers for WhatsApp.

type

Yes

String

Message type: The options are text, audio, image, video, location, button_reply, list_reply, and quick_reply.

payload

Yes

object

Message content.

context

No

object

Reference message information.

Table 5 Message parameters

Parameter

Mandatory

Type

Description

context

No

object

Message reference. For details, see Table 6.

sender

Yes

object

Message sender information. For details, see Table 7.

text

No

String

Text message content. This parameter is available when the message type is text.

url

No

String

Multimedia message. This parameter is available when the message type is audio, video, or image.

caption

No

String

Title of a multimedia message.

contentType

No

String

File type. Example: image/jpg

name

No

String

Multimedia file name.

latitude

No

String

Latitude. This parameter is available when the message type is location.

longitude

No

String

Longitude. This parameter is available when the message type is location.

Table 6 Context parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Unique ID of a WhatsApp message.

gsId

Yes

String

Unique ID of a Gupshup message.

Table 7 Sender parameters

Parameter

Mandatory

Type

Description

phone

Yes

String

Complete customer number, including the country code.

name

Yes

String

Customer nickname.

country_code

Yes

String

Country code of a customer. For example, 86 indicates China.

dial_code

Yes

String

Mobile number of a customer, excluding the country code.

Response Parameters

No response is returned when this interface is invoked.

Example

  • Request
    POST /social/on/whatsapp/gupshup/message/202105102694809992
    
    host: 10.10.10.2:18446
    connection: Keep-Alive
    x-forwarded-for: 10.10.10.3, 10.10.10.4
    x-real-ip: 10.10.10.5
    content-length: 401
    remote-host: 10.10.10.6
    user-agent: java/socket
    Authorization: *************
    content-type: application/json; charset=utf-8
    accept: */*
    
    {
        "timestamp": 1743146844100,
        "type": "message",
        "payload": {
            "id": "wamid.HBgNODYxODc2NTkwMjAwMRUCABIYIEVCRTAwQUI4RDEyMDVCNzBCQUU0ODEyOUM0NTQ0RUEzAA==",
            "source": "8618*****1",
            "type": "image",
            "payload": {
                "url": "https://filemanager.gupshup.io/wa/*********",
                "contentType": "image/jpeg",
                "urlExpiry": 1743751644100
            },
            "sender": {
                "phone": "8618*******1",
                "name": "AI****i",
                "country_code": "86",
                "dial_code": "18*****1"
            }
        }
    }