eSMS for Developers
Đăng nhập
EN - eSMS for Developers
EN - eSMS for Developers
  • Overview
    • Getting started
    • Mechanism
    • Access to the API information
  • eSMS API
    • Send SMS API
      • Send OTP/Customer care message
      • Send adveritising message
      • Send message via Zalo
      • Send message via Viber
      • Send fixed number with cheap price
      • Send multi-channel message via Zalo and SMS
      • Send personized message via Zalo
      • Send Zalo message Consulting in text form
      • Send Zalo message with attached photo
      • Send Zalo message Consulting button
      • Send Zalo Trading message
      • Send Zalo messages to request user's information
      • Send Journey ZNS message
      • Send auto-generated SMS
      • The multichannel auto-generated OTP
    • Retrive and register functions
      • Get balance
      • Get the message status
      • Get SMS by SMSID
      • Get message details
      • Get list registered brandnames
      • Get list customer care templates
      • Summary your customer care submit
      • Summary your advertising submit
      • Get list OA
      • Get list templates of OA
      • Summary Zalo message
      • Get the daily quota of OA
      • Get rating information of Zalo users
      • Check the OA quality
      • Get list Zalo's followers
      • Get callback data
      • Get Zalo template details
      • Purchase OA package
      • Registering the Zalo template
      • Registering SMS template
    • Other APIs
      • Send customer care message using GET
      • Send customer care message using POST X-Form
      • Send customer care message using POST TEXT
      • Send fixed number using GET
      • Send advertising message using POST TEXT
      • Send Zalo message (old version)
      • Send Zalo message using POST X-FORM
      • Send Zalo message full template
      • Send Viber message using GET
      • Check code
    • Svoucher Connect
      • Connect to shortcode service
    • Voice
      • Create voice OTP call
      • Create an auto-call using template
      • Create a call from recording file
      • Get voice call status
    • Table of error codes
    • Test environment ( Sandbox)
    • Callback Url
Powered by GitBook
On this page
  1. eSMS API
  2. Voice

Create an auto-call using template

Hàm cho phép bạn gửi tin nhắn thoại đến 1 số điện thoại bởi mẫu cuộc gọi đã được tạo sẵn trên hệ thống.

PreviousCreate voice OTP callNextCreate a call from recording file

HTTP request

GET

  • Response Type: application/json

curl --location --globoff 'https://voiceapi.esms.vn/MainService.svc/json/MakeCallTemplate_V2?ApiKey={{ApiKey}}&SecretKey={{SecretKey}}&TemplateId={{TemplateId}}&Phone={{Phone}}&VariableListStr={{VariableListStr}}&SendDate={{SendDate}}&Voice={{Voice}}&Speed={{Speed}}&CallbackUrl={{CallbackUrl}}&RequestId={{RequestId}}'
  • Cấu trúc body của request::

Tham số
Kiểu dữ liệu
Tính bắt buộc
Mô tả

ApiKey

string

ApiKey của tài khoản

SecretKey

string

Secretkey của tài khoản

TemplateId

string

Id kịch bản cuộc gọi đăng ký trên trang account.esms.vn

Phone

string

Số điện thoại nhận tin

VariableListStr

string

Chuỗi biến chứa danh sách giá trị các biến của mẫu cuộc gọi, cách nhau bởi dấu “||”, thứ tự các biến từ trái sang phải. Ví dụ: Trung||20000 (Giá trị biến 1: Trung, Giá trị biến 2: 20000)

SendDate

string

Đặt lịch gửi tin (định dạng: yyyy/MM/dd hh:mm:ss) Ví dụ: 2017/12/12 14:00:00

Voice

string

Giọng đọc biến, có các giá trị sau đây:

  • male: giọng nam miền Bắc

  • female: giọng nữ miền Bắc

  • hatieumai: giọng nữ miền Nam

  • ngoclam: giọng nữ Huế

Speed

string

Tốc độ đọc biến, có các giá trị sau đây:

  • -3: rất chậm

  • -2: khá chậm

  • -1: chậm

  • 0: bình thường

  • 1: nhanh

  • 2: khá nhanh

  • 3: rất nhanh

RequestId

string

ID Tin nhắn của đối tác, dùng để kiểm tra ID này đã được hệ thống esms tiếp nhận trước đó hay chưa. Ví dụ: requestid=123456

CallbackUrl

string (URL Encode)

Url nhận callback kết quả cuộc gọi (mẫu: https://{{Your_API_Domain}}/Esms/ReceiveVocieCallback?ReferenceId=&CallDuration=&CallStatus=&Ivr=&Price=&SentResult=&CID=&SendStatus=)

  • CallDuration: độ dài cuộc gọi

  • CallStatus: kết quả cuộc gọi (ANSWERED, NO ANSWER)

  • Ivr: phím bấm của khách hàng

  • Price: giá cuộc gọi

  • SentResult: Kết quả gửi tin qua nhà mạng (0: thất bại, 1: thành công)

  • CID: đầu số gửi tin

  • SendStatus: Trạng thái cuộc gọi:

2: Chờ gửi.

5: Đã gửi xong.

7: Đã gửi chờ báo cáo.

Yêu cầu phản hồi:

Khi đối tác nhận được dữ liệu, vui lòng trả về trạng thái HTTP_STATUS_CODE=200 để xác nhận với ESMS là thành công.

Nếu không nhận được HTTP_STATUS_CODE 200, ESMS sẽ tiến hành gửi lại tối đa 5 lần. Ví dụ: curl --location --globoff --request GET 'https://{{Your_API_Domain}}/Esms/ReceiveVocieCallback?ReferenceId=066107ee-6ec4-4283-b595-aa74977c65c5&CallDuration=0&CallStatus=&Ivr=&Price=0.0000&SentResult=0&CID=02871002454&SendStatus=5'


  • Response:

{
 "CodeResult": "100",
 "SMSID": "8eb2af6d-fb4c4814-b9cc-4c0e3ed32edf "
}

Request hợp lệ.

{
    "CodeResult": "101",
    "ErrorMessage": "Authorize Failed"
}

Sai thông tin ApiKey/SecretKey.

{
    "CodeResult": "104",
    "ErrorMessage": "Template not found"
}

TemplateId không tổng

  • Cấu trúc body của response:

Thuộc tính
Kiểu dữ liệu
Mô tả

CodeResult

string

Mã trả về.

SMSID

string

ID của cuộcgoji mới được tạo ra trên hệ thống eSMS. Dùng ID này để query lấy trạng thái cuộc gọi.

Thông tin chi tiết mã lỗi xem ở bảng: .

Lấy code mẫu các ngôn ngữ trên Postman: .

https://voiceapi.esms.vn/MainService.svc/json/MakeCallTemplate_V2?ApiKey={{ApiKey}}&SecretKey={{SecretKey}}&TemplateId={{TemplateId}}&Phone={{Phone}}&VariableListStr={{VariableListStr}}&SendDate={{SendDate}}&Voice={{Voice}}&Speed={{Speed}}&CallbackUrl={{CallbackUrl}}&RequestId={{RequestId}}
Mã lỗi
Link code mẫu