USPS API - 创建标签后检索跟踪号 C# [英] USPS API - After creating labels retrieving Tracking Number C#

查看:44
本文介绍了USPS API - 创建标签后检索跟踪号 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够成功地使用 USPS API 创建发货标签.返回的 XML 为我提供了一个交付确认号,但它没有返回跟踪号.跟踪号码是我真正需要的.我用过 (https://www.usps.com/business/web-tools-apis/delivery-confirmation-domestic-shipping-label-api.pdf)作为我如何成功创建标签的基础,但没有地方可以它提到了如何获取跟踪号.

I have been able to successfully use the USPS API to create a shipping label. The XML returned gives me a Delivery Confirmation Number, but it does not return the tracking number. The tracking number is what I really need. I've used (https://www.usps.com/business/web-tools-apis/delivery-confirmation-domestic-shipping-label-api.pdf) as my base for how to successfully create the label, but no place does it mention how to get the tracking number.

跟踪编号位于标签中,该标签可以根据他们在 XML 输出中发送给您的 base64 代码创建.因此,为了解决我的问题,我尝试将标签保存为图像文件并使用 OCR 阅读器(MODI 和 Tesseract)读取跟踪号.那没有用.我收到的都是胡言乱语.

The tracking number is in the label that can be created from the base64 code that they send you in the XML output. So to try to get around my problem I tried to save the label as an image file and use an OCR reader (both MODI & Tesseract) to read the tracking number. That did not work. All I received was gibberish.

然后我尝试将输出另存为 PDF 并使用 iTextSharp 阅读 PDF.结果是它没有从文件中读取任何内容.

So then I tried to save the output as a PDF instead and use iTextSharp to read the PDF. The result was it did not read anything from the file.

所以现在我在砖墙上.我在 USPS 中找不到任何 API 文档可以让我使用交付确认号来检索跟踪号.我也找不到可以从 base64 编码的输出文件中读取跟踪号的 OCR.

So now I'm at a brick wall. I cannot find any API documentation from USPS that would allow me to use the Delivery Confirmation Number to retrieve the tracking number. I also cannot find an OCR that will read the tracking number from the output files from the base64 encoding.

有没有人可以解决这个问题?提前致谢.

Is there anyone out there that might have a solution to this problem? Thanks in advance.

推荐答案

原来通过 XML 返回的交货确认编号可以用作跟踪编号.只是在 API 创建的交付确认号出现在 USPS 网站上之前有一点延迟.

It turns out that the delivery confirmation number that is returned via the XML can be used as the tracking number. It's just that there was a little bit of lag time before the API created Delivery Confirmation Number appeared on the USPS website.

这篇关于USPS API - 创建标签后检索跟踪号 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆