Creating an integration script include for third-party carrier applications
-
- UpdatedAug 1, 2024
- 2 minutes to read
- Xanadu
- Hardware Asset Management
In order to integrate with a ServiceNow instance, a third-party carrier application must have a script include that extends the base class ITAMShipmentIntegration script on its ServiceNow instance to receive the shipment tracking number from the customer's ServiceNow instance and respond with the carrier-related details.
- Make sure that the script include is accessible from the Asset Management Common application scope by adjusting the following settings on the application resource record:
- Set the Accessible from field to All application scopes.
- Set the Caller Access field to None to make sure the caller access isn't restricted.
- The code for communicating with the customer's ServiceNow instance based on the tracking number must be included within the fetchShipmentInfo function.
- When the API is invoked in the test mode for validating the connection with the customer's ServiceNow instance, the return response from the fetchShipmentInfo method should be a JSON object with the HTTP response code and response message, as follows:
- When not in the test mode, query the shipments and invoke the processResponse method with the following response format:
ITAMShipmentIntegration script include sample codes


fetchShipmentInfo function
The fetchShipmentInfo function receives the tracking numbers from the ServiceNow instance of the customer and invokes the carrier API to fetch the shipment details for all the tracking numbers. Within this function, you must define the business logic that enables your customers to communicate with your carrier APIs based on the tracking numbers. This function processes the response that is received from the carrier API and invokes the post-processing function.
processResponse function
- Carrier link
- Carrier status
- Carrier status detail
- Carrier pick-up date
- Carrier delivered date
- Currency
- Delivery services cost
- Parcel weight
You can either use the default processResponse function or define a custom logic to update the shipment records.
On this page
Related Content
- Connect your ServiceNow instance with a shipping carrier application
Associate a shipping carrier with an integration profile to connect your ServiceNow instance to the carrier application.
- Remove a shipping carrier from an integration profile
Remove a shipping carrier that you no longer want to associate with an integration profile.
- Create a carrier integration profile
Create a carrier integration profile for your carrier by specifying the API and connection details that are used to connect your ServiceNow instance to the third-party shipping carrier application.
- View the carrier integration profile details
View the details of the carrier API used to connect your ServiceNow instance to the third-party shipping carrier application.
- Test the integration with the carrier API
Check the connection with the carrier API to handle any connection issues such as invalid credentials, incorrect tracking details, and issues with the integration script include.
- Create a shipping carrier record
Create a shipping carrier record used to associate the carrier with an integration profile.
- View hardware asset shipment details
View all hardware asset shipment details in a single place in the Hardware Asset Workspace .
- Stale shipments
Shipments that are delayed due to various reasons such as an incorrect tracking number, the loss of a shipment package during transit, and invalid connection details are considered stale shipments.
- Track a hardware asset shipment
Track the progress of your hardware asset shipment that isn't delivered and that has a carrier associated with an active integration profile.