TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
YunosOspushOpenNotifyPushRequest req = new YunosOspushOpenNotifyPushRequest();
req.setTaskName("testTask");
req.setUserGroup("male,female");
req.setDeviceTokens("123415,23423");
req.setTokenType(2L);
req.setMsgId("DWEADCCTADDX");
req.setMsgTitle("标题");
req.setMsgContent("内容");
req.setMsgParameter("{\"uri\":\"XXXX\"}");
req.setChannel("NORMAL");
req.setExpireTime(3600L);
req.setAttachment("attachment");
req.setSessionId("DU5738CSDF");
YunosOspushOpenNotifyPushResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
YunosOspushOpenNotifyPushRequest req = new YunosOspushOpenNotifyPushRequest();
req.TaskName = "testTask";
req.UserGroup = "male,female";
req.DeviceTokens = "123415,23423";
req.TokenType = 2L;
req.MsgId = "DWEADCCTADDX";
req.MsgTitle = "标题";
req.MsgContent = "内容";
req.MsgParameter = "{\"uri\":\"XXXX\"}";
req.Channel = "NORMAL";
req.ExpireTime = 3600L;
req.Attachment = "attachment";
req.SessionId = "DU5738CSDF";
YunosOspushOpenNotifyPushResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new YunosOspushOpenNotifyPushRequest;
$req->setTaskName("testTask");
$req->setUserGroup("male,female");
$req->setDeviceTokens("123415,23423");
$req->setTokenType("2");
$req->setMsgId("DWEADCCTADDX");
$req->setMsgTitle("标题");
$req->setMsgContent("内容");
$req->setMsgParameter("{\"uri\":\"XXXX\"}");
$req->setChannel("NORMAL");
$req->setExpireTime("3600");
$req->setAttachment("attachment");
$req->setSessionId("DU5738CSDF");
$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.ospush.open.notify.push' \
-d 'partner_id=apidoc' \
-d 'sign=96321780ADF5874F71EC4EB2BEE1972A' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+18%3A01%3A19' \
-d 'v=2.0' \
-d 'attachment=attachment' \
-d 'channel=NORMAL' \
-d 'device_tokens=123415%2C23423' \
-d 'expire_time=3600' \
-d 'msg_content=%E5%86%85%E5%AE%B9' \
-d 'msg_id=DWEADCCTADDX' \
-d 'msg_parameter=%7B%5C%22uri%5C%22%3A%5C%22XXXX%5C%22%7D' \
-d 'msg_title=%E6%A0%87%E9%A2%98' \
-d 'session_id=DU5738CSDF' \
-d 'task_name=testTask' \
-d 'token_type=2' \
-d 'user_group=male%2Cfemale'
# -*- coding: utf-8 -*-
import top.api
req=top.api.YunosOspushOpenNotifyPushRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.task_name="testTask"
req.user_group="male,female"
req.device_tokens="123415,23423"
req.token_type=2
req.msg_id="DWEADCCTADDX"
req.msg_title="标题"
req.msg_content="内容"
req.msg_parameter="{\"uri\":\"XXXX\"}"
req.channel="NORMAL"
req.expire_time=3600
req.attachment="attachment"
req.session_id="DU5738CSDF"
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.ospush.open.notify.push");
add_param(pRequest,"task_name","testTask");
add_param(pRequest,"user_group","male,female");
add_param(pRequest,"device_tokens","123415,23423");
add_param(pRequest,"token_type","2");
add_param(pRequest,"msg_id","DWEADCCTADDX");
add_param(pRequest,"msg_title","标题");
add_param(pRequest,"msg_content","内容");
add_param(pRequest,"msg_parameter","{\"uri\":\"XXXX\"}");
add_param(pRequest,"channel","NORMAL");
add_param(pRequest,"expire_time","3600");
add_param(pRequest,"attachment","attachment");
add_param(pRequest,"session_id","DU5738CSDF");
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.ospush.open.notify.push', {
'task_name':'testTask',
'user_group':'male,female',
'device_tokens':'123415,23423',
'token_type':'2',
'msg_id':'DWEADCCTADDX',
'msg_title':'标题',
'msg_content':'内容',
'msg_parameter':'{\"uri\":\"XXXX\"}',
'channel':'NORMAL',
'expire_time':'3600',
'attachment':'attachment',
'session_id':'DU5738CSDF'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})