Skip to content

HelloWorld

HelloWorld echoed a string back without authentication. Parcel2Go has no echo endpoint. A connectivity check is two calls instead:

  1. Request a token. A 200 proves your Client ID, secret and environment are right. See Request a token.
  2. Call a simple read endpoint with the token. GET /api/countries is a good choice: it’s a GET with no parameters, and you’ll use it anyway to convert country codes.
curl -X GET "https://sandbox.parcel2go.com/api/countries" \
-H "Authorization: Bearer $P2G_TOKEN" \
-H "Accept: application/json"
Response
[
{
"Name": "United Kingdom",
"Iso3Code": "GBR",
"Iso2Code": "GB",
"Subdivision": null,
"RequiresDimensions": false
},
{
"Name": "United States",
"Iso3Code": "USA",
"Iso2Code": "US",
"Subdivision": null,
"RequiresDimensions": true
}
]

Abridged: two of the countries shown, and some fields left out.

Compare with the Parcel Monkey HelloWorld call
curl -X POST "https://api.parcelmonkey.co.uk/HelloWorld" \
-H "Content-Type: application/json" \
-H "apiversion: 3.3" \
-d '{
"echo": "Test123"
}'
Response
{
"hello": "Success!",
"echo": "Test123"
}
HelloWorld request field mapping
Parcel MonkeyParcel2GoRequiredNotes
echoNo equivalentNo equivalent. Use the token request plus GET /api/countries as the connectivity check.
HelloWorld response field mapping
Parcel MonkeyParcel2GoRequiredNotes
helloNo equivalentA 200 from the token endpoint and from GET /api/countries is the success signal.
echoNo equivalentNo equivalent.