0% found this document useful (0 votes)
85 views

Comap API v1.1 Usage Guide en

Uploaded by

esteban acosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

Comap API v1.1 Usage Guide en

Uploaded by

esteban acosta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Note: ComAp cloud API v 1.

1 are using the ComAp Cloud Identity and OAuth2 protocol for
authentication.
Please see. https://oauth.net/2/ for Oauth2 protocol documentation.
This Guide describes how to use APIS on developer portal. You can use API by your own apps
too in machine to machine mode of course.

Note: If you are switching to API v 1.1 from API v1 is recommended to switch in short period as
possible to avoid potential data loss. We recommend making one subaccount, where you can
all configure and test. Then simply move units and switch.

Guideline for ComAp API v1.1 usage

First, you must register the application and generate a secret. It’s a one-time action, just the
secret must be renewed before the end of the validation period.

Step 1
• Go to https://portal.websupervisor.net page.

Step 2,
• Sign up for a ComAp Cloud Identity (CCI).

Step 3
• Navigate to the API section

ComAp a.s., U Uranie 1612/14a, 170 00 Prague 7, Czech Republic

Registered in the Commercial register maintained by the Municipal Court in Prague, Section B, file 18788

www.comap-control.com
• Then to ComAp Cloud Identity API

Step 4
Register application

Navigate to the “Create application registration” POST method and use “Try it” button

If you are logged-in your Comap-Key Value are prefiled

“ComAp Cloud Identity” value choose “Implicit” value. In the pop up please fill your ComAp Cloud
Identity e-mail and login if you are prompted

Guideline for ComAp API v1.1


usage
2
Authorization value are filled automatically

Then click to “Sent”

You obtain “201” HTTP status code, you application was created.

Keep the “clientId” value for later usage.

Guideline for ComAp API v1.1


usage
3
Step 5 - optional

• Create secret

• Navigate to “Create application secret” POST method, and click on “Try it” button

• If you are logged in your Comap-Key Value are prefilled

• “ComAp Cloud Identity” value choose “Implicit” value. In the pop up please fill your ComAp Cloud
Identity e-mail and log in if you are prompted

• Authorization value are filled automatically

• Fulfill the JSON in the Request body section:

{
"clientId": < ---clientID from previous step--- >",
"secret": {
"displayName": "< ---your name of secret--- >",
"duration": "2y"
}

Guideline for ComAp API v1.1


usage
4
Then click on „Sent“ button

Guideline for ComAp API v1.1


usage
5
In the API response you obtain your secret. Maximum secret age period is 2 years

Keep “secret” value for later usage.

Step 6
• Obtain Bearer token

• Navigate to “Authenticate” GET method

• “Try it” button

• If you are logged in your Comap-Key Value are prefilled

• Fulfill the JSON in the Request body section:

{
"clientId": "< ---clientID from previous steps--- >",
"secret": "< ---secret from previous steps--- >"
}
• Then click to “Sent” button

Guideline for ComAp API v1.1


usage
6
Note: ComAp Cloud Identity value is not necessary to fill.

In the response you obtain JSON

{ "token_type": "Bearer", //Type of token

"expires_in": 3599, // expiration period default is 1 hour

"ext_expires_in": 3599, // expiration period default is 1 hour

"access_token": " ***************************************************************

*********************************************************************************
*********************************************************************************
*********************************************************************************
*************************************************************** " //Token value

Guideline for ComAp API v1.1


usage
7
}

Note: Now you have all to use API version 1.1 navigate to APIS –> v 1.1 Choose the method
which you like to use and fill “Authorization” by Bearer token in this format :
“Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ii1LSTNROW5OUjdiUm9m*****”

Guideline for ComAp API v1.1


usage
8

You might also like