Send Zalo message with attached photo

HTTP request

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

  • Content Type: application/json

  • Response Type: application/json

curl --location 'http://rest.esms.vn/MainService.svc/json/SendZaloFollowerMessage_V5_post_json/' \
--header 'Content-Type: text/plain' \
--header 'Cookie: ASP.NET_SessionId=asfgp2dj1kt4kbg1yzuo35ky; ASP.NET_SessionId=5xcbl12ska5q5wocug3chmjz' \
--data '{
    "ApiKey": "{{ApiKey}}",
    "SecretKey": "{{SecretKey}}",
    "OAID": "{{OAID}}",
    "CallbackUrl": "{{CallbackUrl}}",
    "Payload": {
        "recipient": {
            "user_id": "{{user_id}}"
        },
        "message": {
            "text": "{{text}}",
            "attachment": {
                "type": "template",
                "payload": {
                    "template_type": "media",
                    "elements": [
                        {
                            "media_type": "image",
                            "url": "{{url}}"
                        }
                    ]
                }
            }
        }
    }
}'

  • 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

url

string

Image path

Supported image formats: jpg and png Maximum size: 1MB

CallbackUrl

string

The webhook URL that will receive the status of message after it processed to the operator. It is used for determine whether the SMS is succcessfully delivered to the receiver or failed. See the sample request at here. More details at here.


  • 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