This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Cloud integration

Use iZone’s Cloud API to integrate with an iZone system.

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.

1 - Authorization

Get access token for calling iZone Cloud API.

iZone Cloud API uses OAuth access token to authorize user access.

Get authorization code

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.

Get access token

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"
}

Use Access Token

The access token is required in every iZone Cloud API call. According to different types of iZone Cloud APIs:

  • HTTPS API
    • Use “Bearer” authentication in headers. Authorization: Bearer access-token
  • gRPC API
    • Use “accessToken” in gPRC proto.

2 - Discovery

Make requests to discover user’s iZone devices.

Discover Device Command

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 componentIds and their latest datagram.

Individual device states can be queried through Query.

Refer to Reference the detail datagram of different types of iZone components.

3 - Query

Make requests to query iZone device states.

Query Device States Command

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.

4 - Control

Make requests to control iZone device.

Control Device Command

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.

5 - Event Report

Get notified when device states changed.

Event Report API

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.

6 - Result

Get result.

Result Messages

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.