How to get your API Key?
Before you started with using our REST API services, you will need to obatin your API key under your own user account.
Once you've registered your API it's easy to start requesting data from AfterShip.
All endpoints are only accessible via https and are located at api.aftership.com.
All API call must include this header in order to auth the useage of AfterShip API.Replace your API_API_KEY with your own key.
All the request and response are in JSON string.
Be nice. If you're sending too many requests too quickly, we'll send back a 429 error code (TooManyRequests).
You are limited to 600 reqs/min per account. Practically, this means you should (when possible) authenticate users so that limits are well outside the reach of a given user.
The API response headers also give you the following X-RateLimit value
|1406096275||The unix timestamp when the rate limit will be reset.|
|600||The rate limit ceiling for your account per min.|
|598||The number of requests left for the 1 minute window.|
Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:
The meta key is used to communicate extra information about the response to the developer. If all goes well, you'll only ever see a code key with value 200. However, sometimes things go wrong, and in that case you might see a response like:
The data key is the meat of the response. It may be a list of results, but either way this is where you'll find the data you requested.
Here is the example for a GET /couriers