Skip to content

Postman Setup for Cassia RESTful API

kevin-cassia edited this page Dec 16, 2019 · 21 revisions

Setting Up Postman for AC-Managed Cassia RESTful API

Download Postman

https://www.getpostman.com/downloads

For this guide, we are using: Postman Version 7.13.0

Postman Initial Setup

Once Postman is finished installing, open the application. A screen asking to create an account or sign in will appear. (It is optional to sign in or not.)

Postman Initial Screen


This is an example of a plain Postman workspace after you open the application for the first time:

Plain Postman Workspace

Request a Cassia AC RESTful API Access Token

At the top-left corner, there should be a "New" button. Click on it and click on "Request".

New Request Button


A pop-up window may ask for you to save this request into a collection. Create a collection and save the request into it.

This is an example of saving a Postman request into a collection called "Authorization":

Save Request into Authorization Collection


A new tab should appear in the workspace. Change the default "GET" request type to "POST".

Request Type from GET to POST


Then, fill in the settings like in the following screenshots:

p6

p7

p8


In Postman, use Basic Auth to get an OAuth 2.0 bearer token.

This will set the HTTP Authorization header.

Just enter the Developer Key and Secret in the Postman Basic Auth fields.

p9


Setting the Authorization header manually is also fine.

To do this, use a base64 encoding tool to generate an encoding based on the the Developer Key and Secret (key:secret).

Here is an example Python script to generate the base64 encoding for Basic Auth:

import base64

id_secret = 'tester:10b83f9a2e823c47'
encoded_id_secret = base64.b64encode(id_secret.encode())

print(encoded_id_secret.decode())

p10


Now, set the rest of the settings like the following screenshots:

p11

p12

p13

p14

p15


Alternatively, you can set the Authorization header like so to access the AC RESTful API:

p16



Setting Up Postman for Standalone (Local) Cassia RESTful API

This section is coming soon...

Home

Overview
Getting Started
RESTful API
Advanced RESTful API
MQTT API (Beta Version)

Error Messages

Device Integrating

Sample Code

Misc
Clone this wiki locally