473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

USPS Tracking API

190 100+
Hi Friends,

I need a USPS API tracking and here with i have attached two sample files to tracking the USPS postal service.

On test1.php, You can check the XML value and result value by echo.On echo the xml, am not get the full url as API=TrackV2&XML=<TrackRequest USERID='468CMAFI3505'><TrackID ID='EJ958083578US'></TrackID></TrackRequest>, i got only "API=TrackV2&XML=" and see the result for this.

Also have same problem on test.php. See the xml value and result.Can any body suggest any solution. For both of above issues i replaced xml value < than for &lt; and > for &gt;. You just comment the line 26 and uncomment the line 27 and see the xml and result. As well as you can see the test.php by adding comment on 26 and uncommenting on 27 line.

User id & TrackIDs are valid and see the reference documents

http://www.usps.com/webtools/htm/Track-Confirm.htm
http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm

Can you people tell where am i wrong.?
Attached Files
File Type: zip to.zip (3.4 KB, 629 views)
Jan 3 '11 #1
5 8624
HaLo2FrEeEk
404 256MB
It looks like you're tying to pass XML characters (<, >) through a GET request. This won't work. If you must do it this way, try rawurlencode()-ing the XML data before attaching it to the URL, then when you recieve it you can rawurldecode() it.

Also:

http://www.usps.com/webtools/htm/Dev...#_Toc205879392

Usage ID Restrictions. Be careful, you've posted your personal User ID to the internet, it's very possible your access to the API will now be revoked if anyone feels the inclination to steal that User ID from you.
Jan 4 '11 #2
maheswaran
190 100+
Hi thanks for your reply. i have no luck even using with rawurlencode
Jan 4 '11 #3
HaLo2FrEeEk
404 256MB
Well I ran test1.php and I got some HTTP headers and proper tracking data for the package ID "EJ958083578US". The package was delivered at 8:10 am on June 1 in Wilmington DE 19810. If all you're worried about is that the URL prints properly to the page then change line 29 to this:

echo "PRINT XML -> ".htmlentities($data)."<br><br>";

And it'll work.
Jan 4 '11 #4
maheswaran
190 100+
hi,

Am not get this answer.Can you post your code which ran?
Jan 4 '11 #5
HaLo2FrEeEk
404 256MB
No, Bytes isn't a place for people to write your code for you. I downloaded to.zip, which you attached to your first post. I didn't change anything, line 26 was uncommented and line 27 was commented. I loaded up test1.php and I got a page that had this line:

Expand|Select|Wrap|Line Numbers
  1. PRINT XML -> API=TrackV2&XML=
And a bunch of valid tacking data after a <hr> tag.

I did exactly what I told you to do in my previous post and I got the same page, except the first line was this:

Expand|Select|Wrap|Line Numbers
  1. PRINT XML -> API=TrackV2&XML=<TrackRequest USERID='468CMAFI3505'><TrackID ID='EJ958083578US'></TrackID></TrackRequest>
Again, if you only want to get the URL to display correcly on the page, then re-read my previous post, the part where I tell you about changing line 29. The code works and you're getting proper tracking data, so I assume that you're only worried about the URL printing on the page correctly.
Jan 4 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: shank | last post by:
Has anyone seen a decent script for getting USPS rates live in your own shopping cart?
3
by: Kyle Friesen via AccessMonster.com | last post by:
Mike, I have databse that creates a "tracking number" based on the selections made on the form via concatenating. At the end of the tracking number, I need a two digit (01-99) sequence number by...
2
by: Darin | last post by:
I would like to connect to the USPS web service which validates address' and looks up zip codes but the USPS examples are in in Visual Basic 6 while I want to do it in C#. I am reading about...
2
by: vijender.mca | last post by:
Hai friends, I am trying to send an XML transmission to the US Postal Service to retrieve shipping rates but so far have been unsuccessful. Can any one help me and provide me a source code...
1
by: bdockery | last post by:
So I figured out that if you use this html: http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=<TRACKING...
0
by: sklett | last post by:
I've been failing horribly trying to use USPS WebTools API from my WinForm app. The problem I'm having is that they've switched to using SSL on the APIs and I can't get my HttpRequest to work any...
3
by: =?Utf-8?B?R3JhaGFt?= | last post by:
I've added 2 tracking services to the wf runtime; one is the standard SqlTrackingService: trackingService = new SqlTrackingService(<trackingConnectionString>); <workflow...
0
by: LiveTecs | last post by:
http://www.livetecs.com TimeLive Web Collaboration Suite is an integrated suite that allows you to manage project life cycle including tasks, issues, bugs, timesheet, expense, attendance. ...
0
by: movieking81 | last post by:
Has anyone here used these tools? I'm building a shopping cart for my site and I would like to grad USPS info for shipping. I have gotten as far as submitting the zip codes to the USPS servers and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.