Developer Account
You will need to have a developer account and get developer credentials to authenticate your integration on iZone.
To get a developer credential key, login developer account and your developer credential should display.
This is the multi-page printable view of this section. Click here to print.
You will need to have a developer account and get developer credentials to authenticate your integration on iZone.
To get a developer credential key, login developer account and your developer credential should display.
iZone Cloud API uses OAuth access token to authorize user access.
At some stage, you have to send user to iZone worldwide login service with your developer key and parameters.
Authorization Endpoint: https://worldwide.izone.com.au/login
The request uses GET
method, with parameters:
Query Parameter | |
---|---|
client_id | Your developer key |
scope | Use query-control |
state | A value you can used to track the session in redirect callback |
response_type | Use code for authorization code |
redirect_uri | Encoded URL matching for your developer account |
The login service asks the user to authorize your integration to use their iZone system. The user authenticates with login their worldwide account. iZone sends an authorization code back to your integration.
Once you get an authorization code, use it to get an access token and refresh token.
Token Endpoint: https://worldwide.izone.com.au/token
The request uses POST
method, with parameters:
Query Parameter | |
---|---|
client_id | Your developer key |
grant_type | Use authorization_code |
code | The authorization code received previously |
If request format and parameters are all good, the response would be HTTP 200 OK
, with payload like this:
{
"access_token": "c3cda13u-393a-c832-112-946106e5bbab",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "c3cda13u-393a-c832-112-946106e5bbab",
"scope": "query-control"
}
The access token is required in every iZone Cloud API call. According to different types of iZone Cloud APIs:
Authorization: Bearer access-token
HTTPS Request.
POST https://api.izone.com.au/dev
Request Body JSON:
Key | Type | Description |
---|---|---|
requestId | string | A UUID string to identify request session |
requestType | string | Must be Discover |
An example of response would be like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"requestType": "Discover",
"response": {
"userID":string_userID,
"devices":[
{
"componentId":"123456798_izone_systemsettings_0",
"datagram":{
"SysOn":1,
"SysMode":2,
"SysFan":3,
...
}
},
...]
}
Response contains requesting user’s string_userID
and an array of all componentId
s and their latest datagram.
Individual device states can be queried through Query.
Refer to Reference the detail datagram of different types of iZone components.
HTTPS Request.
POST https://api.izone.com.au/dev
Request Body JSON:
Key | Type | Description |
---|---|---|
requestId | string | A UUID string to identify request session |
requestType | string | Must be Query |
componentId | string | A componentId to identify an iZone component |
An example of response would be like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"requestType": "Query",
"response": {
"component":{
"componentId":"123456798_izone_systemsettings_0",
"datagram":{
"SysOn":1,
"SysMode":2,
"SysFan":3,
...
}
}
}
}
Where response is componentId:componentDatagram
Refer to Reference the detail datagram of different types of iZone components.
HTTPS Request.
POST https://api.izone.com.au/dev
Request Body JSON:
Key | Type | Description |
---|---|---|
requestId | string | A UUID string to identify request session |
requestType | string | Must be Control |
componentId | string | A componentId to identify an iZone component |
requestBody | json | A JSON control command body |
An example of request body would like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"componentId": "123456798_izone_systemsettings_0",
"requestType": "Control",
"requestBody": {
json_controlCommand
}
}
where json_controlCommand is the one of control commands with target value.
An expected response would be like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"componentId": "123456798_izone_systemsettings_0",
"requestType": "Control",
"response": {
"result":"OK"
}
}
Refer to Reference the detail control actions dictionary of different types of iZone device control.
iZone Cloud provides event report service, which can notify your event API when iZone device states changed or user deleted their account.
Please talk to Smart Alec about details of your event API.
Sync Request Body JSON Format:
Key | Type | Description |
---|---|---|
requestId | string | A UUID string to identify request session |
requestType | string | Must be Sync |
userId | string | A userId to identify an iZone worldwide user |
An example of requesting re-discover/refresh would like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"userId": string_userID,
"requestType": "Sync",
}
This request notifies user string_userID
’s account condition has changed. To re-discover the user’s devices of userID.
Event Report Body JSON Format:
Key | Type | Description |
---|---|---|
requestId | string | A UUID string to identify request session |
requestType | string | Must be Event |
requestBody | json | A JSON datagram contains one or multiple devices datagram |
An example of device event update would like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"requestType": "Event",
"requestBody": {
"devices":[
{
"componentId":"123456798_izone_systemsettings_0",
"datagram":{
"SysOn":1,
"SysMode":2,
"SysFan":3,
...
}
},
...
]
}
}
where json_datagram is the one of iZone device datagram.
Refer to Reference the detail control actions dictionary of different types of iZone device control.
iZone Cloud would return message after API actions are called.
An example of result would be like:
{
"requestId": "28d45cb2-ff5a-4d58-a4c8-efb751ded699",
"response": {
"result":message_string
}
}
where message_string contains OK or error messages.