Note that the use of SMS interface v2 requires Interface Authentication
Get SMS template interface
-
HTTP request method:POST
-
Received data encoding format:ISO-8859-1
-
Request url:{HOST}/v20160818/sms/getSmsTemplate/accountID?sig=SIG
-
When requesting, please replace {HOST} with connection data queryDomain name,ACCOUNTID is replaced with the account number, SIG is generated according to the authentication rules, please see the authentication document to see the specific generation rules.
-
Authentication document: Interface Authentication
-
Return example:
{ "success": true, "data": [ { "_id": " N00000000556 _1", "num": "1", "name": "Captcha template", "content": "Hello Your verification code is {1}, valid time is {2} minutes", "vars": 2, "sign": "[C7 Malaysia Technology]" }, { "_id": " N00000000556 _2", "num": "2", "name": "meeting invitation", "content": "{1} Mr./Madam, C7 Malaysia Technology welcomes you to attend the meeting, the meeting time is {2}, the address is {3}", "vars": 3, "sign": "[C7 Malaysia Technology]" } ], "message": "200 ok!" }
Return value parameter description:
parameter name Parameter Description Value description success Success flag true/false message Description 200 ok Send SMS interface
Note that the use of this interface requires interface authentication
Interface request method:POST Received data encoding format:ISO-8859-1
-
Request url:{HOST}/v20160818/sms/sendInterfaceTemplateSms/accountID?sig=xxx
-
When requesting, please replace {HOST} with connection data queryDomain name,ACCOUNTID is replaced with the account number, SIG is generated according to the authentication rules, please see the authentication document to see the specific generation rules.
N00000000556 is the account number (accountID), please replace it with your account number, sig is the authentication parameter.
Request body
Field Type Is necessary Remark num String yes Receive mobile phone numbers, multiple mobile phone numbers are separated by commas, and the maximum number of calls is 3000 templateNum String yes SMS template number, which must be reported in advance and obtained from the template query interface var1-varn String yes Variables to be replaced, for example: {1} to pass var1, Chinese to urlencode Note that if you need to send SMS to multiple mobile numbers at the same time, you can use comma to separate multiple mobile numbers in num
Example request body:
{ "num": "186xxxxxxxx", "templateNum": "13", "var1": "888666" }
Return example:
{ "success": true, "message": "200 ok!" }
Return value parameter description:
parameter name Parameter Description value success Success flag true/false msgid SMS id flag Response code message Remark Example returned successfully:
{ "success": true, "flag": "00", "msgid": "d0a30fe0-c331-11e6-96c7-b3a8b30da8b6", "message": "SMS submitted successfully" }
Failure return example:
{ "success": false, "flag": "12", "message": "No corresponding SMS template found" }
Response status table
success flag Description true 00 Submit channel successful false 01 Template number is empty false 02 Content is empty or too long false 03 Phone number is empty false 04 Account is empty false 06 You can not send more than 3,000 mobile phone numbers at a time, please check the number of numbers false 07 Contains incorrect mobile number, please check false 09 Your account has not opened the HTTP interface for sending text messages false 10 Insufficient tariff to send text message false 11 This signature has not been filed false 12 No corresponding SMS template found false 13 This template is abnormal and cannot send SMS false 99 Internal server error -