Ruby, iOS, and Other Development

A place to share useful code snippets, ideas, and techniques

All code in posted articles shall be considered public domain unless otherwise noted.
Comments remain the property of their authors.

2008-02-20

The Quest for the UPS API

This is a bit of a departure for this blog, but it's been a while since I posted and I'm inspired by the hoop-jumping UPS (yes, that UPS) requires for developers to begin using their web service APIs. There are NDAs involved, so this is not about the APIs themselves; it is about getting to the point where one can start working with the APIs. It is presented in the format of a text adventure. Pedantic corrections to format are welcome, since it's been a long time since I've played one.

Welcome to Colossal API Quest! Find the documentation, get authorized to use the development integration environment, and meet the needs of your client to achieve fame and fortune!

  • You are in a maze of twisty little passages, all alike. There is a door to the North.
  • N
  • Welcome to UPS. A GATEKEEPER blocks the door to the North. There are also doors to the East, West, and South.
  • talk to the gatekeeper
  • "Username and password or register?"
  • say register
  • "Tell me everything about yourself. Also, what is your UPS account number?"
  • N
  • "Username and password or register?"
  • E
  • Welcome to UPS. There are several signs here advertising the wonderful web services UPS provides and pointing to the door to the North. There is also a door to the West.
  • N
  • The door is locked.
  • W
  • Welcome to UPS. A GATEKEEPER blocks the door to the North. There are also doors to the East, West, and South.
  • W
  • Your CLIENT is here. There is a door to the East and to the West.
  • talk to the client
  • "Is my website ready yet?"
  • need UPS help
  • What?
  • say "need UPS help"
  • "You should talk to our UPS contact. She's in the next room."
  • W
  • There is a notepad in an otherwise empty room. There is a door to the East.
  • get notepad
  • You can't take that.
  • look notepad
  • It says, "Sorry, I'm on vacation for the next 6 turns. Please leave a message."
  • wait
  • wait
  • wait
  • wait
  • wait
  • wait
  • look
  • There is a notepad in an otherwise empty room. There is a door to the East.
  • look notepad
  • It says, "Sorry, I'm not here right now. Please leave a message."
  • write "please tell me how to get the API documentation"
  • Write with what?
  • inventory
  • You have:
    • frustration
    • deadlines
    • a pen
  • write "please tell me how to get the API documentation" on notepad with pen
  • OK
  • wait
  • look
  • There is a notepad in an otherwise empty room. There is a door to the East.
  • E
  • Your CLIENT is here. There is a door to the East and to the West.
  • talk to the client
  • "Is my website ready yet?"
  • say "can't find UPS contact"
  • "You should talk to our UPS contact. She's in the next room."
  • xyzzy
  • You are in a familiar room, but there is no notepad. A CONTACT is here. There is a door to the East.
  • talk contact
  • "How can I help you?"
  • say "UPS API documentation"
  • "Here is the CLIENT's username and password"
  • inventory
  • You have:
    • frustration
    • deadlines
    • a pen
    • username
    • password
  • say "UPS account number"
  • "Here is the CLIENT's account number"
  • E
  • Your CLIENT is here. There is a door to the East and to the West.
  • E
  • Welcome to UPS. A GATEKEEPER blocks the door to the North. There are also doors to the East, West, and South.
  • give username to gatekeeper
  • "Password?"
  • give password to gatekeeper
  • The GATEKEEPER leaves the room. You have defeated the GATEKEEPER! You have earned 6/120 points.
  • N
  • Welcome to My UPS. There is a pile of documentation here. There is a WEBSITE here. There are two doors to the North. There are also doors to the East, West, and South.
  • get documentation
  • Which documentation?
  • look documentation
  • There are lots of... look, let's just skip this step. Get the bits you want, they're all here.
  • get time in transit documentation
  • Okay, I lied. Do you want HTML or XML documentation?
  • both?
  • OK. You have earned 10/120 points.
  • inventory
  • You have:
    • frustration
    • deadlines
    • a pen
    • username
    • password
    • account number
    • Time in Transit XML documentation
    • Time in Transit HTML documentation
  • get tracking documentation
  • Okay, I lied. Do you want HTML or XML documentation?
  • both
  • OK. You have earned 14/120 points.
  • look time in transit xml documentation
  • It says, "You need an XML access key to use the development integration environment."
  • look tracking html documentation
  • It says, "You need an HTML access key to use the development integration environment."
  • look N
  • The two doors to the North are marked "XML access key" and "HTML access key". You can refer to them as N1 and N2.
  • N1
  • The door marked "XML access key" is locked. You need the developer key.
  • N2
  • The door marked "HTML access key" is locked. You need the developer key.
  • talk website
  • How can I help?
  • say "developer key?"
  • "I can resend your developer key to the email address in your profile, or you can give me another email address to send it to and I will magically update your profile."
  • ponder wisdom of changing email address on client's account
  • What?
  • say "send to profile email"
  • OK. You have earned 15/120 points.
  • S
  • Welcome to UPS. There are doors to the East, West, and South.
  • W
  • Your CLIENT is here. There is a door to the East and to the West.
  • talk to the client
  • "Is my website ready yet?"
  • say "need developer key"
  • "What?"
  • say "need UPS developer key"
  • "What?"
  • say "need UPS email"
  • "You mean this thing?"
  • inventory
  • You have:
    • frustration
    • deadlines
    • a pen
    • username
    • password
    • account number
    • Time in Transit XML documentation
    • Time in Transit HTML documentation
    • Tracking XML documentation
    • Tracking HTML documentation
    • an email
  • look email
  • It contains a developer key. You have earned 87/120 points.
  • inventory
  • You have:
    • overwhelming frustration
    • looming deadlines
    • a pen
    • username
    • password
    • account number
    • Time in Transit XML documentation
    • Time in Transit HTML documentation
    • Tracking XML documentation
    • Tracking HTML documentation
    • a developer key
  • E
  • Welcome to UPS. There are doors to the East, West, and South.
  • N
  • Welcome to My UPS. There is a pile of documentation here. There is a WEBSITE here. There are two doors to the North. There are also doors to the East, West, and South.
  • N1
  • Welcome to My UPS. There is an XML access key here. There is a door to the South.
  • get key
  • There is no key here
  • get xml access key
  • OK. You have earned 95/120 points.
  • S
  • Welcome to My UPS. There is a pile of documentation here. There is a WEBSITE here. There are two doors to the North. There are also doors to the East, West, and South.
  • N2
  • Welcome to My UPS. There is an HTML access key here. There is a door to the South.
  • get html access key
  • OK. You have earned 103/120 points.
  • S
  • inventory
  • You have:
    • overwhelming frustration
    • looming deadlines
    • a pen
    • username
    • password
    • account number
    • Time in Transit XML documentation
    • Time in Transit HTML documentation
    • Tracking XML documentation
    • Tracking HTML documentation
    • a developer key
    • XML access key
    • HTML access key
    • the ability to finally make some progress

To be continued, maybe. Enjoy!

Labels: ,