TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaServicecenterWorkcardCreateRequest req = new AlibabaServicecenterWorkcardCreateRequest();
req.setSpServiceOrderId(123456L);
req.setServiceSequence(1L);
req.setServiceCount(1L);
req.setAttributes("{\"sn\":\"123\"}");
req.setOuterId("456767");
AlibabaServicecenterWorkcardCreateRequest.ServiceProviderDto obj1 = new AlibabaServicecenterWorkcardCreateRequest.ServiceProviderDto();
obj1.setTpNick("商家测试账号32");
obj1.setTpId(123456L);
obj1.setSellerStoreName("商家仓库001");
obj1.setSellerStoreCode("商家仓库001");
obj1.setSellerStoreId(123456L);
req.setServiceProvider(obj1);
AlibabaServicecenterWorkcardCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaServicecenterWorkcardCreateRequest req = new AlibabaServicecenterWorkcardCreateRequest();
req.SpServiceOrderId = 123456L;
req.ServiceSequence = 1L;
req.ServiceCount = 1L;
req.Attributes = "{\"sn\":\"123\"}";
req.OuterId = "456767";
AlibabaServicecenterWorkcardCreateRequest.ServiceProviderDtoDomain obj1 = new AlibabaServicecenterWorkcardCreateRequest.ServiceProviderDtoDomain();
obj1.TpNick = "商家测试账号32";
obj1.TpId = 123456L;
obj1.SellerStoreName = "商家仓库001";
obj1.SellerStoreCode = "商家仓库001";
obj1.SellerStoreId = 123456L;
req.ServiceProvider_ = obj1;
AlibabaServicecenterWorkcardCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaServicecenterWorkcardCreateRequest;
$req->setSpServiceOrderId("123456");
$req->setServiceSequence("1");
$req->setServiceCount("1");
$req->setAttributes("{\"sn\":\"123\"}");
$req->setOuterId("456767");
$service_provider = new ServiceProviderDto;
$service_provider->tp_nick="商家测试账号32";
$service_provider->tp_id="123456";
$service_provider->seller_store_name="商家仓库001";
$service_provider->seller_store_code="商家仓库001";
$service_provider->seller_store_id="123456";
$req->setServiceProvider(json_encode($service_provider));
$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.servicecenter.workcard.create' \
-d 'partner_id=apidoc' \
-d 'session=36dbbaf9-ceaf-462a-ac3c-d6ac68077e28' \
-d 'sign=852FB09C2453E8AEBB9A1CCC20EF7621' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+17%3A38%3A21' \
-d 'v=2.0' \
-d 'attributes=%7B%5C%22sn%5C%22%3A%5C%22123%5C%22%7D' \
-d 'outer_id=456767' \
-d 'service_count=1' \
-d 'service_provider=null' \
-d 'service_sequence=1' \
-d 'sp_service_order_id=123456'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaServicecenterWorkcardCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.sp_service_order_id=123456
req.service_sequence=1
req.service_count=1
req.attributes="{\"sn\":\"123\"}"
req.outer_id="456767"
req.service_provider=""
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.servicecenter.workcard.create");
add_param(pRequest,"sp_service_order_id","123456");
add_param(pRequest,"service_sequence","1");
add_param(pRequest,"service_count","1");
add_param(pRequest,"attributes","{\"sn\":\"123\"}");
add_param(pRequest,"outer_id","456767");
add_param(pRequest,"service_provider","数据结构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('alibaba.servicecenter.workcard.create', {
'sp_service_order_id':'123456',
'service_sequence':'1',
'service_count':'1',
'attributes':'{\"sn\":\"123\"}',
'outer_id':'456767',
'service_provider':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})