eTelecom docs
English
English
  • INSTRUCTIONS FOR USE
    • Administration page for cs.etelecom
    • Google Chrome Extension
    • App eTelecom
  • API INTEGRATION
    • Shop
      • Account
      • Usage
    • Partner
      • Account
      • Usage
    • VPBX
      • VoIP SDK
        • Android
        • iOS
        • Web
        • Flutter
      • PBX REST APIs
        • Partner Get Tenant List
        • Partner Add Hotline
        • Partner Get Hotline List
        • Partner Activate Tenant
        • Partner Add Hotline To Tenant
        • Partner Removed Hotline From Tenant
        • Partner Remove Hotline
        • Create Tenant
        • Get Tenant information
        • Get Driver Config
        • Get hotline list
        • Create Account User
        • Get List User
        • Create extension
        • Get extension information
        • Get extension list
        • Assign extension to user
        • Change hotline for extension
        • Remove User Of Extension
        • Get call history
    • Zalo Cloud
      • Instructions for connecting Zalo Cloud
      • Zalo Cloud API
        • Create OA authorization link
        • Connect OA
        • Get refresh token
        • Get OA list
        • Get OA information
        • Update Webhook for OA
        • Get list of users
        • Send Text Consulting
        • Send Consulting message according to user information request form
        • Send advice message with sticker
        • Send message Consulting with attached photo
        • Send message Consulting attached file
        • Send transaction message
        • Upload file
        • Send request for calling permission
        • Check if the customer has granted calling permission
        • Get list of requests for calling permission
        • Create a news template
        • Get sample details
        • Get list of news samples
        • Journey Token Creation
        • Get Journey Token Details
        • Get Journey Token List
        • Get message list
        • Get message details
        • Send ZNS
        • Send ZNS with Journey Token
  • SMS BRANDNAME
    • User manual
    • SMS API
      • Send SMS
      • Get message status
      • Get sample details
Powered by GitBook
On this page
  1. API INTEGRATION
  2. Zalo Cloud
  3. Zalo Cloud API

Send transaction message

PreviousSend message Consulting attached fileNextUpload file

Last updated 4 months ago

Note:

  • For APIs used for Shop, the API key is: . The base_url information of the .

  • For APIs used for Partner, the API key is: . The base_url information of the .

Request:

curl --location 'BASE_URL.Zalo/SendZNSTxn' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "language": "unknown",
  "message": {
    "buttons": [
      {
        "image_icon": "string",
        "payload": {
          "url": "string"
        },
        "title": "string",
        "type": "unknown"
      }
    ],
    "content_banner": {
      "attachment_id": "string"
    },
    "content_header": {
      "align": "string",
      "content": "string"
    },
    "content_table": [
      {
        "key": "string",
        "style": "string",
        "value": "string"
      }
    ],
    "content_text": {
      "align": "string",
      "content": "string"
    }
  },
  "oa_id": "string",
  "recipient": {
    "user_id": "string"
  },
  "template_type": "unknown"
}'

Response:

{
  "message_id": "string"
}

Request body structure

Parameters
Data type
Describe

language

string

Language used for the message Input value:

  • language = WE

or

  • language = IN

When selecting a language, the default content of the message will switch to the corresponding language.

buttons

array

CTA buttons (optional, up to 4 buttons)

image_icon

string

Can transmit:

  • image url of the image

  • attachment_id after using image upload API

  • leave blank or “default”: to use Zalo's default icon image

Note: Optimal image size: 100px * 100px

payload

object (mrButtonPayload)

content

phone_code url

title

string

Button Title

Note: Title cannot exceed 35 characters

type

string (thTemplateTxnButtonType)

Type of action that will be performed when the interested person clicks oa.open.url: Data is a Url that will be opened in the Zalo application when the interested person clicks the button. For example:

  • Note: The limit for the "title" attribute is 100 characters.

oa.query.show: Data is a string of characters, for example “#callback_data”. When the interested person clicks the button, the system will send a message containing the content in the data from the interested person to the Official Account. This message will appear in the chat window on the interested person's computer.

  • Attention:

    • The limit for the "title" attribute is 100 characters.

    • The limit for the "payload" attribute is 1000 characters.

oa.query.hide: Data is a string of characters, for example “#callback_data”. When the interested person clicks the button, the system will send a message containing the content in the data from the interested person to the Official Account. This message will be hidden in the chat window on the interested person's computer.

  • Attention:

    • The limit for the "title" attribute is 100 characters.

    • The limit for the "payload" attribute is 1000 characters.

oa.open.sms: The json object data contains 2 properties “content” and “phoneCode”. For example:

When the interested person clicks on the button, the SMS window on the interested person's phone will open with 2 available information: phone code and message content in data.

  • Attention:

    • The limit for the "title" attribute is 100 characters.

    • The "content" attribute has a limit of 160 characters.

oa.open.phone: Phone number data will be entered when turning on the calling application, for example:

When the interested person clicks on the button, the call window on the interested person's phone will open with the available information as the phone number in the data.

  • Note: The limit for the "title" attribute is 100 characters.

content_banner

object (mrContentBanner)

attachment_id: ID of the image you want to use (received via the file upload API)

image_url: Path to the image Supported image formats: jpg and png

Maximum size: 1MB Image aspect ratio (height : width): from 1:5 to 1:1 (square image)

Note: only use 1 of the 2 variables image_url or attachment_id

content_header

object (mrContentHeader)

content: The content of the header, up to 100 characters.

align: Accepts 3 values

  • left (or blank): left margin

  • center: center margin

  • right: right margin

content_table

Array

The structure of an element in a table is:

  • In which must have 1 of the 2 following elements:

    • VN:

      EN:

    or

    • VN:

      EN:

  • The "Status" key is the only key currently allowed to use the "Style" parameter:

    • VN:

      EN:

    • Values ​​of "style": green, blue, yellow, red, grey

  • In addition to the system elements specified above, the developer can declare up to 5 additional arbitrary elements.

content_text

object (mrContentText)

content: The content of the header, up to 100 characters. align: Accepts 3 values

  • left (or blank): left margin

  • center: margin

id

string

OA ID

recipient

object (mrRecipient)

user_id: Zalo user ID

template_type

string

Return data attribute structure

Parameters
Data type
Describe

msg_id

string

Notification ID

Template
News type (VN)
Message Type (EN)
Applicable industry
{
    "image_icon": "string",
    "payload": {
        "url": "string"
    },
    "title": "string",
    "type": "unknown"
}
{
    "payload": {
        "content": "sting",
        "phone_code": "string"
    },
    "title": "OPEN SMS",
    "type": "oa.open.sms"
}
{
    "payload": {
        "phone_code": "string"
    },
    "title": "OPEN PHONE",
    "type": "oa.open.phone"
}
{
  "key": "key value", // maxlength = 35
  "value": "value of value" // maxlength = 100
}
{
  "key": "Mã...", // bắt đầu là "Mã", dùng định danh người nhận
  "value": "Giá trị tự do"
}
{
  "key": "...Code...", // must contain "Code" in key 
  "value": "Free value"
}
{
  "key": "Tên khách hàng", // key có giá trị cố định "Tên khách hàng"
  "value": "Giá trị tự do"
}
{
  "key": "Customer Name", // key has fixed value "Customer Name"
  "value": "Free value"
}
{
   "key": "Trạng thái" // key có giá trị cố định "Trạng thái"
   "value": "Giá trị tự do"
   "style": "yellow" // Giá trị hợp lệ: green, blue, yellow, red, grey
}
{
   "key": "Status" // key has fixed value "Status"
   "value": "Free value"
   "style": "yellow" // Valid values: green, blue, yellow, red, grey
}

transaction_billing

Bill

Billing

All

transaction_order

Order

Order

All

transaction_reward

Earn points

Reward

All

transaction_contract

Contract

Contract

All

transaction_booking

Appointment

Booking

All

transaction_membership

Member

Membership

All

transaction_event

Event

Event

All

transaction_transaction

Transaction

Transaction

All

transaction_account

Account

Account

All

transaction_internal

Internal

Internal

All

transaction_partnership

Partner

Partnership

All

transaction_education

Education

Education

Education and training

transaction_rating

Evaluate

Rating

All

<api_key>
Shop
<shop_key>
Partner

SendZNSTxn

post
Body
languagestring · enumOptionalPossible values:
oa_idstring · int64Optional
template_typestring · enumOptionalPossible values:
Responses
200
A successful response
application/json
post
POST /SendZNSTxn HTTP/1.1
Host: $BASE_URL.Zalo
Content-Type: application/json
Accept: */*
Content-Length: 458

{
  "language": "unknown",
  "message": {
    "buttons": [
      {
        "image_icon": "text",
        "payload": {
          "content": "text",
          "phone_code": "text",
          "url": "text"
        },
        "title": "text",
        "type": "unknown"
      }
    ],
    "content_banner": {
      "attachment_id": "text",
      "image_url": "text"
    },
    "content_header": {
      "align": "text",
      "content": "text"
    },
    "content_table": [
      {
        "key": "text",
        "style": "text",
        "value": "text"
      }
    ],
    "content_text": {
      "align": "text",
      "content": "text"
    }
  },
  "oa_id": "text",
  "recipient": {
    "user_id": "text"
  },
  "template_type": "unknown"
}
200

A successful response

{
  "message_id": "text"
}