Insights Hub Using Node.js to access Insights Hub APIs

2023-08-21T11:44:15Z
Developer Tools

Summary


Details

You are creating custom node to access Insights Hub Services via API and receive an error "Bad status code 403. Body:"

Solution

4xx series HTTP status codes usually indicate an issue client side like authentication. However, malformed requests can also cause this error code, especially when attempting to access the API.

Insights Hub adheres to API request URL validations. Therefore, check to make sure your requests are well-formed. An example of malformed request:

GET https://gateway.{region}.{mindsphere-domain}/api/iottsaggregates/v3/aggregates/{assetId}/{aspectName}/

An example of well-formed request:

GET https://gateway.{region}.{mindsphere-domain}/api/iottsaggregates/v3/aggregates/{assetId}/{aspectName}

The difference between the malformed and the well-formed request is the / at the end which is not included in the well-formed request.

Visit our developer documentation for more examples of well-formed requests and all published Insights Hub APIs: https://developer.mindsphere.io/apis/index.html

Notes

Notes

KB Article ID# PL8547994

Contents

SummaryDetails

Associated Components

Node.js SDK