TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAliqinFcDigitalsmsCreatetemplateRequest req = new AlibabaAliqinFcDigitalsmsCreatetemplateRequest();
req.setTemplateName("****模板");
List<AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDto> list2 = new ArrayList<AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDto>();
AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDto obj3 = new AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDto();
list2.add(obj3);
obj3.setFileSuffix("txt");
obj3.setFileName("file-1.txt");
obj3.setFileSize(1840901L);
obj3.setFileContents("字符");
req.setTemplateContents(list2);
req.setApplyRemark("***业务需要");
AlibabaAliqinFcDigitalsmsCreatetemplateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAliqinFcDigitalsmsCreatetemplateRequest req = new AlibabaAliqinFcDigitalsmsCreatetemplateRequest();
req.TemplateName = "****模板";
List<AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDtoDomain> list2 = new List<AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDtoDomain>();
AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDtoDomain obj3 = new AlibabaAliqinFcDigitalsmsCreatetemplateRequest.DigitalSmsTemplateContentDtoDomain();
list2.Add(obj3);
obj3.FileSuffix = "txt";
obj3.FileName = "file-1.txt";
obj3.FileSize = 1840901L;
obj3.FileContents = "字符";
req.TemplateContents_ = list2;
req.ApplyRemark = "***业务需要";
AlibabaAliqinFcDigitalsmsCreatetemplateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAliqinFcDigitalsmsCreatetemplateRequest;
$req->setTemplateName("****模板");
$template_contents = new DigitalSmsTemplateContentDto;
$template_contents->file_suffix="txt";
$template_contents->file_name="file-1.txt";
$template_contents->file_size="1840901";
$template_contents->file_contents="字符";
$req->setTemplateContents(json_encode($template_contents));
$req->setApplyRemark("***业务需要");
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.aliqin.fc.digitalsms.createtemplate' \
-d 'partner_id=apidoc' \
-d 'session=91296e0a-dd83-463e-8e74-cc38bbf3a8fa' \
-d 'sign=BF223136F0D0BE0C54D89B480BE67897' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A00%3A04' \
-d 'v=2.0' \
-d 'apply_remark=***%E4%B8%9A%E5%8A%A1%E9%9C%80%E8%A6%81' \
-d 'template_contents=null' \
-d 'template_name=****%E6%A8%A1%E6%9D%BF'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAliqinFcDigitalsmsCreatetemplateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.template_name="****模板"
req.template_contents=""
req.apply_remark="***业务需要"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.aliqin.fc.digitalsms.createtemplate");
add_param(pRequest,"template_name","****模板");
add_param(pRequest,"template_contents","数据结构JSON示例");
add_param(pRequest,"apply_remark","***业务需要");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.aliqin.fc.digitalsms.createtemplate', {
'template_name':'****模板',
'template_contents':'数据结构JSON示例',
'apply_remark':'***业务需要'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})