Resources are accessible via http / https (some may require https) and are located at api.dhlglobalmail.com. For instance you can get a closeout id by accessing the following URL with your access token and client id (replace :accesstoken and :clientid with your own):

https://api.dhlglobalmail.com/v1/locations/5300000/closeout/id?access_token=:accesstoken&client_id=:clientid

Limits

Be nice. If you're sending too many requests too quickly, we'll send back a 429 status code (Too Many Requests).

Request Methods

We do our best to have all our URLs be RESTful. Every resource (URL) may support one of four different HTTP verbs:

  • GET requests fetch information about an object
  • POST requests create objects
  • PUT requests update objects
  • DELETE requests will delete objects

Structure

The Envelope

Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:

{
"meta": {
  "code": 200
},
"data": {
  …
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Meta>
  <Code>200</Code>
</Meta>
<Data>
  …
</Data>
</Response>

Meta

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:

{
"meta": {
  "code": 400,
  "error": [
    {
      "error_type": "INVALID_LOGIN",
      "error_message": "…"
    }
  ]
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Meta>
  <Code>400</Code>
  <Error>
    <ErrorType>INVALID_LOGIN</ErrorType>
    <ErrorMessage>…</ErrorMessage>
  </Error>
</Meta>
</Response>

Data

The data key is the meat of the response. It may be a string, list, or dictionary; but either way this is where you'll find the data you requested.