ENS 操作

“事件通知 Web 服务”提供四种主要操作。两个用于检索与事件类型相关的一般信息,其余两个则用于检索事件通知本身。


事件类型是否受支持
该操作允许您检查“事件通知 Web 服务”是否支持所提供的事件类型。

  • 操作名称: 事件类型是否受支持

  • 请求参数:

    • 事件类型(必须): 将检查包含事件类型名称的字符串。

  • 响应:

    • 受支持(必须): 以布尔值表示事件类型是否受支持。


获取受支持事件类型
该操作允许您检索所有受支持事件类型的列表及其描述。

  • 操作名称: 获取受支持事件类型

  • 请求参数:

    • 匹配字符串(必须): 包含兼容 Java/Perl 正则表达式的字符串,用于与事件类型名称相匹配。如果输入了空字符串,则将返回有关所有事件类型的数据。

  • 响应:

    • 示例:

    • 事件类型:“ssn”

    • 事件类型名称:“已售出,即将发运”

    • 事件类型描述:“客户下了一个新订单”

    • 事件类型详情: 包含事件类型、名称和描述的一系列元素。


获取事件
该操作允许您检索事件页面和分页 Cookie。分页 Cookie 允许您在之后检索更多事件。

  • 操作名称: 获取事件

  • 请求参数:

    • 默认值: 100

    • 最小值: 1

    • 最大值: 200

    • 默认值: 未指定

    • 最小值: 0(通过额外调用“获取更多”,仅显示当前事件之后发生的事件)

    • 最大值: 无限制(但可用事件总数有限制)

    • 事件类型(必须): 要检索的事件类型。

    • 起始日期(可选,但如果省略起始日期则必须指定数量限制): 我们需返回事件结果的最早日期。

    • 数量限制(可选,但如果省略数量限制则必须指定起始日期): 限制返回的事件数量。例如,您可使用该参数要求仅显示指定类型的最近 500 个事件。

    • 每页事件数(可选): 用于限制每次调用“事件通知 Web 服务”时所返回的事件数。如果存在比指定数量更多的可用事件,则需要额外调用“获取更多”命令。

  • 响应:

    • 事件通知: 一组事件,包括其类型、时间戳和 XML 主体。为避免与用于保存“事件”名称的语言和库发生命名冲突,它们被命名为“事件通知”。

    • 分页 Cookie: 可与“获取更多”命令结合使用,以检索之后的额外事件。

    • 存在更多页: 一种布尔标志,用于表示是否存在可检索的其他事件页


获取更多
该操作允许您使用之前调用“获取事件”或“获取更多”所返回的分页 Cookie 来检索额外的事件。在调用“获取更多”之前,客户必须允许分页 Cookie“退避时间”字段所指定的时间消逝,否则请求将被拒绝。这是为了允许将请求节流至合理水平,从而让所有客户都平等使用服务。分页 Cookie 还必须在“使用期限”到期之前使用,否则该 Cookie 将会过期。

  • 操作名称: 获取更多

  • 请求参数:

    • 默认值: 100

    • 最小值: 1

    • 最大值: 200

    • 分页 Cookie(必须): 这是您之前调用“获取事件”或“获取更多”时所返回的分页 Cookie。为简便起见,您可略去“使用期限”和“退避时间”。

    • 每页事件数(可选): 用于限制每次调用“获取更多”时所返回的事件数。

  • 响应:

    • 事件通知: 一组事件,包括其类型、时间戳和 XML 主体。为避免与用于保存“事件”名称的语言和库发生命名冲突,它们被命名为“事件通知”。

    • 分页 Cookie: 可与“获取更多”命令结合使用,以检索之后的额外事件。

    • 存在更多页: 一种布尔标志,用于表示是否存在可检索的其他事件页


亚马逊官网原文详情:   

Operations Available Through the Event Notification Web Service

There are four primary operations provided by the Event Notification Web Service (ENS). Two are for retrieving general information about event types, and the other two are for retrieving the event notifications themselves.


IsEventTypeSupported

This operation enables you to check whether a given event type is supported by the Event Notification Web Service.

  • Operation Name: IsEventTypeSupported

  • Request Parameters:

    • EventType (required): A string containing the name of the event type to be checked.

  • Response:

    • IsSupported (required): A Boolean value representing whether or not that event type is supported.

GetSupportedEventTypes

This operation enables you to retrieve a list of all supported event types and their descriptions.

  • Operation Name: GetSupportedEventTypes

  • Request Parameters:

    • MatchString (required): A string containing a Java/Perl-compatible regular expression to be used to match against the event type names. If an empty string is passed, data about all event types will be returned.

  • Response:

    • Example

    • EventType: "ssn"

    • EventTypeName: ""Sold, ship now""

    • EventTypeDescription: "A new order has been placed by a customer"

    • EventTypeDetails:  A set of elements containing the event type, name, and description.

GetEvents

This operation enables you to retrieve a page of events along with a PagingCookie. The PagingCookie allows you to retrieve more events at a later time.

  • Operation Name: GetEvents

  • Request Parameters:

    • Default: 100

    • Min: 1

    • Max: 200

    • Default: Not specified

    • Min: 0 (only events occurring from the current time forward will be available via additional calls to GetMore)

    • Max: No limit (although there is a limit to the total number of events available)

    • EventType (required): The event type to be retrieved.

    • StartDate (optional, but Limit must be specified if StartDate is omitted): The earliest date for which we should return events.

    • Limit (optional, but StartDate must be specified if Limit is omitted): Limits the number of events returned. For example, you can use this parameter to request only the latest 500 events of a given type.

    • EventsPerPage (optional): Used to limit the number of events returned by each call to the Event Notification Web Service. If more than the specified number of events are available, additional calls to GetMore will be required.

  • Response:

    • EventNotifications: A set of events, including their type, timestamp, and XML body. In order to avoid naming collisions with languages and libraries that have reserved the name "Event," they are named "EventNotifications."

    • PagingCookie: A PagingCookie that can be used with GetMore to retrieve additional events later.

    • MorePagesExist: A Boolean flag representing whether or not there are additional pages of events available for retrieval

GetMore

This operation enables you to retrieve additional events using a PagingCookie returned by a previous call to GetEvents or GetMore. Before calling GetMore, clients must allow the amount of time specified in the PagingCookie’s BackOffTime field to elapse, or the request will be rejected. This is to allow requests to be throttled down to a reasonable level so the service can serve all clients equally. The PagingCookie must also be used before TimeToLive has passed, otherwise the cookie will have expired.

  • Operation Name: GetMore

  • Request Parameters:

    • Default: 100

    • Min: 1

    • Max: 200

    • PagingCookie (required): This is the PagingCookie returned by your previous call to GetEvents or GetMore. For simplicity, you can leave out the TimeToLive and BackOffTime.

    • EventsPerPage (required): Used to limit the number of events returned by each call to GetMore.

  • Response:

    • EventNotifications: A set of events, including their type, timestamp, and XML body. In order to avoid naming collisions with languages and libraries that have reserved the name "Event," they are named "EventNotifications."

    • PagingCookie: A PagingCookie that can be used with GetMore to retrieve additional events later.

    • MorePagesExist: A Boolean flag representing whether or not there are additional pages of events available for retrieval


文章来源:亚马逊官方网站

(本文内容根据网络资料整理,出于传递更多信息之目的,不代表连连国际赞同其观点和立场)