![Daikin Airzone Скачать руководство пользователя страница 9](http://html1.mh-extra.com/html/daikin/airzone/airzone_api-integration-manual_502360009.webp)
API Integration Manual for Daikin DKN Cloud Wi-Fi Adaptor
8
-
REQUEST:
-
POST
https://www.dkncloudna.com/api/v1/users/oauth2/authorize
-
HEADERS:
o
Accept: application/json
o
Content-Type: application/json
o
Authorization: Bearer
TOKEN_VALUE
-
The value in the Authorization header is the value of the
token
response property of the
Login response.
-
BODY: JSON body parameters:
o
entityName
: (String) name of the third party entity, as registered when its credentials were
issued.
o
client_id
: (String) value of the
client_id
token issued for the entity
o
scopes
: (String[]) scopes to authorize. Currently this property must equal to an array of two
String elements =>
devices, installations
-
EXAMPLE:
curl --location –request POST "https://www.dkncloudna.com/api/v1/users/oauth2/authorize?" \
--header "Content-Type: application/json" \
--data "{\"entityName\": \"ENTITY_NAME\", \"client_id\": \"CLIENT_ID\", \"scopes\": [\"devices\",
\"installations\"]}"
-
RESPONSE: This returns a JSON object, with only one property:
redirectUri.
The value of this
property will be one of the registered redirect URLs of the entity plus the
code
parameter (same
format as described in the Web interface process).
Example response:
{
" redirectUri": "https://example.com/?code=9zHBr2TwEkUanHTlLGvs5EjCPOvdBAHF "
}
The remaining requests are common for both interfaces.
Step 4: Application Requests Access Token.
The value of
code
is used by the third party to ask
DKN Cloud NA for the first access token on behalf of the user. This is a one time use, short lived
token, so it must be used immediately after being received. This code is used in the following
request:
-
REQUEST:
-
POST
https://www.dkncloudna.com/api/v1/open/oauth2/token
-
HEADERS:
o
Content-Type: application/x-
ẃww-form-urlencoded
o
Accept: application/json
-
BODY: application/x-www-form-urlencoded type body parameters:
o
grant_type
: (String) its value must be "
authorization_code
".
o
client_id
: (String) value of the
client_id
token issued for the entity.
o
client_secret
: (String) value of the
client_secret
token issued for the entity.
o
code
: (String) value of the
code
parameter acquired in the previous request.
-
EXAMPLE: