This guide walks through the structure of the Reference object delivered by the Vizion API in JSON format.
The Vizion API's JSON output is designed to be easily interpreted by both machines and humans alike, making it versatile and convenient to use with any language or system. Once you understand the key components of the payload, the format is intuitive and straightforward to navigate.
This article walks through the structure of the JSON returned by the Show Reference Details endpoint, which defines the Reference object created by the Create Reference via Carrier Code endpoint, Create Reference via Bill of Lading endpoint, or [Beta] Create Reference via Booking Number endpoint.
The top-level properties of the JSON for a reference include a unique id to that reference, the container_id of the container being tracked, a bill_of_lading number or booking_number if one was provided when creating the reference, and the carrier_scac, or standard carrier alpha code, for that supported vessel operating common carrier.
Additionally, the callback_url will contain the URL, if provided, that the API will send tracking updates to when they are generated.
To define the remaining properties:
- parent_reference_id - The ID of the parent reference that was used to create this reference when creating by bill of loading or booking number
- active - if the reference is actively tracking a container
- auto_carrier - true if the reference was creating using the Create Reference via ACI endpoint
- last_update_status - the status code returned when the reference last attempted to generate a new tracking update (see statuses here)
- created_at - the timestamp when the reference was created
- updated_at - the timestamp when the reference was last modified
- last_update_attempted_at - the timestamp when the reference last checked for new tracking data
- retry_count - the number of retries the reference has performed while the last_update_status is in an error state (i.e. extraction_failed)
The reference object contains the ID of the organization that created it as well as an organization object with additional information. The id will match the organization_id. The name will be the name entered into Vizion's system for that organization. The active property determines if the organization is in use. Lastly, the created_at date displays when the organization was created in the system, and the updated_at date displays the last time that the organization was modified.
The reference object contains information about the carrier as well. The carrier_id, or id within the carrier object, is an internal identifying number for the carrier in the system. The name is the carrier's name. The code is the Vizion carrier code used when creating references to track containers with that carrier. Lastly, the enabled property is used to designate if the carrier is actively supported at that time.
"name": "Wan Hai",
Child Reference IDs
The child_reference_ids property is populated only when creating a reference using the Create Reference via Bill of Lading endpoint or the [Beta] Create Reference via Booking Number endpoint. It provides an array of all reference IDs used to track the containers associated with that bill of loading or booking number. When creating a reference using the Create Reference via Carrier Code endpoint, this array will be empty as shown below.