TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallTkofContractFileUploadRequest req = new TmallTkofContractFileUploadRequest();
req.setFileName("合同.pdf");
req.setFileUrl("https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc=");
TmallTkofContractFileUploadResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallTkofContractFileUploadRequest req = new TmallTkofContractFileUploadRequest();
req.FileName = "合同.pdf";
req.FileUrl = "https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc=";
TmallTkofContractFileUploadResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallTkofContractFileUploadRequest;
$req->setFileName("合同.pdf");
$req->setFileUrl("https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc=");
$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=tmall.tkof.contract.file.upload' \
-d 'partner_id=apidoc' \
-d 'sign=AC45CD02A47A919EADDB194D65916F04' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+16%3A13%3A32' \
-d 'v=2.0' \
-d 'file_name=%E5%90%88%E5%90%8C.pdf' \
-d 'file_url=https%3A%2F%2Ftest-tof-oss.voyageone.com%2Fcompany%2Ffile%2F300363%2Fsystem_300224_20240311062951%2Fbf90a0e95a8a4c8dab025f655669fc37.pdf%3FExpires%3D1717059737%26OSSAccessKeyId%3DLTAI4GEomu3G4Q5wmg2dXgtZ%26Signature%3DyKqJG4KZH44DErJ33xPbe0J19zc%3D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallTkofContractFileUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.file_name="合同.pdf"
req.file_url="https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc="
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,"tmall.tkof.contract.file.upload");
add_param(pRequest,"file_name","合同.pdf");
add_param(pRequest,"file_url","https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc=");
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('tmall.tkof.contract.file.upload', {
'file_name':'合同.pdf',
'file_url':'https://test-tof-oss.voyageone.com/company/file/300363/system_300224_20240311062951/bf90a0e95a8a4c8dab025f655669fc37.pdf?Expires=1717059737&OSSAccessKeyId=LTAI4GEomu3G4Q5wmg2dXgtZ&Signature=yKqJG4KZH44DErJ33xPbe0J19zc='
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})