SMS Template

ou can query, add, delete and update contact list through following interfaces.


Query a single template

Return basic information of SMS template

URL

https://api.sendcloud.net/smsapi/get

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
smsUser string yes smsUser
templateIdStr string yes template ID
signature string yes digital signature, validity verification

Request Example

https://api.sendcloud.net/smsapi/get?smsUser=***&templateIdStr=***&signature=***

Returned value description

parameter description
templateId SMS template ID
templateName template name
msgType business type
smsType SMS type
isVerify verified or not
templateContent template content
createTime time of creating the template
updateTime time of updating the template

Returned value example

{
    "info": {
        "templateId": 00,
        "templateName": "验证码",
        "msgType": "国内短信",
        "smsType": "验证码",
        "templateContent": "【爱发信】短息api模板",
        "isVerify": "审核通过",
        "createTime": "2015-03-23",
        "updateTime": "2017-03-29"
    },
    "message": "请求成功",
    "result": true,
    "statusCode": 200
}

Query multiple templates

Return to SMS template

URL

https://api.sendcloud.net/smsapi/list

HTTP Request Method

post    get

Parameter Description

parameter type required description
smsUser string yes smsUser
templateIdStr string no template ID, for multiple; separate
start int no query start position, value range [0 -], default is 0
limit int no number of queries, value range [0-100], default to 100
isVerifyStr string no whether it passes the verification; "0" to be reviewed "1" passed "- 1" failed "- 2" not submitted for review "
signature string yes digital signature, validity verification

Tips:

  1. The user can specify a template ID to query. If it is not specified, all templates will be queried by default.
  2. Query start position, the value is [0 -] and the default is 0
  3. The number of queries is limited to 0-100, and the default is 100

Request Example

https://api.sendcloud.net/smsapi/list?smsUser=***&isVerifyStr=***&signature=***

Returned value description

parameter description
templateId SMS template ID
templateName template name
msgType business type
smsType type of message content
isVerify verified or not
templateContent template content
templateCreateTime time of creating the template
templateUpdateTime time of updating the template

Returned value example

{
    "result" : true,
    "statusCode" : 200,
    "message" : "请求成功",
    "info" : {
        "total" : 2,
        "list" : [{
                "templateContent" : "闪达科技【SendCloud】",
                "templateCreateTime" : "2016-08-25",
                "templateId" : 00,
                "templateName" : "中秋快乐",
                "msgType" : "国内短信",
                "smsType" : "验证码",
                "isVerify" : "审核通过",
                "templateUpdateTime" : "2016-08-25"
            }, {
                "templateContent" : "【爱发信】闪达科技",
                "templateCreateTime" : "2016-08-25",
                "templateId" : 01,
                "templateName" : "国庆快乐",
                "msgType" : "国内短信",
                "smsType" : "验证码",
                "isVerify" : "审核通过",
                "templateUpdateTime" : "2016-08-25"
            }
        ]
    }
}

Add template

Return of whether template has been added successfully

URL

https://api.sendcloud.net/smsapi/addsms

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
smsUser string yes smsUser
templateName string yes template name, unique
templateText string yes template content
signName string * signature in bracket of message
signId Integer * ID of SMS signature
signPositionStr string no signature position. "0" represents the prefix position and "1" represents the suffix position for the signature. The default position is prefix. This parameter only takes effect when msgType=2.
smsTypeStr string yes type of message content. “0”: verification code; “1”: business notice; “2”: marketing
signature string yes signature, validity verification
msgType string no message type. “0”: SMS; “2”: international SMS; defaults to “0”.
sendToSubscriber string no Whether to send to VIP(Must be a numeric string and can only be 0 or 1). Please fill in this parameter if the message content type is business notice or marketing.
estimateSendNum string no Estimated delivery volume(Must be a numeric string, with a maximum of 2147483647). Please fill in this parameter if the message content type is business notice or marketing.
sendContentExample string no Send sample content. If variables are used in the template, please fill in the send sample.

Note:

  1. signId is the ID of SMS signature; "signId" or "signName" is required for Non international SMS. If signId is not empty, signName will be automatically ignored. This is not necessary for international SMS.

Request Example

https://api.sendcloud.net/smsapi/addsms?smsUser=***&templateName=***&templateText=***&signName=***&signPositionStr=**8&smsTypeStr=***&signature=***

Request Example

parameter description
templateId SMS template ID

Returned value description

{
    "info" : {
        "templateId" : 3381
    },
    "message" : "插入成功",
    "result" : true,
    "statusCode" : 200
}

Submit for verification

Return of whether the template has been successfully submitted for verification.

URL

https://api.sendcloud.net/smsapi/submitsms

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
smsUser string yes smsUser
templateIdStr string yes template ID
signature string yes signature, validity verification

Request Example

https://api.sendcloud.net/smsapi/submitsms?smsUser=***&templateIdStr=***&signature=***

Returned value example

{
    "result" : true,
    "statusCode" : 200,
    "message" : "提交成功",
    "info" : {}
}

Update template

Return of whether the template has been updated successfully.

URL

https://api.sendcloud.net/smsapi/updatesms

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
smsUser string yes smsUser
templateIdStr string yes template ID
templateName string yes template name
templateText string no template content
signName string * signature in bracket of message
signId Integer * ID of SMS signature
signPositionStr string yes signature position. “0”: prepositioned; “1”: postpositioned; defaults to “0”
smsTypeStr string yes type of message content. “0”: verification code; “1”: business notice; “2”: marketing
signature string yes signature, validity verification
sendToSubscriber string no Whether to send to VIP(Must be a numeric string and can only be 0 or 1). Please fill in this parameter if the message content type is business notice or marketing.
estimateSendNum string no Estimated delivery volume(Must be a numeric string, with a maximum of 2147483647). Please fill in this parameter if the message content type is business notice or marketing.
sendContentExample string no Send sample content. If variables are used in the template, please fill in the send sample.

Note:

  1. signId is the ID of SMS signature; "signId" or "signName" is required for Non international SMS. If signId is not empty, signName will be automatically ignored. This is not necessary for international SMS.

Request Example

https://api.sendcloud.net/smsapi/updatesms?smsUser=***&templateIdStr=***&templateName=***&templateText=***&signName=***&signPositionStr=***&smsTypeStr=***&signature=***

Returned value example

{
    "result" : true,
    "statusCode" : 200,
    "message" : "更新成功",
    "info" : {}
}

Delete template

Return of whether the template has been deleted.

URL

https://api.sendcloud.net/smsapi/deletesms

HTTP Request Method

post    get

Parameter Description

parameter type required or not description
smsUser string yes smsUser
templateIdStr string yes template ID
signature string yes signature, validity verification

Request Example

https://api.sendcloud.net/smsapi/deletesms?smsUser=***&templateIdStr=***&signature=***

Returned value example

{
    "result" : true,
    "statusCode" : 200,
    "message" : "删除成功",
    "info" : {}
}