API overview
Call | Description |
POST /status-data/v2/statuses | Check if a user has been active in MP based on telephone number or email |
POST /status-data/v2/statuses
Parameters
Mandatory parameters
Parameter | Mandatory? | Type | Description |
externalSystemId | Optional | String | A unique id used to identify the shipment if shipment number or parcel number is not yet available |
shipmentNumber | Mandatory | String | The id used to identify the shipment (optional if parcel number or externalSystemId is present) |
parcelNumber | Mandatory | String | Your unique code identifying the transport service used |
time |
Optional | String | Timestamp of the status event - will use current time if not present |
code | Mandatory | String | Status code |
location | Optional | String | Location of the status event |
locationCode | Optional | String | Location code of the status event |
countryCode | Optional | String |
ISO 3166-1 alpha-2 country code (mandatory if locationCode is present)
|
name | Mandatory | String |
Short name describing the status (optional if localized name is present)
|
localizedName | Optional | JSON |
optional if name is present |
message | Mandatory | String |
Detailed message of the status (optional if localized message is present) |
localizedMessage | Optional | JSON |
optional if message is present |
sendNotification | Optional | boolean |
Indicates if a notification should be sent to the user |
Localized Name parameters
Spec for localizedName JSON
Parameter | Mandatory? | Type | Description |
localeCode:name | Optional | String | A list of key/value pairs where key is the ISO 639-1 language code, and value is the name. Example: "en": "This is a name" |
Localized Message parameters
Spec for localizedMessage JSON
Parameter | Mandatory? | Type | Description |
localeCode:name | Optional | String |
A list of key/value pairs where key is the ISO 639-1 language code, and value is the message. Example: "en": "This is a message" |
One Status:
[ { "externalSystemId": "XXXXXXXX", "parcelNumber": "XXXXXXXX", "shipmentNumber": "XXXXXXXX", "time": 1515251966000, "code": "PROCESSING_ORDER", "location": "Järfälla", "locationCode": "324967", "countryCode": "SE", "name": "Processing order", "localizedName": { "sv": "Hanterar order", "en": "Processing order" }, "message": "Dealer XYZ is processing your order, you will be notified when it is ready to be shipped", "localizedMessage": { "sv": "Handlare XYZ bearbetar din order, du kommer att bli aviserad när den är redo att skickas", "en": "Dealer XYZ is processing your order, you will be notified when it is ready to be shipped" }, "sendNotification": true } ]
Minimal JSON for one Status:
[ { "shipmentNumber": "XXXXXXXX", "code": "PROCESSING_ORDER", "name": "Processing order", "message": "Dealer XYZ is processing your order, you will be notified when it is ready to be shipped" } ]
Responses
Successful import HTTP response code 202
{ "result": "SUCCESSFUL", "validationErrors": [] }
Failed import HTTP response code 422
{ "result": "FAILED", "validationErrors": [ { "externalSystemId": "XXXXXXXX", "result": "FAILED", "errors": [ { "field": "name", "message": "Missing" }, { "field": "localizedName", "message": "Missing" } ] } ] }
Partial Successful batch request HTTP response code 202
{ "result": "PARTIAL_SUCCESS", "validationErrors": [ { "externalSystemId": "XXXXXXXX", "result": "FAILED", "errors": [ { "field": "name", "message": "Missing" }, { "field": "localizedName", "message": "Missing" } ] } ] }
Error Responses
Invalid credentials HTTP response code 401
{ "errorCode": "401", "userMessage": "Bad credentials" }
Unauthorized access HTTP response code 403
{ "errorCode": "403", "userMessage": "Forbidden" }
Malformed json HTTP response code 400
{ "errorCode": "400", "userMessage": "Unexpected end-of-input: expected close marker for Array (start marker at [Source: (String)\"[\n\t{\n \"parcelNumber\": \"XXXXXXXX\"\n}\n\"; line: 1, column: 1])\n at [Source: (String)\"[\n\t{\n \"parcelNumber\": \"XXXXXXXX\"\n}\n\"; line: 5, column: 39]\n at [Source: (String)\"[\n\t{\n \"parcelNumber\": \"XXXXXXXX\"\n}\n\"; line: 4, column: 1] (through reference chain: java.lang.Object[][1])" }