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

Interface for Receiving and Processing Upstream Messages Sent by KooMessage

Function

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

Usage Description

  • Prerequisites

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

Interface Authentication

This authentication mode is used for WhatsApp access through the KooMessage 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/koomessage/message/{channelId}

IP address:Port number indicates the IP address and port number of the NSLB exposed externally. {channelId} indicates the channel ID.

Request Body Parameters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

sender

Yes

String

Merchant mobile number.

user_number

Yes

String

Customer mobile number.

user_name

Yes

String

Username.

timestamp

Yes

String

Timestamp, in seconds.

message_id

Yes

String

Message ID.

message_type

Yes

String

Type of messages that can be received.

1. text

2. image

3. video

4. audio

5. document

6. location

7. interactive_button_reply

8. interactive_list_reply

9. button

context

Yes

object

Reference message. For details, see Table 4.

message

Yes

object

Inbound message. For details, see Table 5.

Table 4 Context parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Reference message ID.

Table 5 Message parameters

Parameter

Mandatory

Type

Description

text

No

String

Text message content. This parameter is mandatory when message_type is set to text.

url

No

String

Media file URL. This parameter is mandatory when message_type is set to image, audio, video, or document.

caption

No

String

Description. This parameter is mandatory when message_type is set to image, audio, or document.

filename

No

String

File name. This parameter is mandatory when message_type is set to document.

payload

No

String

Load. This parameter is mandatory when message_type is set to button.

title

No

String

Returned content of an interactive message. This parameter is mandatory when message_type is set to interactive_button_reply or interactive_list_reply.

longitude

No

String

Longitude. This parameter is mandatory when message_type is set to location.

latitude

No

String

Latitude. This parameter is mandatory when message_type is set to location.

name

No

String

Address name. This parameter is mandatory when message_type is set to location.

address

No

String

Detailed address. This parameter is mandatory when message_type is set to location.

Response Parameters

No response is returned when this interface is invoked.

Example

  • Request
    POST /social/on/whatsapp/koomessage/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: */*
    
    { 
       "sender" : "86173xxxx4526", 
       "timestamp" : "1719318962", 
       "message" : { 
         "text" : "this is text message" 
       }, 
       "user_number" : "86187xxxx5632", 
       "user_name" : "user_name", 
       "message_id" : "110630e87b3a49b382cc30b5c9a508366", 
       "message_type" : "text" 
     }