TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
OpencrmShortmessageSendRequest req = new OpencrmShortmessageSendRequest();
OpencrmShortmessageSendRequest.ShortMessageDeliverTaskContent obj1 = new OpencrmShortmessageSendRequest.ShortMessageDeliverTaskContent();
obj1.setOutActivityId(1001L);
obj1.setTplCode("SMS_3385002");
obj1.setTplPlh("content");
obj1.setSellerTpl("亲爱的${nick},兜家年货清仓五折起咯!爆款超低折扣,领券再减折上折,更有满返优惠券等你拿!就一个字:值!赶紧加购吧!");
obj1.setDeliverTargets(""18600238902","18600238920"");
obj1.setOutNodeInstId(4001L);
obj1.setOutActivityInstId(2001L);
obj1.setCrowdMode(true);
obj1.setOutNodeId(3001L);
obj1.setCrowdInstId(6001L);
obj1.setSignature("jinse01官方旗舰店");
obj1.setPlhVal("{\"nick\":\"jinse01\",\"point\":\"10\",\"levelName\":\"普通会员\",\"shortLink\":\"c.tb.cn/c.Kgsf\"}");
req.setTaskContent(obj1);
OpencrmShortmessageSendResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
OpencrmShortmessageSendRequest req = new OpencrmShortmessageSendRequest();
OpencrmShortmessageSendRequest.ShortMessageDeliverTaskContentDomain obj1 = new OpencrmShortmessageSendRequest.ShortMessageDeliverTaskContentDomain();
obj1.OutActivityId = 1001L;
obj1.TplCode = "SMS_3385002";
obj1.TplPlh = "content";
obj1.SellerTpl = "亲爱的${nick},兜家年货清仓五折起咯!爆款超低折扣,领券再减折上折,更有满返优惠券等你拿!就一个字:值!赶紧加购吧!";
obj1.DeliverTargets = ""18600238902","18600238920"";
obj1.OutNodeInstId = 4001L;
obj1.OutActivityInstId = 2001L;
obj1.CrowdMode = true;
obj1.OutNodeId = 3001L;
obj1.CrowdInstId = 6001L;
obj1.Signature = "jinse01官方旗舰店";
obj1.PlhVal = "{\"nick\":\"jinse01\",\"point\":\"10\",\"levelName\":\"普通会员\",\"shortLink\":\"c.tb.cn/c.Kgsf\"}";
req.TaskContent_ = obj1;
OpencrmShortmessageSendResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new OpencrmShortmessageSendRequest;
$task_content = new ShortMessageDeliverTaskContent;
$task_content->out_activity_id="1001";
$task_content->tpl_code="SMS_3385002";
$task_content->tpl_plh="content";
$task_content->seller_tpl="亲爱的${nick},兜家年货清仓五折起咯!爆款超低折扣,领券再减折上折,更有满返优惠券等你拿!就一个字:值!赶紧加购吧!";
$task_content->deliver_targets="[\"18600238902\",\"18600238920\"]";
$task_content->out_node_inst_id="4001";
$task_content->out_activity_inst_id="2001";
$task_content->crowd_mode="true";
$task_content->out_node_id="3001";
$task_content->crowd_inst_id="6001";
$task_content->signature="jinse01官方旗舰店";
$task_content->plh_val="{\"nick\":\"jinse01\",\"point\":\"10\",\"levelName\":\"普通会员\",\"shortLink\":\"c.tb.cn/c.Kgsf\"}";
$req->setTaskContent(json_encode($task_content));
$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=taobao.opencrm.shortmessage.send' \
-d 'partner_id=apidoc' \
-d 'session=b60bc935-87fd-44a2-b0d7-af1d5c8f0cf9' \
-d 'sign=E7F76E300DDC3B718C4F152A55B8D9ED' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-18+16%3A26%3A03' \
-d 'v=2.0' \
-d 'task_content=%7B%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.OpencrmShortmessageSendRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.task_content="{}"
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,"taobao.opencrm.shortmessage.send");
add_param(pRequest,"task_content","数据结构JSON示例");
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('taobao.opencrm.shortmessage.send', {
'task_content':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})