如何获取联邦快递和联邦快递如果我知道往返邮政编码,可以使用 UPS 区域号码吗?

发布于 2024-08-14 02:29:50 字数 1539 浏览 7 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南风起 2024-08-21 02:29:50

就像你一样,我也一直在努力寻找这个问题的答案,但并没有看到我们 API 用户可以轻松获得这些信息。据我所知,无法从 API 本身获取此信息。不过,有一些解决方法:

UPS:
输入您的起始邮政编码后,通过以下链接从 UPS 下载美国费率/区域图表:
http://www.ups.com/content/us /en/shipping/cost/zones/Continental_us.html

另一方面,国际则是一个不同的故事,我不知道有什么方法可以解决这个问题。

联邦快递
您可以向以下 URL 发出 GET 请求,将 origPostalCd、destCountryCd 和 destPostalCd 参数替换为所需数据,然后解析 HTML。这是快速区域之前的位置表单元格:

<td><img src="http://www.fedex.com/images/ascend/shared/spacer.gif" width="15" height="1"><img src="http://www.fedex.com/images/ascend/shared/shared_sq_express.gif" width="9" height="9" border="0" alt=""> <b>Express Zone:  </b></td>

国际区域时好时坏,因为似乎某些位置(例如温哥华)不返回区域。

Just like you, I have been trying to find the answer for this as well, but it does not see that that information is easily available for us API users. From what I can tell, there is no way to get this information from the APIs themselves. There are workarounds for this though:

UPS:
Download the US rate/zone chart from UPS at the following link, after entering your origin zip:
http://www.ups.com/content/us/en/shipping/cost/zones/continental_us.html

International on the other hand is a different story, and I don't know of a way to figure this out.

FedEx
You can make a GET request to the following URL, after replacing the origPostalCd, destCountryCd, and destPostalCd parameters with the needed data, then parsing the HTML out. Here is the location table cell before the express zone:

<td><img src="http://www.fedex.com/images/ascend/shared/spacer.gif" width="15" height="1"><img src="http://www.fedex.com/images/ascend/shared/shared_sq_express.gif" width="9" height="9" border="0" alt=""> <b>Express Zone:  </b></td>

International zones are hit and miss, as it seems some locations (such as Vancouver) don't return a zone.

孤城病女 2024-08-21 02:29:50

FedEx 和 UPS 都有用于跟踪包裹和打印运输标签等的网络服务。FedEx

提供了一个随时可用的访问其(跟踪)网络服务的示例,该服务可能已经包含您需要的信息。

UPS、OTOH 不给您示例代码,因此您必须阅读他们的规范并自己解析 xml。

(至少大约 6 个月前,当我使用这两个 API 时,这是真的)

Both FedEx and UPS have web-services for tracking packages and printing shipping labels etc.

FedEx provides a ready to use sample of accessing their (Tracking) web-service which probably already has the information you need.

UPS, OTOH, doesn't give you sample code, so you must read their spec and parse the xml yourself.

(At least this was true ~6 months ago, when I worked with both API's)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文