Using APIs in the IoT tool

You can access and run API calls directly from the documentation in theIoT tool.

About this task

IoT tool APIs include messaging APIs that you can use to send events from devices and application APIs. You can use the APIs to manage tasks, such as device management, action management, and risk management. For more information, see Messaging APIs and Application APIs.
Note: Your organization ID, which is also known as the workspaceId or the tenant ID, must be included in the hostname for all HTTP API calls.

Procedure

  1. To access the IoT tool API documentation, in the IoT tool, click the Help (?) icon and then click API.
  2. Click View APIs to open the API documentation.
  3. To run the API calls directly from the documentation, generate the IoT API key and token. You can generate multiple API keys, such as one per user.
    1. In the IoT tool, from the main menu, click Apps.
    2. Click Generate API Key.
    3. Specify a description and expiration and click Next.
    4. Depending on the API that you specify, select either the Device Application role or the Standard Application role. For more information about roles, see Using role-based access control.
    5. Note: Authentication tokens are not recoverable. To generate a new token, you need to register the API key again.
      Click Generate Key. Record the API key and token.
  4. Authorize the APIs. From the API documentation, click Authorize.
  5. In the Available authorizations dialog, specify the authentication information.
    1. In the Username field, specify the API key that you generated.
    2. In the Password field, specify the token that you generated.
  6. Click Authorize.
  7. Close the Available authorizations dialog. Do not click Logout.
  8. In the API documentation, for the API you are specifying, click Try it out.
  9. Click Execute.