邮政定位器V2
USPS Web Tools™
应用程序编程接口
User Guide
Version 6.8 (10/30/2023)
目录表
This
document provides the definition of the USPS Web Tools Post Office (PO) Locator
Version 2 API. This service is considered a hybrid since both the WebTools
system and the PO Locator system, including an external location service
provider, are involved in processing the requests. 地点、十大网堵平台和
hour information maintained by the PO Locator system is a subset of information
maintained in the USPS Facilities Database (FDB) sources. 信息如下
updated on a regular basis, so that the information returned to the caller
reflects that which is maintained by the data providers.
Web Tools Post
办公室定位器API requires additional API permissions. 集成商应该
contact 美国邮政互联网客户十大网堵平台中心 and follow the below instructions to submit a request for
Web Tools POLocatorV2Ext API访问.
1.
Select
“USPS.然后是“Web Tools (api)”-参考 Email
usps: Web工具查询.com).
2.
In
the “Account Information”, specify your Web Tools USERID.
3.
In
the “Issue Information”, specify “API Authorization and Testing” and
"授权错误消息".
4.
In
the “Additional Information” section include the following:
Ø
API
Access being requested: Specify “POLocatorV2Ext API” or “邮局定位器
API”
Ø
Indicate
预计API容量
Ø
Indicate
use-case (i.e.,如何使用API)
Ø
Provide
如果您有邮件ID (MID)
额外的USPS网站
工具信息,请参考 循序渐进的指导
found on the 技术文档 的Web工具部分 mygreenkeeper.com/webtools.
邮局定位器 外部请求需要地址 componets to be supplied for the Facility information to be returned
Scheme |
Host |
Path |
API |
XML |
http:// |
secure.shippingapis.com |
/ShippingAPI.dll? |
API = POLocatorV2Ext |
&XML=(see below) |
Tag Name |
Occurs |
Description |
Type |
Validation |
POLocatorV2ExtRequest |
Required |
API=POLocator
|
(Group) |
|
POLocatorV2ExtRequest
/ USERID |
Required |
This attribute
指定您的Web Tools用户ID. See the 开发人员指南 获取有关获取USERID的信息. 例如:USERID="XXXXXXX" |
NMTOKEN |
|
POLocatorV2ExtRequest
/ PASSWORD |
Optional |
This attribute
指定您的Web Tools密码. See the 开发人员指南 查阅有关密码的资料. For Example: 密码= " XXXXXXX " |
NMTOKEN |
|
POLocatorV2ExtRequest
/ Revision |
Optional |
|
Integer |
Enumerations= ·
0 ·
1 |
POLocatorV2ExtRequest
/ (choice) |
Required |
这个选择表示
呼叫序列.
®
地址2(必填) ®
City (Required) ®
状态(需要) ®
Zip 5(必选)
|
(Choice) |
|
POLocatorV2ExtRequest
/ FirmName |
Optional |
Company name. |
String |
whiteSpace=collapse minLength=1 |
POLocatorV2ExtRequest
/ Address1 |
Optional |
二次地址
unit designator and number (such as an apartment or suite number (APT 202,
STE 100)). |
String |
whiteSpace=collapse minLength=1 |
POLocatorV2ExtRequest
/ Address2 |
Optional |
街道号码及
name. Includes predirectional, suffix, and postdirectional 地址或农村路线和盒子
number (RR 5 BOX 10), highway contract route and box number (HC 4 BOX 45), or
邮政信箱号码(邮政信箱458号). Required if
requesting “地址组件” |
String |
whiteSpace=collapse minLength=1 |
POLocatorV2ExtRequest
/ City |
Required |
The city is any
acceptable mailing name for the 5-digit ZIP code. Required if
requesting “地址组件” |
String |
whiteSpace=collapse minLength=1 |
POLocatorV2ExtRequest / State |
Required |
只使用官方
USPS州名缩写. Required if
requesting “地址组件” |
String |
whiteSpace=collapse |
POLocatorV2ExtRequest
/ ZIP5 |
Required |
ZIP5 is Required
除非指定城市/州. Required if
requesting “地址组件” |
String |
pattern=\d{5} |
POLocatorV2ExtRequest
/ ZIP4 |
Optional |
a的后四位数
完整的ZIP+4代码. |
String |
minLength=0 |
POLocatorV2ExtRequest
/ Urbanization |
Optional |
城市化进程的代码
|
String |
minLength=1 |
POLocatorV2ExtRequest
/ Radius |
Optional |
用积分表示
miles. 如有要求,须
is exclusive to Latitude / Longitude or if requesting “地址组件” |
正整数 |
|
POLocatorV2ExtRequest
/ MaxLocations |
Optional |
指定最大
响应中所需的位置数. 如有要求,须
is exclusive to Latitude / Longitude or if requesting “地址组件” |
正整数 |
default=10 maxInclusive=200 |
POLocatorV2ExtRequest
/ Filters |
Required |
标识的组
the facility type(s), service(s), and hours criteria. 有效的过滤器有:
一个过滤器还是全部过滤器
可能需要过滤器 |
(Group) |
|
POLocatorV2ExtRequest
/ Filters /FacilityType |
可选的,重复的
up to 7 times |
Specifies the
value(s) for the facility filter to be applied. |
String |
whiteSpace=collapse ·
PO |
POLocatorV2ExtRequest
/过滤器/十大网堵平台 |
Optional |
指定值
用于应用十大网堵平台过滤器. 只提供支援十大网堵平台的设施
在此标记中指示的将返回响应. 未注明时,全部
十大网堵平台返回; i.e 没有应用十大网堵平台过滤器
设备返回. *Note: 2020年10月22日生效 |
String |
默认=没有十大网堵平台
filter applied Enumerations= ·
GIFTCARDS ·
LBRORETAIL ·
LBROSSK |
POLocatorV2ExtRequest
/过滤器/小时 |
Optional |
指定要应用的小时筛选器类型. |
String |
whiteSpace=collapse Enumerations= ·
ALL ·
24HR ·
SATURDAY ·
SUNDAY ·
AFTER5PM |
POLocatorV2ExtRequest
/ Filters |
Required |
|
(Group) |
|
POLocatorV2ExtRequest |
Required |
|
(Alias) |
|
<MaxLocations>2MaxLocations> <FacilityType>POFacilityType> |
Tag Name |
Occurs |
Description |
Type |
Validation |
POLocatorV2ExtResponse |
Required |
来自PO Locator web十大网堵平台的响应文档 |
(Group) |
|
POLocatorV2ExtResponse / Locations |
Required |
The zero or more locations that match the request criteria. |
(Group) |
|
POLocatorV2ExtResponse / Locations / Location |
可选重复多达200次 |
按距离升序排列. |
(Group) |
|
POLocatorV2ExtResponse / 地点/地点/ LocationName |
Required |
公司、职位、公司名称等. |
String |
|
POLocatorV2Response / 地点/地点/ LocationSubType |
Optional |
设施子类型 |
String |
minOccurs=0 |
POLocatorV2ExtResponse / 地点/地点/ Address1 |
Optional |
二级地址线. |
String |
|
POLocatorV2ExtResponse / 地点/地点/ Address2 |
Required |
主地址线. |
String |
|
POLocatorV2ExtResponse / 地点/地点/ City |
Required |
Name of city. |
String |
|
POLocatorV2ExtResponse / 地点/地点/ State |
Required |
USPS官方缩写. |
String |
|
POLocatorV2ExtResponse / 地点/地点/ ZIP5 |
Required |
Five-digit ZIP. |
String |
|
POLocatorV2Response / 地点/地点/ Services / Services |
Required |
每个可用十大网堵平台对应一个Service标记. |
(Group) |
|
POLocatorV2Response / 地点/地点/ Services / Service / name |
Required |
Keyword specifying the available services for a facility. Note: Services supported by a facility will return effective
2020年10月22日. |
String |
Enumerations= ·
GIFTCARDS ·
LBRORETAIL ·
LBROSSK |
POLocatorV2ExtResponse / 地点/地点/ Hours |
Optional |
包含操作小时集. |
(Group) |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set |
需要重复一次,最多可重复无限次 |
A set of hours representing the availability of services. |
(Group) |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / name |
Required |
Keyword indicating what the set of hours represent. |
String |
whiteSpace=collapse Enumerations= · BUSINESS ·
WINDOWSSERVICE |
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / MO |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / TU |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / WE |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / TH |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / FR |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / SA |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / SU |
Required |
Two open-close pairs are available per day of week. This is
具体十大网堵平台时间信息 |
See Appendix A |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set /
(sequence) |
Optional |
If this set of hours has a limited duration, it is indicated by the
开始和结束日期. |
(group) |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set /
(序列)/开始 |
Required |
这几个小时的生效日期. |
Date |
|
POLocatorV2ExtResponse / 地点/地点/ Hours / Set / (sequence)
/ Ending |
Required |
最后一天的日期以小时计 are in effect.
|
Date |
|
POLocatorV2Response / TemporarilyClosed |
Optional |
地点暂时关闭 Note:只有在设施齐全时才返回
暂时关闭. If a facility is not temporarily closed, this tag will
not be returned. |
String |
minOccurs=1 Enumeration= ·
Y |
polocatorv2响应/过滤器/ TemporarilyClosedDate |
Optional |
Effective date. 日期为“年-月-日”
将在适用时返回. |
String |
minOccurs=0 |
POLocatorV2ExtResponse / 地点/地点/ Parking |
Optional |
停车设施类型,如果有的话. |
String |
Enumerations= ·
LOT ·
STREET |
POLocatorV2ExtResponse /
地点/地点/ LBRORetail |
Deprecated |
标签经纪零售 Note:This 标签已弃用. 现在返回十大网堵平台领域 |
Deprecated |
|
POLocatorV2ExtResponse |
Required |
|
(Alias) |
|
<LocationName>BROOKLYN
CURTIS BAYLocationName>
|
|
|
---|
If an error is
encountered during the processing of the search request, an error message will
be returned. The format of the error response and examples of the most probable
错误响应如下所示.
Tag Name |
Occurs |
Description |
Type |
Validation |
Error |
Required once |
错误文档是
returned in response to any Web Tools request that cannot be completed.
|
(group) |
|
Error / Number |
Required once |
数字=错误
number generated by the Web Tools server or its dependent services. |
xs:hexBinary xs:integer |
|
错误/(选择) |
Required once |
This choice is
需要两种形式的错误文件. |
(choice) |
|
错误/(选择)/
(sequence) |
if used: |
第一种形式有Source
接着是描述. |
(group) |
|
错误/(选择)/
(序列)/源 |
Required once |
Source = the
component and interface that generated the error on the Web Tools server or a
masked String when the error was generated by the PO Locator service. |
String |
minLength=0 |
错误/(选择)/
(序列)/描述 |
Required once |
Description = the
错误描述文本. |
String |
minLength=0 |
错误/(选择)/
(sequence) |
if used: |
Second form has
描述后接来源. |
(group) |
|
错误/(选择)/
(序列)/描述 |
Required once |
描述=错误
description text. |
String |
minLength=0 |
错误/(选择)/
(序列)/源 |
Required once |
Source = the
component and interface that generated the error on the Web Tools server.
|
String |
minLength=0 |
Error / HelpFile |
Optional |
HelpFile = generally not used, but
留作将来使用. |
String |
minLength=0 |
Error / HelpContext |
Optional |
HelpContext = may contain additional information but generally
留作将来使用. |
String |
minLength=0 |
No locations
按指定的搜寻条件找到: POLocator |
指定了无效的XML(省略了状态标签): <HelpFile/> <HelpContext/> |
意想不到的错误
|
Hour Examples
十大网堵平台时间信息作为集合返回
对于节点,一周中的每一天一个. 每日节点内的内容
不同,可以包含0、1、2或4个元素.
Interpretation of this information depends on the service identified,
resulting in unique combinations used to identify specific situations.
A
十大网堵平台的典型响应如下所示. 星期一将全部使用
format examples.
This
设施由 8:30
AM to 5 PM.
If
the facility closes for lunch, two sets of Open and Close times will be
returned.
This
facility opens at 8 AM, closed for lunch at noon, re-opens at 1 PM and closes
下午3点.
Services
that only have one time associated with them, such as PO Box Delivery time and
Last Collection time, only the Close element will be returned.
This
service, likely to be PO Box Delivery time, has a completion time of 10 AM
If
the service is not offered for a particular day, the response will indicate
this with a null value day tag to indicate the service is not available on that
day.