TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaSscSupplyplatformWorkermobileAuthenticationRequest req = new AlibabaSscSupplyplatformWorkermobileAuthenticationRequest();
req.setUserId("20230418421739");
req.setUserType("worker");
req.setProfilePictureFilename("1.jpg");
req.setFileData(new FileItem("/tmp/file.txt"));
req.setPhone("18777777777");
req.setNoType(1L);
req.setAttributes("{}");
AlibabaSscSupplyplatformWorkermobileAuthenticationResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaSscSupplyplatformWorkermobileAuthenticationRequest req = new AlibabaSscSupplyplatformWorkermobileAuthenticationRequest();
req.UserId = "20230418421739";
req.UserType = "worker";
req.ProfilePictureFilename = "1.jpg";
req.FileData = new FileItem("/tmp/file.txt");
req.Phone = "18777777777";
req.NoType = 1L;
req.Attributes = "{}";
AlibabaSscSupplyplatformWorkermobileAuthenticationResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaSscSupplyplatformWorkermobileAuthenticationRequest;
$req->setUserId("20230418421739");
$req->setUserType("worker");
$req->setProfilePictureFilename("1.jpg");
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setFileData(@fileLocation);
$req->setPhone("18777777777");
$req->setNoType("1");
$req->setAttributes("{}");
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:multipart/form-data;charset=utf-8' \
-F 'app_key=12129701' \
-F 'format=json' \
-F 'method=alibaba.ssc.supplyplatform.workermobile.authentication' \
-F 'partner_id=apidoc' \
-F 'session=7a6e81d6-8424-4449-8d33-489f4540321e' \
-F 'sign=D803297BD3DC22DF0E621E283145895C' \
-F 'sign_method=hmac' \
-F 'timestamp=2025-05-14+09%3A05%3A55' \
-F 'v=2.0' \
-F 'attributes=%7B%7D' \
-F 'no_type=1' \
-F 'phone=18777777777' \
-F 'profile_picture_filename=1.jpg' \
-F 'user_id=20230418421739' \
-F 'user_type=worker' \
-F 'file_data=@/tmp/file.txt'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaSscSupplyplatformWorkermobileAuthenticationRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.user_id="20230418421739"
req.user_type="worker"
req.profile_picture_filename="1.jpg"
req.file_data=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.phone="18777777777"
req.no_type=1
req.attributes="{}"
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.ssc.supplyplatform.workermobile.authentication");
add_param(pRequest,"user_id","20230418421739");
add_param(pRequest,"user_type","worker");
add_param(pRequest,"profile_picture_filename","1.jpg");
add_file_param(pRequest,"file_data","文件内容");
add_param(pRequest,"phone","18777777777");
add_param(pRequest,"no_type","1");
add_param(pRequest,"attributes","{}");
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.ssc.supplyplatform.workermobile.authentication', {
'user_id':'20230418421739',
'user_type':'worker',
'profile_picture_filename':'1.jpg',
'file_data':'文件内容',
'phone':'18777777777',
'no_type':'1',
'attributes':'{}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})