一、 文档概述
1.1格式说明
1.1.1调用方式明
使用http协议调用,可以GET也可以POST调用,也可以直接使用浏览器打开接口地址进行访问,和测试。
1.1.2提交编码
提交的数据要求UTF-8编码,要注意在浏览器高级选项中选中"总是以UTF-8发送 URL"。
1.1.3多线程访问
开通的账号默认最大线程数为3个,如果线程并发量超出会报错,导致提交失败,多次超限并发访问可能会锁账号。如需对账号开启更多线程,请联系我们相关人员开启。
1.2加密算法说明
1.2.1 seqid
序列号(seqid)格式 : yyMMddHHmmssxxxxxx 前十二位为时间,后六位为自定义数字,例 160615134758000001
1.2.2 sign
签名(sign) : md5(seqid + md5(password)), md5为32位小写格式
二、 功能接口说明
2.1发送短信
2.1.1接口地址
https://sms.ccell.cn/sms3_api/xmlapi/send.jsp
2.1.2参数说明
2.1.2.1请求参数
请求包体必须为标准的XML
请求包体说明:
1 2 3 4 5 6 7 | < root userid = "{账号(必填)}" seqid = {序列号(必填,必须唯一)}" sign = {签名(必填)}" > < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " /> < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " /> …… < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " /> </ root > |
注意:每次请求提交的号码数请控制在500个以内。多个号码的分隔符为英文半角”,”。短信内容不能超过1000字符。
请求包体示例(密码为123456):
1 2 3 4 5 6 7 | < root userid = "200001" seqid = "160615134758000001" sign = "d679463dd87931f880095f213e3ae96f" > < submit phone = "13800000000,13600000xxx" content = "验证码为1234。【签名】" /> < submit phone = "13800000001" content = "验证码为1235。【签名】" /> <…… < submit phone = "13800300000" content = "验证码为1334。【签名】" /> </ root > |
请求示例(Get):
https://sms.ccell.cn/sms3_api/xmlapi/send.jsp?<root userid="200001" seqid="160615134758000001" sign="d679463dd87931f880095f213e3ae96f"><submit phone="13800000000,13600001234" content="验证码为1234。【签名】"/><submit phone="13800000001" content="验证码为1235。【签名】"/><submit phone="13800300000" content="验证码为1334。【签名】"/></root>
2.1.2.2返回值说明
返回值为标准的XML
返回值包体说明:
1 2 3 4 5 6 7 8 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < resp msgid = "{序列号}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> < resp msgid = "{序列号}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> …… < resp msgid = "{序列号}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> </ root > |
返回值包体示例:
1 2 3 4 5 6 7 8 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "0" info = "成功" > < resp msgid = "4429784632870016900" phone = "13800000000" return = "0" info = "成功" /> < resp msgid = "4429784655540021500" phone = "19500001111" return = "1004001" info = "手机号不可识别19500001111" /> …… < resp msgid = "4429784632770016623" phone = "13800300001" return = "0" info = "成功" /> </ root > |
注意:msgid为唯一序列,状态报告会原样返回。如果验证不成功会返回<?xml version="1.0" encoding="UTF-8"?><root return="{状态码}" info="{描述}"></root>形式的节点。
2.2获取状态报告
2.2.1接口地址
https://sms.ccell.cn/sms3_api/xmlapi/report.jsp
2.2.2参数说明
2.2.2.1请求参数
请求包体必须为标准的XML
请求包体说明:
1 2 3 | < root userid = "{账号}" seqid = {序列号(必填,必须唯一)}" sign = {签名(必填)}" > </ root > |
请求包体示例(密码为123456):
1 2 3 | < root userid = "200001" seqid = "160615134758000001" sign = "d679463dd87931f880095f213e3ae96f" > </ root > |
请求示例(Get):
https://sms.ccell.cn/sms3_api/xmlapi/report.jsp?<root userid="200001" seqid="160615134758000001" sign="d679463dd87931f880095f213e3ae96f"></root>
2.2.2.2返回值说明
返回值为标准的XML
返回值包体说明:
1 2 3 4 5 6 7 8 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < report msgid = "{序列号}" linkid = "{原样返回的自定义序列码,没有使用为空}" phone = "{手机号码}" recvtime = "{时间}" status = "{状态码}" info = "{描述}" /> < report msgid = "{序列号}" linkid = "{原样返回的自定义序列码,没有使用为空}" phone = "{手机号码}" recvtime = "{时间}" status = "{状态码}" info = "{描述}" /> …… < report msgid = "{序列号}" linkid = "{原样返回的自定义序列码,没有使用为空}" phone = "{手机号码}" recvtime = "{时间}" status = "{状态码}" info = "{描述}" /> </ root > |
返回值包体示例:
1 2 3 4 5 6 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "0" info = "成功" > < report msgid = "4476784446833128000" linkid = "" phone = "13800000000" recvtime = "2015-10-10 10:54:15.0" status = "0" info = "成功" /> < report msgid = "4476784449803139900" linkid = "" phone = "13800000001" recvtime = "2015-10-10 10:54:15.0" status = "-1" info = "ERRORRD" /> < report msgid = "4476784453383145800" linkid = "" phone = "13800300000" recvtime = "2015-10-10 10:54:15.0" status = "0" info = "成功" /> </ root > |
注意:每次连接最多返回300条状态(最多300个report节点)。如果没有状态会返回空的<?xml version="1.0" encoding="UTF-8"?><root return="0" info="成功"></root>。如果验证不成功会返回<?xml version="1.0" encoding="UTF-8"?><root return="{状态码}" info="{描述}"></root>形式的节点。
2.3获取上行
2.3.1接口地址
https://sms.ccell.cn/sms3_api/xmlapi/upmsg.jsp
2.3.2参数说明
2.3.2.1请求参数
请求包体必须为标准的XML
请求包体说明:
1 2 | < root userid = "{账号}" seqid = {序列号(必填,必须唯一)}" sign = {签名(必填)}" > </ root > |
<root userid="{账号}" seqid="{序列号(必填,必须唯一)}" sign="{签名(必填)}">
</root>
请求包体示例(密码为123456):
1 2 | < root userid = "200001" seqid = "160615134758000001" sign = "d679463dd87931f880095f213e3ae96f" > </ root > |
请求示例(Get):
https://sms.ccell.cn/sms3_api/xmlapi/upmsg.jsp?<root userid="200001" seqid="160615134758000001" sign="d679463dd87931f880095f213e3ae96f"></root>
2.3.2.2返回值说明
返回值为标准的XML
返回值包体说明:
1 2 3 4 5 6 7 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < upmsg spnumber = "{端口号}" phone = "{手机号码}" motime = "{时间}" msgcontent = "{上行内容}" /> < upmsg spnumber = "{端口号}" phone = "{手机号码}" motime = "{时间}" msgcontent = "{上行内容}" /> …… < upmsg spnumber = "{端口号}" phone = "{手机号码}" motime = "{时间}" msgcontent = "{上行内容}" /> </ root > |
返回值包体示例:
1 2 3 4 5 6 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "0" info = "成功" > < upmsg spnumber = "0001" phone = " 13800000000" motime = "2015-10-10 17:48:46" msgcontent = "知道了" /> < upmsg spnumber = "0001" phone = " 13800000001" motime = "2015-10-10 18:15:19" msgcontent = "ok" /> < upmsg spnumber = "0001" phone = " 13800300000" motime = "2015-10-10 18:15:29" msgcontent = "收到" /> </ root > |
注意:每次连接最多返回100条上行(最多100个upmsg节点)。如果没有上行会返回空的<?xml version="1.0" encoding="UTF-8"?><root return="0" info="成功"></root>。如果验证不成功会返回<?xml version="1.0" encoding="UTF-8"?><root return="{状态码}" info="{描述}"></root>形式的节点。
2.4发送短信高级附加功能
2.4.1接口地址
https://sms.ccell.cn/sms3_api/xmlapi/send.jsp
2.4.2参数说明
2.4.2.1请求参数
特别提醒:
该功能是在普通发送短信的基础上增加了可选参数sendtime、linkid、spcode。spcode的功能短信账号默认未开通,如果未开通的情况下使用,提交短信会报错,不能正常提交,请谨慎操作。如需spcode功能请联系相关人员开通。
请求包体必须为标准的XML
请求包体说明:
1 2 3 4 5 6 7 8 9 10 | < root userid = "{账号(必填)}" seqid = {序列号(必填,必须唯一)}" sign = {签名(必填)}" > < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " sendtime = "{定时发送时间,不选或空为立即发送(可选)}" linkid = "{自定义序列码,状态报告会原样返回(可选)}" spcode = "{扩展号(可选,未分配不要使用)}" /> < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " sendtime = "{定时发送时间,不选或空为立即发送(可选)}" linkid = "{自定义序列码,状态报告会原样返回(可选)}" spcode = "{扩展号(可选,未分配不要使用)}" /> …… < submit phone = "{电话号码,若多个号码用”,”隔开(必选)}" content = "{短信内容(必选)} " sendtime = "{定时发送时间,不选或空为立即发送(可选)}" linkid = "{自定义序列码,状态报告会原样返回(可选)}" spcode = "{扩展号(可选,未分配不要使用)}" /> </ root > |
注意:phone、content为必选参数。sendtime 、linkid、spcode为可选参数。sendtime时间格式为YYYY-MM-DD HH:MM:SS(如:2016-01-01 08:30:30)。spcode需要账号支持才能使用,如果账号未分配扩展号,请不要使用。每次请求提交的号码请控制在500个以内。多个号码的分隔符为英文半角”,”。
请求包体示例(密码为123456):
1 2 3 4 5 6 7 8 9 10 | < root userid = "200001" seqid = "160615134758000001" sign = "d679463dd87931f880095f213e3ae96f" > < submit phone = "13800000000,13600000xxx" content = "验证码为1234。【签名】" sendtime = "2016-01-01 08:30:30" linkid = "100001111110" spcode = "168168" /> < submit phone = "13800000001" content = "验证码为1235。【签名】" sendtime = "2016-01-01 08:30:30" linkid = "100001111111" spcode = "168168" /> …… < submit phone = "13800300000" content = "验证码为1334。【签名】" sendtime = "2016-01-01 08:30:30" linkid = "100001111112" spcode = "168168" /> </ root > |
请求示例(Get):
https://sms.ccell.cn/sms3_api/xmlapi/send.jsp?<root userid="200001" seqid="160615134758000001" sign="d679463dd87931f880095f213e3ae96f"><submit phone="13800000000,13600001234" content="验证码为1234。【签名】" sendtime="2016-01-01 08:30:30" linkid="100001111110" spcode="168168"/><submit phone="13800000001" content="验证码为1235。【签名】" sendtime="2016-01-01 08:30:30" linkid="100001111111" spcode="168168"/><submit phone="13800300000" content="验证码为1334。【签名】" sendtime="2016-01-01 08:30:30" linkid="100001111112" spcode="168168"/></root>
2.4.2.2返回值说明
返回值为标准的XML
返回值包体说明:
1 2 3 4 5 6 7 8 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < resp msgid = "{序列号}" linkid = "{自定义序列码}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> < resp msgid = "{序列号}" linkid = "{自定义序列码}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> …… < resp msgid = "{序列号}" linkid = "{自定义序列码}" phone = "{手机号码}" return = "{状态码}" info = "{描述}" /> </ root > |
返回值包体示例:
1 2 3 4 5 6 7 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "0" info = "成功" > < resp linkid = "100001111110" msgid = "4429784632870016900" phone = "13800000000" return = "0" info = "成功" /> < resp linkid = "100001111111" msgid = "4429784655540021500" phone = "19500001111" return = "1004001" info = "手机号不可识别19500001111" /> …… < resp linkid = "100001111112" msgid = "4429784632770016623" phone = "13800300001" return = "0" info = "成功" /> </ root > |
注意:msgid为唯一序列,状态报告会原样返回。如果验证不成功会返回<?xml version="1.0" encoding="UTF-8"?><root return="{状态码}" info="{描述}"></root>形式的节点。
2.5 查看客户信息
2.5.1接口地址
https://sms.ccell.cn/sms3_api/xmlapi/info.jsp
2.5.2参数说明
2.5.2.1请求参数
请求包体必须为标准的XML
请求包体说明:
1 2 | < root userid = "{账号}" seqid = {序列号(必填,必须唯一)}" sign = {签名(必填)}" > </ root > |
请求包体示例(密码为123456):
1 2 | < root userid = "200001" seqid = "160615134758000001" sign = "d679463dd87931f880095f213e3ae96f" > </ root > |
请求示例(Get):
https://sms.ccell.cn/sms3_api/xmlapi/info.jsp?<root userid="200001" seqid="160615134758000001" sign="d679463dd87931f880095f213e3ae96f"></root>
2.3.2.2返回值说明
返回值为标准的XML
返回值包体说明:
1 2 3 4 5 6 7 8 9 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < ID >{发送短信的短信号}</ ID > < NAME >{云平台的登录账号}</ NAME > < STATUS >{该短信号的状态,0 正常}</ STATUS > < RICHES >{余额(剩下的短信条数)}</ RICHES > < CREDIT >{信用条数,余额不足时可使用信用发送}</ CREDIT > < SIGNCODE >{当前使用的签名(*代表任意签名)}</ SIGNCODE > </ root > |
返回值包体示例:
1 2 3 4 5 6 7 8 9 10 | <? xml version = "1.0" encoding = "UTF-8" ?> < root return = "{状态码}" info = "{描述}" > < ID >asdfkajsdlfkads@163.com</ ID > < NAME >2000136</ NAME > < STATUS >0</ STATUS > < RICHES >100000010</ RICHES > < CREDIT >0</ CREDIT > < SIGNCODE >*</ SIGNCODE > </ root > |
三、 附件
3.1状态码说明
状态码 | 说明 |
0 | 成功 |
1001001 | 参数不完整 |
1001002 | 余额不足 |
1001003 | 账号已冻结 |
1001004 | 密码不正确 |
1001005 | 访问IP受限 |
1001006 | 并发数超限 |
1001007 | 短信附加语不符 |
1004001 | 手机号不可识别 |
1004002 | 未配置有效发送规则 |
1004003 | 短信内容必须有签名 |
1004004 | 短信内容必须指定签名 |
1004005 | 短信内容指定签名 |
1004006 | 无可用通道 |
1004007 | 模板不匹配 |
1004008 | 不能发黑名单号码 |
1004009 | 非白名单号码 |
1004010 | 不能发黑词内容 |
1004011 | 内容中不包括白词 |
1004012 | 定时发送时间参数不正确 |
1004013 | 定时发送时间不能大于50天 |
1004014 | 定时发送时间不能小于当前时间 |
1004015 | 短信签名限20字符 |
1001999 | 接口系统错 |