Integrating 4D Scale REST API

For an overview of the 4D Scale APIs and entities, see 4D Scale APIs – Overview.

The REST API is hosted at the central api.4dscale.com domain. The automatically generated Swagger documentation and “playground” can be accessed at /swagger.

https://api.4dscale.comSwagger

A tool like swagger-codegen can be used to generate ready-to-use REST API client code in a variety of programming languages.

SSL/TLS is required.

Common scenarios

For common scenarios in 4D Scale integrations, and how to achieve them using REST API, please refer to the following articles:

Working with Accounts
Managing Devices in an account
Working with a Device

API Key & Authentication

For an overview of API keys and how to authenticate, see 4D Scale APIs – Overview.

Sending Requests

The body of an HTTP request (where applicable) is expected in JSON format.

Handling Responses

When returned, the body of an HTTP response is encoded in JSON format.

Common HTTP response codes include:

  • 200 OK – GET requests will always return a body. PATCH and DELETE endpoints may not return body. Consult with the Swagger documentation.
  • 400 Bad Request – Invalid structure of the request. likely caused by missing required query parameters or JSON body key. Consult with the Swagger documentation.
  • 401 Unathorized – Missing or invalid API key in Authorization header.
  • 404 Not Found – Requested entity not found in the context of the authenticated account.
  • 409 Conflict – Valid structure of the request but inapplicable in the given context.
  • 5XX Internal Server Error – Unhandled error on server side. Response body will contain more information about the exception encountered.

Was this article helpful?

Related Articles