TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaMosCarnivalOpenRightsSendRequest req = new AlibabaMosCarnivalOpenRightsSendRequest();
AlibabaMosCarnivalOpenRightsSendRequest.CouponSendReq obj1 = new AlibabaMosCarnivalOpenRightsSendRequest.CouponSendReq();
obj1.setIdempotent("TEST_2022120100004135");
obj1.setSnapshotId(1006001532L);
obj1.setEncryptPhone("HIGAD+)_");
obj1.setCount(1L);
req.setCouponSendReq(obj1);
AlibabaMosCarnivalOpenRightsSendResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaMosCarnivalOpenRightsSendRequest req = new AlibabaMosCarnivalOpenRightsSendRequest();
AlibabaMosCarnivalOpenRightsSendRequest.CouponSendReqDomain obj1 = new AlibabaMosCarnivalOpenRightsSendRequest.CouponSendReqDomain();
obj1.Idempotent = "TEST_2022120100004135";
obj1.SnapshotId = 1006001532L;
obj1.EncryptPhone = "HIGAD+)_";
obj1.Count = 1L;
req.CouponSendReq_ = obj1;
AlibabaMosCarnivalOpenRightsSendResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaMosCarnivalOpenRightsSendRequest;
$coupon_send_req = new CouponSendReq;
$coupon_send_req->idempotent="TEST_2022120100004135";
$coupon_send_req->snapshot_id="1006001532";
$coupon_send_req->encrypt_phone="HIGAD+)_";
$coupon_send_req->count="1";
$req->setCouponSendReq(json_encode($coupon_send_req));
$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=alibaba.mos.carnival.open.rights.send' \
-d 'partner_id=apidoc' \
-d 'sign=ECD7C753E872906CC981F2FE57D03124' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-24+16%3A00%3A10' \
-d 'v=2.0' \
-d 'coupon_send_req=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaMosCarnivalOpenRightsSendRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.coupon_send_req="数据结构示例JSON格式"
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,"alibaba.mos.carnival.open.rights.send");
add_param(pRequest,"coupon_send_req","数据结构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('alibaba.mos.carnival.open.rights.send', {
'coupon_send_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})