Send Zalo message Consulting button

HTTP request

POST https://rest.esms.vn/MainService.svc/json/SendZaloFollowerMessage_V5_post_json/

  • Content Type: application/json

  • Response Type: application/json

curl --location 'https://rest.esms.vn/MainService.svc/json/SendZaloFollowerMessage_V5_post_json/' \
--header 'Content-Type: application/json' \
--data '{
    "ApiKey": "{{ApiKey}}",
    "SecretKey": "{{SecretKey}}",
    "OAID": "{{OAID}}",
    "CallbackUrl": "{{CallbackUrl}}",
    "Payload": {
        "recipient": {
            "user_id": "{{user_id}}"
        },
        "message": {
            "text": "{{text}}",
            "attachment": {
                "type": "template",
                "payload": {
                    "buttons": [
                        {
                            "title": "{{title}}",
                            "payload": {
                                "url": "{{url}}"
                            },
                            "type": "oa.open.url"
                        },
                        {
                            "title": "{{title}}",
                            "type": "oa.query.show",
                            "payload": "{{payload}}"
                        },
                        {
                            "title": "{{title}}",
                            "type": "oa.query.hide",
                            "payload": "{{payload}}"
                        },
                        {
                            "title": "{{title}}",
                            "type": "oa.open.sms",
                            "payload": {
                                "content": "{{content}}",
                                "phone_code": "{{phone_code}}"
                            }
                        },
                        {
                            "title": "{{title}}",
                            "type": "oa.open.phone",
                            "payload": {
                                "phone_code": "{{phone_code}}"
                            }
                        }
                    ]
                }
            }
        }
    }
}'

  • Body request

Parameter
Type
Required
Description

ApiKey

string

Your API Key.

SecretKey

string

Your Secret Key.

OAID

string

Zalo OA Id is the Zalo Official Account Id of the organization. It can be obtained by accessing to the Zalo administrator page.

Note: Pre-registration is required.

user_id

string

The identification value of user at Zalo.

text

string

Text content to send to users Maximum limit is 2,000 characters

attachment

string

  • Tittle: template display title (max 100 characters).

  • Default_action - Type oa.open.url: The URL that will be opened in Zalo application when the follower click on it. - Type oa.open.sms: When the follower click on the action, a new window will be opened with 2 availabel values are phone code and the message text value in the data payload. - Type oa.query.hide: Payload is a string such as "#eSMS". When the follower click on the action, the system will send a message with the content is the user data to the Official Account. - Type oa.query.show: The payload structure is a string such as "#eSMS". When the follower click on the action, the system will send a message with the content is the user data to the Official Account. This message will be displayed on the chat window of user. - Type oa.open.phone: When the follower click on the action, a calling window will be opened with the phone number is the phone_code value.

CallbackUrl

string


  • Response:

{
    "CodeResult": "100",
    "CountRegenerate": 0,
    "SMSID": "d8e0f1f0702544b2acb456ca9ccfd111250"
}

Valid request.

  • Response body

Parameter
Type
Description

CodeResult

string

Response code.

SMSID

string

The message id eSMS system.

ErrorMessage

string

The error message if the request is invalid.

Last updated