Skip to main content
Skip table of contents

Breaking changes in thingsHub 5.0

API Changes in thingsHub 5.0

Changes to the /api/v3/assets endpoint:

  • The endpoint structure is simplified to match the format of a single asset object.

  • Instead of accepting an array of asset objects, it accepts a single object containing the following fields:

  • description: Optional textual description of the asset.

  • id: Unique identifier for the asset.

  • metadata: Optional dictionary containing additional asset information.

  • name: Name of the asset.

  • Comparison of the old and new payload:

    • Old:

      CODE
      POST /api/v3/assets
      
      [
        {
           "description": "Description of the asset",
           "id": "unique-id-of-asset",
           "metadata": {},
           "name": "Name of the Asset"
        }
      ]
    • New:

      CODE
      POST /api/v3/assets
      
      {
         "description": "Description of the asset",
         "id": "unique-id-of-asset",
         "metadata": {},
         "name": "Name of the Asset"
      }
  • Changes to the /api/v3/things endpoint:

POST /api/v3/things endpoint is deprecated and replaced with the new POST /api/v3/tracked-assets endpoint. The new endpoint simplifies the payload structure by removing the redundant metadata field.

  • Comparison of the old and new payload:

    • Old:

      CODE
      POST /api/v3/things
      {
            "external_id": "HH SM 4711",// ID of the Asset Tracker
            "id": "my-car",             // ID of the Asset
            "metadata": {               // Metadata of the asset copied for reference
                "license": "HH SM 4711",
                "vin": "4Y1SL65848Z411439"
            },
            "name": "My Car",           // Name of the Asset
            "type": "asset-tracker"     // ID of the Tracking Algorithm
        }
    • New:

      CODE
      POST /api/v3/tracked-assets
      {
            "tracker_id": "HH SM 4711", // ID of the Asset Tracker
            "id": "my-car",             // ID of the Asset
            "name": "My Car",           // Name of the Asset
            "type": "asset-tracker"     // ID of the Tracking Algorithm
        }

Key changes:

  • The metadata field is no longer required and will be automatically populated based on the id. This eliminates redundancy and simplifies the payload.

  • The field name external_id has been changed to tracker_id for consistency with other API endpoints, and make it clear that the endpoint is for tracking use-case.

Required Actions

If the changes affect endpoints that the API consumers are using any of these endpoints, they should be updated to reflect the new structures:

  • For the /api/v3/assets adjust your code to send a single object instead of an array.

  • For the /api/v3/things endpoint, migrate to the new POST /api/v3/tracked-assets endpoint and update your payload as needed.

Our dedicated support team is available to answer any questions and provide assistance during the migration process. Feel free to reach out to us.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.