5

It seems that sending this with every XML request is the only way to use the UPS Tracking API:

<?xml version="1.0" ?>
<AccessRequest xml:lang='en-US'> <AccessLicenseNumber>
YOURACCESSLICENSENUMBER
</AccessLicenseNumber> <UserId>
YOURUSERID
</UserId> <Password>
YOURPASSWORD
</Password> </AccessRequest>

So basically you can't use it in a desktop app, because your users would be able to find your password. And yes, I could run a backend on my own server, but that's needlessly complicated. Does UPS provide a sane way to authenticate without having to put a copy of the password in each copy of my app?

houbysoft
  • 32,532
  • 24
  • 103
  • 156
  • Downvoters never get notified of comments aimed at "downvoter", so it's pointless to ask... – sarnold Jul 27 '12 at 01:02
  • 1
    Why would this forbid you from writing a desktop application? Surely each of your users will have their own accounts, with their own addresses, own billing, and so forth... – sarnold Jul 27 '12 at 01:03
  • @sarnold: I want to make an application that would provide tracking information to the user. So the user would just put a tracking number ID in, no additional information. Requiring each user to register with UPS first would be a hassle... – houbysoft Jul 27 '12 at 01:05
  • @sarnold: basically the only way to make this work right now seems to scrape the UPS webpage. – houbysoft Jul 27 '12 at 01:07
  • Ah, I see. Going entirely on what you've written here, I'd think running your own server would be the way to go; [they don't have to be too expensive..](http://www.linode.com/). – sarnold Jul 27 '12 at 01:10
  • @sarnold: still, I'm trying to avoid that for a relatively simple app like this... But thanks for the link. I already have a server which I could use for this but linode seems better :) – houbysoft Jul 27 '12 at 01:51
  • Check out the [UPS Ready® Program](http://www.ups.com/content/us/en/bussol/browse/ready_program.html) – JimmyPena Nov 18 '13 at 20:21

2 Answers2

3

If you want to access UPS api directly, not through your own server then you can't. UPS has put the requirement for api key and password for a reason: to have some control how the api is used (and for example throttle requests for api key if necessary). Even if you decide you can live with giving strangers access to your api key and password it's quite likely it will get revoked (I'm pretty sure you are not allowed to share those). So using api is out of the question.

As an alternative you could try getting the tracking info using public tracking (no api) on their website, but you are likely to hit per IP request limits, csrf tokens etc and should the page change in any way you are screwed. Not a good idea.

Simple app or not you'll have to run part of it on your server.

c2h5oh
  • 4,492
  • 2
  • 23
  • 30
1

There isn't really a way to do this without running it on your server. What you can do however, since you want your application to provide tracking information, is why not just open that information in the default web browser. Is this feasable?

If so take a look at this: http://oreilly.com/pub/h/4106, (look at the logic more than the implementation)

marcoo
  • 821
  • 1
  • 9
  • 25