TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
YunosServiceCmnsCoaMessagePushRequest req = new YunosServiceCmnsCoaMessagePushRequest();
YunosServiceCmnsCoaMessagePushRequest.PushRequest obj1 = new YunosServiceCmnsCoaMessagePushRequest.PushRequest();
obj1.setDeviceType(1L);
obj1.setExpiration(7200L);
obj1.setIosEnvironment(0L);
obj1.setMsg("{\"action\":\"com.yunos.cmns\",\"customContent\":\"{\\"from\\":\\"http://baidu.com\\",\\"result\\":\\"success\\"}\",\"desc\":\"this is a desc\",\"pkgContent\":\"{\\"uri\\":\\"http://taobao.com\\",\\"package\\":\\"com.yunos.cmns\\"}\",\"title\":\"this is title\"}");
YunosServiceCmnsCoaMessagePushRequest.Receiver obj2 = new YunosServiceCmnsCoaMessagePushRequest.Receiver();
obj2.setData(""f6a60db25cd0af09b8e8f11861d038078007a156de5a7e6897bf6c8de2c859638009d4e1aa7d8099dfd90047603e26a2","a750a4542edb909fc4b09793557e0b3ff01b1ffc050120675a80d5be71d8a591e8c760bb5df10107fc67a9536929823f"");
obj2.setType("deviceToken");
obj1.setReceiver(obj2);
obj1.setType(1L);
obj1.setPriority(3L);
obj1.setBizAppKey("23714768");
obj1.setCollapseKey("14978300457");
req.setPushRequest(obj1);
YunosServiceCmnsCoaMessagePushResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
YunosServiceCmnsCoaMessagePushRequest req = new YunosServiceCmnsCoaMessagePushRequest();
YunosServiceCmnsCoaMessagePushRequest.PushRequestDomain obj1 = new YunosServiceCmnsCoaMessagePushRequest.PushRequestDomain();
obj1.DeviceType = 1L;
obj1.Expiration = 7200L;
obj1.IosEnvironment = 0L;
obj1.Msg = "{\"action\":\"com.yunos.cmns\",\"customContent\":\"{\\"from\\":\\"http://baidu.com\\",\\"result\\":\\"success\\"}\",\"desc\":\"this is a desc\",\"pkgContent\":\"{\\"uri\\":\\"http://taobao.com\\",\\"package\\":\\"com.yunos.cmns\\"}\",\"title\":\"this is title\"}";
YunosServiceCmnsCoaMessagePushRequest.ReceiverDomain obj2 = new YunosServiceCmnsCoaMessagePushRequest.ReceiverDomain();
obj2.Data = ""f6a60db25cd0af09b8e8f11861d038078007a156de5a7e6897bf6c8de2c859638009d4e1aa7d8099dfd90047603e26a2","a750a4542edb909fc4b09793557e0b3ff01b1ffc050120675a80d5be71d8a591e8c760bb5df10107fc67a9536929823f"";
obj2.Type = "deviceToken";
obj1.Receiver= obj2;
obj1.Type = 1L;
obj1.Priority = 3L;
obj1.BizAppKey = "23714768";
obj1.CollapseKey = "14978300457";
req.PushRequest_ = obj1;
YunosServiceCmnsCoaMessagePushResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new YunosServiceCmnsCoaMessagePushRequest;
$push_request = new PushRequest;
$push_request->device_type="1";
$push_request->expiration="7200";
$push_request->ios_environment="0";
$push_request->msg="{\"action\":\"com.yunos.cmns\",\"customContent\":\"{\\"from\\":\\"http://baidu.com\\",\\"result\\":\\"success\\"}\",\"desc\":\"this is a desc\",\"pkgContent\":\"{\\"uri\\":\\"http://taobao.com\\",\\"package\\":\\"com.yunos.cmns\\"}\",\"title\":\"this is title\"}";
$receiver = new Receiver;
$receiver->data="[\"f6a60db25cd0af09b8e8f11861d038078007a156de5a7e6897bf6c8de2c859638009d4e1aa7d8099dfd90047603e26a2\",\"a750a4542edb909fc4b09793557e0b3ff01b1ffc050120675a80d5be71d8a591e8c760bb5df10107fc67a9536929823f\"]";
$receiver->type="deviceToken";
$push_request->receiver = $receiver;
$push_request->type="1";
$push_request->priority="3";
$push_request->biz_app_key="23714768";
$push_request->collapse_key="14978300457";
$req->setPushRequest(json_encode($push_request));
$resp = $c->execute($req);
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=yunos.service.cmns.coa.message.push' \
-d 'partner_id=apidoc' \
-d 'sign=0919E386C885B6F3BADEAB3598BEA2A7' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-06-19+18%3A08%3A03' \
-d 'v=2.0' \
-d 'push_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.YunosServiceCmnsCoaMessagePushRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.push_request=""
try:
resp= req.getResponse()
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,"yunos.service.cmns.coa.message.push");
add_param(pRequest,"push_request","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
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('yunos.service.cmns.coa.message.push', {
'push_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})