Change device connector/network using API

Change device connector/network using API

This comprehensive guide is designed to help you seamlessly change the network and connector for your devices on the TagoIO platform. Whether you prefer using an API through HTTPS requests with Postman or leveraging TagoIO's analysis scripts, this guide has you covered. We've divided the instructions into two main sections for clarity and ease of use.


Section 1: Changing the Network and Connector Using API

Prerequisites

Before proceeding, ensure you have the following:
  • Postman, or any API client software, installed on your computer.
  • The IDs for the network, connector, and device you wish to modify.
  • All existing tokens for your device deleted, otherwise you won't be able to change the connector.

Step-by-Step Guide

  1. Obtaining IDs
    1. Network and Connector ID: Navigate to the create devices page, select the desired connector within the network, and note the Network ID and Connector ID from the URL.
    2. Device ID: In the Devices tab, select your device and copy the Device ID from the URL.
  2. Deleting Device Tokens
    1. Go to the Devices tab, select your device, and delete all associated tokens.
  3. Configuring Postman
    1. Use the following API endpoint, with the data format below for your request.
  4. Generating an Profile Token
    1. Visit the Admin section, select your profile, and navigate to the Tokens tab.
    2. Generate a new token with "Expires Never" and copy it for use in your request.
  5. Executing the Request
    1. In Postman, import the curl command provided, replacing placeholders with your actual values.
    2. Send the request to apply the changes to your device.

  1. PUT - https://api.tago.io/device/{Device ID}
  2. Headers:
  3. - Authorization: Your account token
  4. Data:
  5. {
  6.   “network”: "network ID",
  7.   “connector”: "connector ID",
  8. }