# 综述
通过Uploads API,您可以上传您可以使用其他销售伙伴API以编程方式访问的文件,例如A+内容API和消息传递API.
# Version information
版本 : 2020-11-01
# Operations
createUploadDestinationForResource
<a name="paths">
# 路径
<a name="createuploaddestinationforresource">
# createUploadDestinationForResource
POST /uploads/2020-11-01/uploadDestinations/{resource}
# Description
创建一个上传目的地,返回将文件上传到目的地和以编程方式访问该文件所需的信息.
使用计划:
| 速率(每秒的请求) | 突发 |
|---|---|
| .1 | 5 |
更多信息,请参阅销售伙伴API文档中的 "使用计划和费率限制".
# Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Query | marketplaceIds required | A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified. Max count : 1 | < string > array |
| Query | contentMD5 required | 将提交给上传目的地的内容的MD5哈希值.此值用于确定数据在运输过程中是否被破坏或篡改. | string |
| Path | resource required | 你正在创建的上传目的地的资源. 例如,如果你正在为Messaging API的createLegalDisclosure操作创建一个上传目的地,{resource}将是/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure整个路径是/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure. 如果你要为Aplus内容文件创建一个上传目的地{资源}将是aplus/2020-11-01/contentDocuments,路径将是/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments. | string |
| Query | contentType optional | 要上传文件的内容类型. | string |
# Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 201 | Success. 头: x-amzn-RateLimit-Limit (string) : 您对该操作的速率限制(每秒的请求) . x-amzn-RequestId (string) Unique request reference identifier. | CreateUploadDestinationResponse |
错误状态代码、描述和模式,见错误响应和模式.
<a name="error-responses-and-schemas">
# 错误响应和模式
本表包含HTTP状态代码和错误响应的相关信息.
| HTTP Code | Description | Schema |
|---|---|---|
| 400 | Request有缺失或无效的参数,无法解析. Headers x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作. x-amzn-RequestId (string) Unique request reference identifier. | CreateUploadDestinationResponse |
| 403 | 表示禁止访问该资源.可能的原因包括拒绝访问、未经授权、过期令牌或无效签名. **头信息 x-amzn-RequestId (string):Unique request reference identifier. | CreateUploadDestinationResponse |
| 404 | 指定的资源不存在. 头 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作. x-amzn-RequestId (string) Unique request reference identifier. | CreateUploadDestinationResponse |
| 413 | 请求的大小超过了最大接受的大小. 头 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作._注意:_对于这个状态代码,速率限制头已被废弃,不再返回. x-amzn-RequestId (string): Unique request reference identifier. | CreateUploadDestinationResponse |
| 415 | 请求的有效载荷是不支持的格式. 头 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作._注意:_对于这个状态代码,速率限制头已被废弃,不再返回. x-amzn-RequestId (string) Unique request reference identifier. | CreateUploadDestinationResponse |
| 429 | 请求的频率超过了允许的范围. 头 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作._注意:_对于这个状态代码,速率限制头已被废弃,不再返回. x-amzn-RequestId (string) Unique request reference identifier. | CreateUploadDestinationResponse |
| 500 | 发生了一个意外情况,使服务器无法完成请求. 头信息 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作._注意:_对于这个状态代码,速率限制头已被废弃,不再返回. x-amzn-RequestId (string): Unique request reference identifier. | CreateUploadDestinationResponse |
| 503 | 服务器临时超载或维护. 头 x-amzn-RateLimit-Limit (string):您的速率限制(每秒的请求)为这个操作._注意:_对于这个状态代码,速率限制头已被废弃,不再返回. x-amzn-RequestId (string): Unique request reference identifier. | CreateUploadDestinationResponse |
<a name="definitions">
# Definitions
<a name="createuploaddestinationresponse">
# CreateUploadDestinationResponse
createUploadDestination操作的响应模式.
| Name | Description | Schema |
|---|---|---|
| payload optional | Information about an upload destination. | UploadDestination |
| errors optional | 请求不成功时返回的错误响应列表. | ErrorList |
<a name="uploaddestination">
# UploadDestination
关于上传目的地的信息.
| Name | Description | Schema |
|---|---|---|
| uploadDestinationId optional | 上传目的地的唯一标识符. | string |
| url optional | 上传目的地的URL. | string |
| headers optional | 上传请求中包含的头信息. | object |
<a name="errorlist">
# ErrorList
当请求不成功时返回的错误响应列表.
类型 < Error > 数组
<a name="error">
# Error
当请求不成功时返回的错误响应.
| Name | Description | Schema |
|---|---|---|
| code required | 一个错误代码,用于识别所发生的错误类型. | string |
| message required | 一个以人类可读的形式描述错误情况的信息. | string |
| details optional | 可以帮助呼叫者理解或解决这个问题的额外细节. | string |