Skip to content

Commit

Permalink
Merge pull request #2143 from arduino/karlsoderby/postman-example-update
Browse files Browse the repository at this point in the history
[MKC-1613] Update Postman Section
  • Loading branch information
karlsoderby authored Sep 12, 2024
2 parents f7f5c30 + ccc8e03 commit d915623
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions content/arduino-cloud/07.api/02.arduino-iot-api/arduino-iot-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,28 @@ Before we can make requests to the API, we will need to generate an **access tok

![Authorization (step 1).](assets/postman-1.png)

Now, click on the **"Advanced Options"** tab, and add `https://api2.arduino.cc/iot` to the **"Audience"** field.
- Set **"Auth Type"** to **"OAuth 2.0"** with a **"Request Header"**
- Select **"Token Name"**, and **"Bearer"**

Then scroll down to the **"Configure New Token"**.

![Authorization (step 2).](assets/postman-2.png)

Finally, click on the **"Get New Access Token"**.
- Set **"Grant Type"** to **"Client Credentials"** and set `https://api2.arduino.cc/iot/v1/clients/token` for the **"Access Token URL"**.
- Add your Client ID & Client Secret (obtained in Arduino Cloud API Keys / Devices).
- Set the **"Client Authentication"** to **"Send client credentials in body"**.

Then, click on the **"Advanced"** tab, and populate the fields according to the image below:

![Authorization (step 3).](assets/postman-3.png)

- **Key** is set to `audience`
- **Value** is set to `https://api2.arduino.cc/iot`
- **Send In** is set to **Request Body**

Finally, click on the **"Get New Access Token"**. You should get a pop-up window. On success, it should look like this:

![Token button.](assets/access-token.png)
![Authentication complete.](assets/auth-complete.png)

You now have an access token that has an expiry of `300` seconds, and we can make requests to the API.

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d915623

Please sign in to comment.