Skip to content

[MKC-1613] Update Postman Section #2143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading