发送第一条测试短信 Test Sms

1. 阿里大于SDK短信API调用代码示例

1.1 请求参数

1.2 开发者请求示例

  • java
//引入阿里大于SDK
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest;
import com.taobao.api.request.AlibabaAliqinFcSmsNumSendResponse;

//请填写自己的app key,app secret
TaobaoClient client = new DefaultTaobaoClient(url, "your_app_key", "your_app_secret");
AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();

req.setExtend("123456");
req.setSmsType("normal");
req.setSmsFreeSignName("阿里大于");
req.setSmsParamString("{\"code\":\"888888\",\"product\":\"阿里大于(http://www.alidayu.com)\",\"item\":\"阿里大于\"}");
//请填写需要接收的手机号码
req.setRecNum("13000000000");
//短信模板id
req.setSmsTemplateCode("SMS_585014");

AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);

System.out.println(rsp.getBody());
  • php
//引入阿里大于SDK
include "alidayu-openapi-php-sdk/TopSdk.php";

$c = new TopClient;
//请填写自己的app key
$c->appkey = "your_app_key";
//请填写自己的app secret
$c->secretKey = "your_app_secret";

$req = new AlibabaAliqinFcSmsNumSendRequest;
$req->setExtend("123456");
$req->setSmsType("normal");
$req->setSmsFreeSignName("阿里大于");
$req->setSmsParam("{\"code\": \"888888\", \"product\": \"阿里大于(http://www.alidayu.com)\"}");
//请填写需要接收的手机号码
$req->setRecNum("your_phone_number");
//短信模板id
$req->setSmsTemplateCode("SMS_645006");

$resp = $c->execute($req);
  • nodejs
    • 待补充

1.3 阿里大于服务端返回示例

  • 成功
{
    "alibaba_aliqin_fc_sms_num_send_response":{
        "result":{
            "err_code":"0",
            "model":"134523^4351232",
            "success":false,
            "msg":"成功"
        }
    }
}
  • 失败
{
    "error_response":{
        "code":50,
        "msg":"Remote service error",
        "sub_code":"isv.invalid-parameter",
        "sub_msg":"非法参数"
    }
}

1.4 错误码解释

1.5 常用开发工具

results matching ""

    No results matching ""