EcoAdaptor v3 API
This API covers authentication, authorization and functional entry points to support cloud to cloud integration with other cloud services such as Amazon Echo (a.k.a. Alexa), IFTTT and others.
It covers an Oauth server as well as access to users and devices.
GET
/oauth2/authorize
Initiates the authorization flow by redirecting to the tenant login page. Once the user provides his credentials, it will open the “Accept terms” page. Once the user accepts the terms, it will generate the ‘code’, redirect the ‘code’ and move to the registered redirectUri
.
A client_id
will be provided by Arrayent in order to properly identify this client to a particular Arrayent environment. If a client needs to be authorized against multiple Arrayent environments, it will require one client_id
per environment.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
response_type |
query |
Value must be set to code |
Yes | String |
client_id |
query |
Client Id to identify the client that is making this request | Yes | String |
state |
query |
An opaque value used by the client to maintain state between the request and callback.The authorization server includes this value when redirecting the user-agent back to the client. The parameter SHOULD be used for preventing cross-site request forgery. | Yes | String |
Responses
Code | Description |
---|---|
302 |
Upon successful authorization, the request will be redirected to the redirect_uri configured with the client. |
POST
/oauth2/access_token
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
client_id |
body |
Client Id to identify the client that is making this request | Yes | String |
code |
body |
Code generated as a result of the authorization process | Yes | String |
client_secret |
body |
Confidential information of the client | Yes | String |
grant_type |
body |
Set to authorization_code for creating an access token. Set to refresh_token for refreshing an access token |
Yes | String |
Responses
Code | Description | Schema |
---|---|---|
200 |
Returns the generated access_token and refresh_token | { |
default |
Token generation failed | { |
POST
/oauth2/revoke_token
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
client_id |
body |
Client Id to identify the client that is making this request | Yes | String |
token |
body |
Token to be revoked | Yes | String |
client_secret |
body |
Confidential information of the client | Yes | String |
token_type_hint |
body |
Set to empty string (for future use) | Yes | String |
Responses
Code | Description | Schema |
---|---|---|
200 |
Token revocation succeeded | |
default |
Token revocation failed |
GET
/v3/users
Responses
Code | Description | Schema |
---|---|---|
200 |
OK | [ integer* ] |
default |
Error | { |
GET
/v3/users/{userId}
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
user_id |
path |
User identifier | Yes | String |
Responses
Code | Description | Schema |
---|---|---|
200 |
OK | { |
default |
Error | { |
GET
/v3/devices
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
deviceTypeName | path |
Specify the type of devices searched | No Valid – User Tokens. Yes – Enterprise Tokens |
String |
cursor | path |
next page hash (not needed for first call) | No Valid – User Tokens. No – Enterprise Tokens |
String |
Responses
Code | Description | Schema |
---|---|---|
200 |
OK | { |
default |
Error | { |
GET
/v3/devices/{deviceId}
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
deviceId |
path |
Device Identifier | Yes | String |
attribute |
query |
Device attribute name to fetch. Can provide multiple query parameters for list. If absent, response will contain all device attributes with values. | Yes | String(list) |
since |
query |
Get only attributes that were updated after a point in time with Unix epoch timestamp as the time value.
Note: |
Yes | integer(int64) |
Responses
Code | Description | Schema |
---|---|---|
200 |
Complete descriptive information about the device deviceName, presenceinfo, deviceId, deviceTypeName and a list of its attributes with their values and timestamps |
{ "presenceInfo": 1, "deviceId": 4000, "deviceTypeName": "DevKit_Sample_Application", "attributes": [ "online": { "value" :1 "updateTime": 1509954040347 }
]
}
|
default |
Error | { |
PUT
/v3/devices/{deviceId}
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
deviceId |
path |
Device Identifier | Yes | String |
body |
body |
Attribute name and value pair to be updated on the specified device | Yes |
|
Responses
Code | Description | Schema |
---|---|---|
200 |
OK | {"status": "OK" |
default |
Error | { |