描述
开启上传事务,获取上传文件需要访问OSS的临时凭证和其他相关信息。
请在使用该接口前确认已完全理解了
上传流程中的内容。
请求参数
请求示例https://cloudphoto.cn-shanghai.aliyuncs.com/?Action=CreateTransaction
&Ext=jpg
&Force=true
&Md5=6b680a5ec98537d18c87e9bb40fc0683
&Size=102933
&StoreName=cloudphoto-demo
&LibraryId=alice-001
&<公共请求参数>
返回参数
Transaction
Upload
返回示例
JSON格式
{
"Transaction":{
"Upload":{
"SessionId":"hLB2ktiDiXojjjINEsQNCwACowAAAAFdRAPCZQAAAApwZAYD",
"AccessKeySecret":"AVPraikAoJxNKPZQBAm5Rh6RbbtkvaM2typxPCAJtSCT",
"StsToken":"CAISjQN1q6Ft5B2yfSjIq7b4JujkuLBw5fC9VEH8pmYPSeJ/3vHbizz2IH9PdXRuCe4esv00mmlW7PYelqZ4T5hYSVTEatd3q5ha9AT5mwBDcnD2v9I+k5SANTW5rneZtZagzIybIfrZfvCyEQ6m8gZ43br9cxi7QlWhKufnoJV7b9MRLH/aCD1dH4VuOxdFos0XPmezUPG2KUzOg3HMNENyphEGZAodj56y2cqB8BHToUTnw+sO3eTLL4OjctNnMeV+Mdi81/ckcbHagmwCskIUrvYm1PcepGme4o7BXgta5xKbP/LU9cFoaQN0Y699ALJDtvXn0vZ8vfHfj4Tw1xEIMexQVGPTTZyph/n5MuqSZ4hlSe3cCmjU29mLZ7z8gRwNSFsyLBx4V/sMCAcpU0J2G2GCcfX6pgmWPVv+ccXfjvFqi6gS5k7z4N+HK2KIR7ikyisCMvc+FRh3bE9Lgzy/KvNfKFIVLQk3W6zmRIFyfQ1YoqfvoAHKVip8yX1asfTjY+/MvaQSeVJF4DqPaTB3GoABlIGUlPCAACMtFZQPHnj5aWKuY1Hfit7365daG/Zp2UUNEYMWwNWMw23WwAmBh3iQ7PnRoLmSKPwGXx+tRoid+xlxIDPm3bqlWtpkSaNSsHswqMeF6d0sNjG+NyIQ3f89q/1o1jcm+i8OKddzZ8xDsnu0gtWu7ahbJIsEpFIdv4s=",
"AccessKeyId":"STS.JuMmRPUoQR2VVgMBfZEmS14pi",
"Bucket":"cloudphoto-demo",
"ObjectKey":"stores/cloudphoto-demo/data/ZUBaS964T3OYtqaal9MaZwAAAApwZDIE",
"OssEndpoint":"http://oss-cn-shanghai.aliyuncs.com",
"FileId":"ZUBaS964T3OYtqaal9MaZwAAAApwZDIE"
}
},
"Action":"CreateTransaction",
"Message":"success",
"RequestId":"AE1425D0-1A04-4C28-A121-DE4BE33BC8F7",
"Code":"Success"
}
XML格式
<?xml version="1.0" encoding="UTF-8"?>
<CreateTransactionResponse>
<Transaction>
<Upload>
<SessionId>pCoPsrk3CzFr4D-wHpHLzgACowAAAAFdRAPKWQAAAApwZAYD</SessionId>
<AccessKeySecret>B2xArrNPUDogbQpvY69zZ9qzNNxWf8TV7nzKs3mVQfVd</AccessKeySecret>
<StsToken>CAISjQN1q6Ft5B2yfSjIrYDWCszjrq5UwLqzU0XEsEwvav8ehbfNszz2IH9PdXRuCe4esv00mmlW7PYelqZ4T5hYSVTEatd3q5ha9AT5ixBDcnD2v9I+k5SANTW5rneZtZagzIybIfrZfvCyEQ6m8gZ43br9cxi7QlWhKufnoJV7b9MRLH/aCD1dH4VuOxdFos0XPmezUPG2KUzOg3HMNENyphEGZAodj56y2cqB8BHToUTnw+sO3eTLL4OjctNnMeV+Mdi81/ckcbHagmwCskIUrvYm1PcepGme4o7BXgta5xKbP/LU9cFoaQN0Y699ALJDtvXn0vZ8vfHfj4Tw1xEIMexQVGPTTZyph/TqHKaFFc9hSejcFy3Dyu6VCqHSvyoNSFsyLBx4V/sMCAcpU0J2G2GCcfX6pgmWPVv+ccXfjvFqi6gS5k7z4N+HK2KIR7ikyisCMvc+FRh3bE9Lgzy/KvNfKFIVLQk3W6zmRIFyfQ1YoqfvoAHKVip8yX1asfTjY+/MvaQSeVJF4DqPaTB3GoABGOtX6ePhCBjjXTNs556iGRm9olEfcXmkLLl9PoQR0gP8Dyw4MP0Nbp3w47X/ImB4u1X5HgS4YPdFjl+98MssWR+KOFcq+EreAOlqlm+KpahtXQJRRJK5pP+af4OwCQdHwI1DkNKm6IbKuQcfTrmU6zvvfiWIzKWcxOUgcv+6Sog=</StsToken>
<AccessKeyId>STS.LCcAvWCquwxXQcuTLzfp2jrfQ</AccessKeyId>
<Bucket>cloudphoto-demo</Bucket>
<ObjectKey>stores/cloudphoto-demo/data/WFl-DKq0T6OD1fpVrTPOdAAAAApwZDIE</ObjectKey>
<OssEndpoint>http://oss-cn-shanghai.aliyuncs.com</OssEndpoint>
<FileId>WFl-DKq0T6OD1fpVrTPOdAAAAApwZDIE</FileId>
</Upload>
</Transaction>
<Action>CreateTransaction</Action>
<Message>success</Message>
<RequestId>5C32C7CA-9CCB-4831-9022-26A611E1E32E</RequestId>
<Code>Success</Code>
</CreateTransactionResponse>