Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

List events from the event log.


Setup

Access to API

Example

Username (see Authentication section)wsfoobar
Password (see Authentication section)a-very-very-long-password

Contact you transport carrier partner to obtain this information. 

Making a request

Notes

  • Clients using this API should not fail if new fields are added to the response. If a new field is added to the response on a later stage, existing clients should handle this in a way such as they just ignore the field.
  • Fields not set in the response are not left out, that is fields in the response may have null values. E.g. "shipmentNumber": null. The client using the endpoint should handle this.  


Environments / endpoints

TESTGET
https://staging-ws.di.no/ws/json/parcel/tracking/v-2/fetch/{identifier}/{locale}/{onlyLastEvent}
PRODUCTIONGET
https://ws.di.no/ws/json/parcel/tracking/v-2/fetch/{identifier}/{locale}/{onlyLastEvent}

Request header

key

value example

comment

Authorization

Bearer $SECRET_WS_TOKEN
see Setup
Content-Typeapplication/json

Path parameters

parameterexampledescription
identifier370724760010119754Shipment number, tracking number or return code. 
localeNO

Language code. Event description will be translated to locale. Supported language codes are currently:

  • NO - Norwegian
  • EN - English
  • SE - Swedish 
onlyLastEventfalseIf set to true only the last registered event is returned. Last registered is decided based on eventTime. If false, all available events are returned 

Authentication

The endpoint require authentication, as described here: LoginV2

Response body

List of shipments relevant for the request. Usually there will only be one shipment, but in cases where the way of delivery have been changed for one or more items, it may have been put on a different shipment. In those cases the "linkedParcelNumber" under shipment items will link to

NameTypeExampleMax lengthDescription
shipmentNumberwhole number7072476012000088035

Globally unique identifier for the shipment, typically a GINC code. Typically named MessageNumber, DocumentNumber or ConsignorsReference in EDI.

shopNamestringTestbutikken50Name of the shop/owner party of the shipment
shopIdwhole number15ID of the  of the shop/owner party of the shipment
consigneeReferencestringo12335

Usually an orderId or some other reference chosen by the shop/owner party.

consignorReferencestringo12335Usually an orderId or some other reference chosen by the shop/owner party.
propertiesproperties object-n/aNot in use
itemslist of items
n/a

Items

NameTypeExampleMax lengthDescription
trackingNumberwhole number37072476012000089835Unique identifier for an item/kolli in the shipment. This can be a SSCC code according to gs1, or a UPU S10 identifier.

Typically named TransporterInstructionMark in EDI.

returnCodestringR-123410Optional additional unique identifier, used for pick up parcels
freightProductIdwhole number110The freight product describes a way of delivery, and is defined by a delivery method and the coverage of the given method.
freightProductNamestringekspress levering hjem50The freight product describes a way of delivery, and is defined by a delivery method and the coverage of the given method.
parcelStatusstringLevert25Tracking status for the item/kolli
linkedParcelNumberslist of linkedParcelNumbers
n/aList of trackingNumber(s) for the same physical object, used when several different ways of delivery have been used. 
eventslist of events
n/a

Events

Name

Type

Example

Max Length

Description

eventTimestring2017-08-22 13:55:1319Time of the event registered in originating system. Datetime format yyyy-MM-dd HH:mm:ss
latdouble59.9110969Latitude for the location of the event
londouble10.7524579Longitude for the location of the event
locationContextstringOsloveien 14, 0288 Oslo255Address or description of the location/ context of the event
locationContextIdstring3456710Unique identification of the locationContext
Parcel Event Log v1#eventTypeeventTypeeventType objectn/aDescription of the event, will be translated to defined locale
Parcel Event Log v1#additionalInfoadditionalInfo

additionalInfo object

n/aAdditional description of the event, will be translated to defined locale
Parcel Event Log v1#eventGroupeventGroupeventGroup objectn/aGroupage of event, e.g. transportation events, communication events etc.
communicationChannelstringSMSn/a

Communication channel only used for event types within event group "communication".

ComChannelTypes  in use:

  • SMS
  • EMAIL
changeUserIdwhole number112233n/a

Internal user identification responsible for the event taking place. Only returned for callees having the highest access level

Parcel Event Log v1#regSystemregSystemregSystem objectn/aSystem that registered the event
messagestring
255Optional message from the system registering the event

eventType

NameTypeExampleMax lengthDescription
apiKeystring001n/aIdentifier for the event group
descriptionstringPackage receivedn/aStatic description of the event, will be translated to defined locale
i18nKeystringevent.type.pub.shipment.receivedn/aKey which can be used to add your own translations

additionalInfo

NameTypeExampleMax lengthDescription
apiKeystring001n/aIdentifier for the additional info group
descriptionstringPackage receivedn/a

Static description of the event, will be translated to defined locale. Can be concatenated with the Parcel Event Log v1#eventType description for a more detailed description. The formatting is already taken care of

i18nKeystringevent.type.pub.shipment.receivedn/aKey which can be used to add your own translations

eventGroup

NameTypeExampleMax lengthDescription
idwhole number1n/aidentifier for the event group
namestringcommuncationn/anamed classification of the group
Group idDescription
1Information on shipments received/imported in DI
2Information on transportation
3Information on communication
4Information on status updates
5Information on scanning of shipments
6Information for shipments transported by others
7Information from/relating to external systems
8Information on internal processing

regSystem

NameTypeExampleMax lengthDescription
idwhole number1n/aidentifier for the originating system
namestringPostnordn/anamed classification of the originating system

Example Request/response

Curl request
curl -X GET \
  https://ws.di.no/ws/json/parcel/tracking/v-2/fetch/370724760120000898/NO/false \
  -H 'Authorization: Bearer $SECRET_WS_TOKEN' \
  -H 'Content-Type: application/json' \


Response
[
    {
        "shipmentNumber": "70724760120000880",
        "shopName": "Testbutikken",
        "shopId": 1,
        "consigneeReference": null,
        "consignorReference": null,
        "properties": {},
        "items": [
            {
                "trackingNumber": "370724760120000898",
                "returnCode": null,
                "freightProductId": 1,
                "freightProductName": "helthjem",
                "parcelStatus": null,
                "linkedParcelNumbers": [],
                "events": [
                    {
                        "eventTime": "2017-11-09 04:13:23",
                        "lat": null,
                        "lon": null,
                        "locationContext": "OSLO",
                        "locationContextId": null,
                        "eventType": {
                            "apiKey": "013",
                            "description": "Pakken er levert",
                            "i18nKey": "event.type.distr.shipment.delivered"
                        },
                        "additionalInfo": null,
                        "eventGroup": {
                            "id": 4,
                            "name": "event.type.group.status"
                        },
                        "comChannelType": null,
                        "changeUserId": null,
                        "regSystem": null,
                        "message": null
                    },
                    {
                        "eventTime": "2017-11-09 00:33:43",
                        "lat": null,
                        "lon": null,
                        "locationContext": "Beh.engangslev.",
                        "locationContextId": null,
                        "eventType": {
                            "apiKey": "013",
                            "description": "Pakken er levert",
                            "i18nKey": "event.type.distr.shipment.delivered"
                        },
                        "additionalInfo": null,
                        "eventGroup": {
                            "id": 4,
                            "name": "event.type.group.status"
                        },
                        "comChannelType": null,
                        "changeUserId": null,
                        "regSystem": null,
                        "message": null
                    },
                    {
                        "eventTime": "2017-11-08 05:20:28",
                        "lat": null,
                        "lon": null,
                        "locationContext": "OSLO",
                        "locationContextId": null,
                        "eventType": {
                            "apiKey": "013",
                            "description": "Pakken er levert",
                            "i18nKey": "event.type.distr.shipment.delivered"
                        },
                        "additionalInfo": null,
                        "eventGroup": {
                            "id": 4,
                            "name": "event.type.group.status"
                        },
                        "comChannelType": null,
                        "changeUserId": null,
                        "regSystem": null,
                        "message": null
                    },
                    {
                        "eventTime": "2017-11-07 05:45:03",
                        "lat": null,
                        "lon": null,
                        "locationContext": "OSLO",
                        "locationContextId": null,
                        "eventType": {
                            "apiKey": "013",
                            "description": "Pakken er levert",
                            "i18nKey": "event.type.distr.shipment.delivered"
                        },
                        "additionalInfo": null,
                        "eventGroup": {
                            "id": 4,
                            "name": "event.type.group.status"
                        },
                        "comChannelType": null,
                        "changeUserId": null,
                        "regSystem": null,
                        "message": null
                    }
                ]
            }
        ]
    }
]

List of possible events

Response from Pacel Event Log API  (no/en).pdf



  • No labels