全部产品
存储与CDN 数据库 安全 应用服务 数加·人工智能 数加·大数据基础服务 互联网中间件 视频服务 阿里云办公 培训与认证 物联网

GetDownloadUrls

更新时间:2017-09-20 17:53:43

描述

批量获取照片的原图下载地址,支持一次下载100张图片。下载地址的有效期为1小时。

注:SDK1.1.3版本后支持该接口。

请求参数

参数名 类型 是否必须 说明
Action String GetDownloadUrls
PhotoId.1 Long 需要获取原图地址的照片的ID。如果有多张照片,请按照规则增加一个参数,比如2张照片,另外一个参数为PhotoId.2
StoreName String PhotoStore的名称
LibraryId String 照片库标识。采用AK认证时必选,采用STS认证时可选。了解不同认证方式的区别。

请求示例

  1. https://cloudphoto.cn-shanghai.aliyuncs.com/?Action=GetDownloadUrls
  2. &PhotoId.1=822879673959591936&PhotoId.2=822879673959591937
  3. &StoreName=cloudphoto-demo
  4. &LibraryId=alice-001
  5. &<公共请求参数>

返回参数

参数名 类型 说明
RequestId String 唯一标识本次请求的ID
Code String 响应状态码,Success表示成功的响应
Message String 响应状态详细描述
Action String GetDownloadUrls
Results 数组 详见结果信息

Results

参数名 类型 说明
Code String 状态码,Success表示成功
Id String 对应对象的唯一标识
Message String 详细信息
DownloadUrl String 图片原图的下载地址

返回示例

JSON格式

  1. {
  2. "Action":"GetDownloadUrls",
  3. "Code":"Success",
  4. "Message":"success",
  5. "RequestId":"52616503-B64F-4328-A99A-5C44FB37C06B",
  6. "Results": [
  7. {
  8. "PhotoId": "822879673959591936",
  9. "Code": "Success",
  10. "Message": "success",
  11. "DownloadUrl": "http://cloudphoto-demo.oss-cn-shanghai.aliyuncs.com/stores/cloudphoto-demo/data/ZUBaS964T3OYtqaal9MaZwAAAApwZDIE?Expires=1500090823&OSSAccessKeyId=STS.JSyQ7KKBQpztxczY8z7TdvDE8&Signature=so6XmgZrgz%2FrzOAJJHjH%2BjYVRdA%3D&security-token=CAISkAJ1q6Ft5B2yfSjIq5DMGo3%2Fpp1wx7ifekXLvTgvO9tImYHu2jz2IH9PdXRuCe4esv00mmlW7PYelr94T5hYSVTEatd3q5pW9Q66bpDfuse4tTaOBz0ZWjr9MQXy%2BeOPScebJYqvV5XAQlTAkTAJstmeXD6%2BXlujHISUgJp8FLo%2BVRW5ajw0b7U%2FZHEVyqkgOGDWKOymPzPzn2PUFzAIgAdnjn5l4qnNqa%2F1qDim1QekkL5F%2F9%2Brf8b9M5YwYa0SCYnlgLZEEYPayzNV5hRw86N7sbdJ4z%2BvvKvGXAIAvkvWbbKIq4YxdVEjNvQgaKdArenhk%2FZ8vfHfj4Tw1xFBMO9cTiDDXoekzdsTol0B%2F26DHxqAAbHkJHUVm9NGdF9oJ5cMp11ARy4avPX5wModwFQYX2kLrJpDIv%2BsvrSkGYd%2BGADtAOLnTsv%2Fs3Z7dtb88GcXbi7%2Fxfizd5kIIjZxbyGveAi%2BC994qQ2CrspPFM9s0wpT9%2BCN9jAmdKWRB3Y7WEaMp7I1VHEWbM3xVk9zhsePTcF%2F"
  12. },
  13. {
  14. "PhotoId": "822879673959591937",
  15. "Code": "ResourceNotFound.PhotoId",
  16. "Message": "resource not found",
  17. "DownloadUrl": ""
  18. }
  19. ]
  20. }

XML格式

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <GetDownloadUrlResponse>
  3. <Action>GetDownloadUrls</Action>
  4. <Message>success</Message>
  5. <RequestId>454544E2-3524-484D-A66F-AEA5C47A8BFF</RequestId>
  6. <Results>
  7. <Result>
  8. <PhotoId>822879673959591936</PhotoId>
  9. <Code>Success</Code>
  10. <Message>success</Message>
  11. <DownloadUrl><![CDATA[http://cloudphoto-demo.oss-cn-shanghai.aliyuncs.com/stores/cloudphoto-demo/data/ZUBaS964T3OYtqaal9MaZwAAAApwZDIE?Expires=1500090825&OSSAccessKeyId=STS.Df3DMrYveWAS9KiZUQYwmiRtY&Signature=R1ly%2FIHlE3EUlcErNZ0O6i%2BhhDk%3D&security-token=CAISkAJ1q6Ft5B2yfSjIpaWGD%2FfGtKlE4IO4O23YvlUEVfhBhpffuzz2IH9PdXRuCe4esv00mmlW7PYelr94T5hYSVTEatd3q5pW9Q66bpDfuse4tROeBz0ZWjr9MQXy%2BeOPScebJYqvV5XAQlTAkTAJstmeXD6%2BXlujHISUgJp8FLo%2BVRW5ajw0b7U%2FZHEVyqkgOGDWKOymPzPzn2PUFzAIgAdnjn5l4qnNqa%2F1qDim1QekkL5F%2F9%2Brf8b9M5YwYa0SCYnlgLZEEYPayzNV5hRw86N7sbdJ4z%2BvvKvGXAIAvkvWbbKIq4YxdVEjNvQgaKdArenhk%2FZ8vfHfj4Tw1xFBMO9cTiDDXoekzdsTol0B%2F26DHxqAAYQA%2FtawbSuvfuM8aH4eU0xs6OEI5TdTWUzTLzo4HzfPvShnVoA886XH7BKs3LN%2B2DTyCIn%2B2DoF5zVLZX1lxuxVFJhBsin1oMAcJ13KLTqPLl%2F9PDSyFKzTxfOdy8dQ1Q5tikBf9DyNArtaSxqgw4tydIN6JBdi%2Fn6ojdRnyDv%2F]]>
  12. </DownloadUrl>
  13. </Result>
  14. <Result>
  15. <PhotoId>822879673959591937</PhotoId>
  16. <Code>ResourceNotFound.PhotoId</Code>
  17. <Message>resource not found</Message>
  18. <DownloadUrl></DownloadUrl>
  19. </Result>
  20. </Results>
  21. <Code>Success</Code>
  22. </GetDownloadUrlResponse>
本文导读目录