Skip to main content

Authentication

Authentication is performed using the data sent as part of the request in the headers or as a header block within the data request.

You need to supply 4 pieces of information;

  • Your API key as supplied within your account area.
  • A key which is used to decode your token.
  • A token which is made up by SHA1 encoding your Shared Secret and the key from above. This must be encoded in the following format {SharedSecret}_{Key}.
  • A Unique ID. This is for logging purposes and will enable us to locate a request should you require assistance and should be unique for every request.

Examples

Json / XML

// header block Example
{
    "lookup": {
        "header" : {
            "apikey": "Your API Key",
            "key": "publickey",
            "token": "SHA1(SharedSecret_publickey)",
            "uniqueid": "1234567890"
        },
        ...
    }
}
// cURL request headers Example
curl -X POST \
  'https://parcelbroker.test/api/v2/' \\
  --header 'Accept: */*' \\Your API Key
  --header 'apikey: fTvnyvfBj5A7efr7Uu6PBf7LGBxt87SdSXw8WoLYWe3JjyuyDw' \\
  --header 'key: publickey' \\
  --header 'token: SHA1(SharedSecret_publickey)' \\
  --header 'unique-id: 1234567890' \\
  --header 'Content-Type: application/json' \\
// header block Example
<lookup>
    <header>
        <apikey>Your API Key</apikey>
        <key>publickey</key>
        <token>SHA1(SharedSecret_publickey)</token>
        <uniqueid>1234567890</uniqueid>
    </header>
    ...
</lookup>
// cURL request headers Example
curl -X POST \
  'https://parcelbroker.test/api/v2/xml' \\
  --header 'Accept: */*' \\Your API Key
  --header 'apikey: fTvnyvfBj5A7efr7Uu6PBf7LGBxt87SdSXw8WoLYWe3JjyuyDw' \\
  --header 'key: publickey' \\
  --header 'token: SHA1(SharedSecret_publickey)' \\
  --header 'unique-id: 1234567890' \\
  --header 'Content-Type: application/xml' \\