Device42 to JSM Assets
Device42 to JSM Assets Integration Guide
This guide explains how to use OnLink to import Device42 data into JSM Assets. It covers the Device42 API connection, sample data, field mapping, validation, and optional query parameters.
Overview
OnLink can import Device42 API responses into JSM Assets object types by using mapping statements such as key:, map:, and config:. The same approach can be used for Device42 object types such as devices, users, circuits, and wireless data, provided the corresponding Device42 API endpoint and Assets object type are configured.
The high-level process is:
Create or confirm the target JSM Assets schema and object type.
Configure an OnLink Assets Data Source that uses Basic Auth to connect to Device42.
Set the API method and Device42 endpoint, then fetch sample data.
Map Device42 JSON fields to JSM Assets attributes.
Use Get Data to validate the result, then run the import.
Prerequisites
A JSM Assets schema and object type for the data you want to import.
OnLink installed and available from Manage your apps.
A Device42 username and password with access to the required API endpoints.
Permission in JSM Assets to configure data sources, mappings, and imports.
The Device42 API endpoint URL for the object type you plan to import.
Supported Device42 object types
The examples on this page use Device42 devices. The same pattern can be adapted for other Device42 data, such as Assets, Devices, and Cloud objects, by selecting the appropriate Device42 API endpoint and mapping the returned JSON fields to the matching Assets attributes.
1. Prepare Device42 credentials
Before configuring OnLink, confirm that you have a Device42 username and password with access to the required API endpoints. For Device42 authentication details, see https://api.device42.com/.
Keep the credentials available for the OnLink data source configuration.
2. Configure the OnLink data source
In OnLink, add an Assets Data Source.
Set Authentication Type to Basic Auth.
Provide User name and Password.
3. Configure the API method
Use a GET request to retrieve records from the Device42 API. For example, to fetch devices, configure the request as follows:
Set Method to
GET.Set URL to the Device42 API endpoint, for example: https://device42.com/api/2.0/devices/.
Set Response data path to
devices.Leave other settings at their defaults unless the endpoint requires query parameters.
GET /api/2.0/devices/
4. Fetch sample data
Save the connection, then run it to fetch sample values from Device42. Use the returned sample JSON to confirm that the endpoint is correct and to identify the field names needed for mapping.
Sample response
{
"Devices": {
"total_count": "709",
"limit": "1",
"devices": [
{
"name": "Device_Name",
"type_id": 2,
"serial_no": "FOC1252W6EW",
"asset_no": "123456",
"device_url": "/api/2.0/devices/64/",
"device_id": "64",
"type": "physical",
"uuid": ""
}
],
"offset": "0"
}
}Pagination notes
Device42 API responses may be paginated. If the response includes fields such as offset and limit, configure pagination in OnLink using those values.
5. Configure the Assets import and mapping
After the connection is established, create the Assets import by following the JSM Assets Data Synchronization guide.
Use the fetched API sample to identify the Device42 JSON field names and map them to the corresponding JSM Assets attributes. The key: mapping should identify the stable unique value used to match and update existing Assets objects.
Mapping | Purpose |
|---|---|
| Uses the Device42 |
| Maps the Device42 device name to |
| Maps the Device42 device type to |
| Maps the Device42 serial number to |
| Maps the Device42 asset number to |
Mapping guidance
Start with one unique
key:mapping so OnLink can identify whether to create or update an Assets object.Add
map:entries for each Device42 field you want to store in Assets.Compare the Device42 sample JSON with the Assets object type attributes before running an import.
If a value is nested in the JSON response, inspect the sample output carefully and use the field path supported by the OnLink mapping configuration.
6. Validate and run the import
Use Get Data to preview the data returned by Device42.
Confirm that the sample records contain the expected fields and values.
Verify that the key field maps to a unique JSM Assets attribute.
Review object type mappings and attribute names for spelling and case consistency.
Run the import only after the previewed data and mapping are correct.
Optional filtering
Use Device42 API query parameters to limit the records returned by the endpoint. For supported filters, refer to the Device42 API documentation for the endpoint you are using.
For supported filters, see the Device42 devices API documentation: https://api.device42.com/#Devices_getDevices_2.
Example: to return only in-service devices, add this query parameter:
in_service=yes
To include Additiopnal Columns
Use Device42 API query parameters to add additional columns to be returned from the API response.
Refer to this page https://api.device42.com/#Devices_getDevices_2 to check on the filters supported by Device42 API
In OnLink, e.g to return the following columns, we need to add this to the query params
device_id, name, type_id, type, serial_no, asset_no, uuid, notes, last_updated, first_added