API smscentral được sử dụng để tích hợp với hệ thống của bạn khi mà bạn muốn nhắn tin độc lập thông qua các ứng dụng riêng. API smscentral được phát triển dựa trên nền giao thức HTTP với các phương thức POST/GET, điều này có nghĩa rằng bạn có thể sử dụng bất cứ ngôn ngữ lập trình nào mà bạn muốn để tích hợp cho việc gửi tin nhắn thông qua hệ thống gateway của chúng tôi.
Tất cả các yêu cầu gọi đến API bằng phương thức HTTP POST/GET đều được thông qua
Production: URL http://api.smscentral.vn/1.0/
Sandbox: URL http://sandbox-api.smscentral.vn/1.0/
SMS central API hỗ trợ JSON Content-Type và các thông tin chứng thực được định nghĩa trong Header
Một cặp thông tin bao gồm tài khoản người dùng (email) và mật khẩu được mã hóa với RFC2045-MIME BASE64 và một REST API TOKEN (X-API-KEY HTTP header) được sử dụng nhằm xác thực với hệ thống API của smscentral. Điều này đảm bảo tính bảo mật cao nhất khi bạn gọi API của chúng tôi để thực hiện việc gửi tin nhắn đi
Examples: Authenticate with an email and password and X-API-TOKEN:
• email: client@minhhop.com
• password: 1253abc
• X-API-TOKEN: 14518828996615GJ7zp
curl -i -H "Authorization: Basic Y2xpZW50QG1pbmhob3AuY29tOnBhc3Mxd3Jk" -H "X-API-TOKEN: 14518828996615GJ7zp" -H "Content-Type: application/json"
Parameter | Required | Type | Description |
---|---|---|---|
sender_id | YES | String | Your Brandname or Number of your company. |
type | YES | int | Type of sms message. (type: 0 - CSKH, 1 - QC) |
messages | Yes | List | A JSON encoded list of a follow object [{content: ' content of message', ‘receiver’: a phone number will receive sms message'}] |
URL http://api.smscentral.vn/1.0/campaigns
Parameter | Required | Type | Description |
---|---|---|---|
sender_id | YES | String | Your Brandname or Number of your company. |
schedule | NO | date | Time will send sms, format: “dd-MM-yyyy HH:mm”. Null if you want to send instant sms message. |
type | YES | int | Type of sms message. (type: 0 - CSKH, 1 - QC) |
messages | Yes | List | A JSON encoded list of a follow object [{content: ' content of message', ‘receiver’: a phone number will receive sms message'}] |
curl -i -H "Authorization: Basic Y2xpZW50QG1pbmhob3AuY29tOnBhc3Mxd3Jk" -H "X-API-TOKEN: 14518828996615GJ7zp" -H "Content-Type: application/json" -X POST –d' '{"sender_id": "SMSCENTRAL","type": 0, "messages": [{"content": "May the Force With you","receiver": ["09XXXXXX", "09XXXXXX"]},{"content": "The tin dung cua quy khac vua thuc hien giao dich nhu sau: XXXXX3952-VND 17300041 on 03-01-2016", "receiver": ["09XXXXXX"]}]
Cho phép bạn lấy thông tin của một hoặc nhiều campaign đã được khởi tạo trên hệ thống smscentral.
Field | Type | Description |
---|---|---|
name | String | Name of campaign |
id | String | Id of campaign |
schedule_date | date | Time will send sms, format: “dd-MM-yyyy HH:mm”. Null if you want to send instant sms. |
total_sms | int | Total sms was sent of the campaign. |
failed | int | The number of sent SMS messages fail. |
success_sms | int | The number of sent SMS messages success. |
processing_sms | int | The number of SMS messages being processed. |
curl -i -H "Authorization: Basic Y2xpZW50QG1pbmhob3AuY29tOnBhc3Mxd3Jk" -H "X-API-TOKEN: 14518828996615GJ7zp" -H "Content-Type: application/json" -X GET http://api.smscentral.vn/1.0/campaigns
A successful request will be indicated by a 200 OK HTTP status code.
Requests that return multiple items will be paginated to 10 items per page, You can specify further pages with the ?page parameter.
curl -i -H "Authorization: Basic Y2xpZW50QG1pbmhob3AuY29tOnBhc3Mxd3Jk" -H "X-API-TOKEN: 14518828996615GJ7zp" -H "Content-Type: application/json" -X GET http://api.smscentral.vn/1.0/campaigns/1453691750369NCN3No