Use the API Inspector

The API inspector is a tool within SmartWorks IoT that allows you to manually run HTTP requests to the SmartWorks API. In this section, the API inspector will be used to create a Thing according to the model schema that is assigned to it. Refer to this API Documentation for more information.

  1. Press the + in the bottom right corner of the SmartWorks IoT main page.
  2. Select API Inspector in the Utility Belt menu.

    Note: In the API inspector, you can select what HTTP request to run and provide the API endpoint. There are 4 tabs: Query, Headers, Auth, and Body.


    Figure 1.
  3. To create a new Thing, select POST option in the API Inspector.
  4. Enter the API endpoint as the following:
    /spaces/YOUR_SPACE_NAME/categories/YOUR_CATEGORY_NAME/things
  5. Provide the Model schema in the Body tab. For example:
    {
    "model":{
       "name":"user_model",
       "version": 1
        }
    }
    Note: Refer to Creating Things and Model Schemas on how to find Model schemas.
  6. Press Send to run the HTTP request through the API Inspector. If the command is successful, a Status code of 201 should appear with the Response as shown (sensitive details are omitted).


    Figure 2.
    When finished, a new Thing should be created inside your designated Space and Category. The API Inspector is useful for testing out interactions, experimenting with different commands, and understanding what information is stored inside the API.