Device42 to JSM Assets

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:

  1. Create or confirm the target JSM Assets schema and object type.

  2. Configure an OnLink Assets Data Source that uses Basic Auth to connect to Device42.

  3. Set the API method and Device42 endpoint, then fetch sample data.

  4. Map Device42 JSON fields to JSM Assets attributes.

  5. 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

  1. In OnLink, add an Assets Data Source.

  2. Set Authentication Type to Basic Auth.

  3. 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:

  1. Set Method to GET.

  2. Set URL to the Device42 API endpoint, for example: https://device42.com/api/2.0/devices/.

  3. Set Response data path to devices.

  4. 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

Mapping

Purpose

key:device_id=Device ID

Uses the Device42 device_id field as the unique key for matching and updating JSM Assets objects.

map:name=Device Name

Maps the Device42 device name to Device Name.

map:type=Device Type

Maps the Device42 device type to Device Type.

map:serial_no=Serial Number

Maps the Device42 serial number to Serial Number.

map:asset_no=Asset Number

Maps the Device42 asset number to Asset Number.

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

  1. Use Get Data to preview the data returned by Device42.

  2. Confirm that the sample records contain the expected fields and values.

  3. Verify that the key field maps to a unique JSM Assets attribute.

  4. Review object type mappings and attribute names for spelling and case consistency.

  5. 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