Updated on 2022-02-24 GMT+08:00

Using Postman to Test IoT Platform APIs

Prerequisites

Before using this method, you need to:
  • Obtain the IP address and port number (HTTPS-compliant) provided by the IoT platform for applications.
  • Install and run Postman.
    NOTE:

    The Postman installation package is available at https://www.getpostman.com.

Configuring Postman

  1. Choose Settings.

    Figure 1 Choosing Settings

  2. Disable certificate verification so that Postman does not verify the server certificate.

    Figure 2 Disabling certificate verification

  3. Configure the client certificate. Specifically, enter the IP address and port number provided by the IoT platform for applications in the Host input box.

    Figure 3 Configuring the client certificate

NOTE:

client.crt and client.key are the client certificate and the private key file.

Debugging the Authentication API

  1. Configure the HTTP method, URL, and Headers of the authentication API.

    Figure 4 Configuring the HTTP method, URL, and Headers of the authentication API

  2. Configure Body of the authentication API.

    Figure 5 Configuring Body of the authentication API

  3. Click Send. The returned code and response are displayed in the lower part of the page.

    Keep the access token securely. It will be used when other APIs are called.

    Figure 6 Viewing the response of the Auth API

Debugging the API for Registering a Directly Connected Device

  1. Configure the HTTP method, URL, and Headers of the API for registering a directly connected device.

    Figure 7 Configuring the HTTP method, URL, and Headers of the API for registering a directly connected device

  2. Configure Body of the API for registering a directly connected device.

    Figure 8 Configuring Body of the API for registering a directly connected device

  3. Click Send. The returned code and response are displayed in the lower part of the page.

    Keep the returned device ID properly. It will be used when other APIs are called.

    Figure 9 Viewing the response of the API for registering a directly connected device