User Guides for API Library of Globiots

MN-API-EN

03/18/2020

 

 

globiots_api_en.png

 

 

1. Functions Change Log

Release Date Version Functions Change Name Account Change
06/30/2015
1.0
Initiating Documents

thanhthi.tran@daviteq.com

07/14/2015 1.1

Adjust some fields in JSON string to match conversion.

Adjust response of alarm configuration.

Fix bugs.

Change URL of service api-data-log-001.

Supplement response code for each service.

thanhthi.tran@daviteq.com

07/21/2015 1.2

Supplement service to collect the closest value from all the addresses with the same hostname.

thanhthi.tran@daviteq.com

08/05/2015 1.3

Adjust service response related to alarm, event. Removed not used service: api-event-log-001, api-event-log-002, api-event-log-003.

Rename some field title in response JSON.

thanhthi.tran@daviteq.com

08/07/2015 1.4

Supplement service: api-data-log-002 (to collect logged data from different addresses).

thanhthi.tran@daviteq.com

10/24/2016 1.5

Supplement and adjust services to match naming conversion in RESTful.

thanhthi.tran@daviteq.com

08/02/2019 1.6

Supplement Basic Authentication method.

Adjust APIs related to logged data collection.

Supplement API to collect final data daily.

thanhthi.tran@daviteq.com

11/28/2019 1.7

Add some notes for convenience in calling API

trungtin.nguyen@daviteq.com

2. Introduction

2.1 Abstract

This document shows the detailed functions of API Serve which are used to served Daviteq’s partners’ projects and can be used as a reference.

2.2 Purpose

This document provides clients and users with a needed guide to connect and transfer data through API Server.

2.3 Object

Technical staffs and authorized partners of DAI VIET CONTROLS & INSTRUMENTATION COMPANY LTD is granted access to this document.

2.4 Terminologies And Definition
TERMINOLOGY DEFINITION
API Application Programming Interface
RSA Rivest-Shamir-Adleman – data encryption algorithm
GLOBIOTS Global Internet Of Things
IP

Internet Protocol

3. Initiate And Connect

Two methods of initiating the connection to Globiots Public API: Basic Authentication Header or Authentication header (designed by Daviteq).

3.1 Basic Authentication Header

The user will be provided a username and password by Daviteq.

    • Username: unique key on API SERVER, considered as ID for each Account.
    • Password: secret key on API SERVER, considered as the password for each Account.

In addition, the user can get these values ​​by himself using API number 1 (Login authentication)

    • Username: appKey field in the account section
    • Password: secretKey field in the account section

image-1584502803992.png

3.2 Authentication header (designed by Daviteq)

The user will be provided API_KEY, SECRET_KEY, PUBLIC.key by Daviteq.

    • API_KEY: unique key on API SERVER, considered as ID for each Account.
    • SERECT_KEY: secret key on API SERVER, considered as the password for each Account.
    • PUBLIC.key: public key in RSA algorithm.

SECRET_KEY will be encrypted by RSA algorithm with PUBLIC.key

Encoded Base64 for SECRET_KEY string (encrypted)

Add api-key, secret-key in header before request to server:

    • api-key: value of API_KEY
    • secret-key: value of SECRET_KEY (encrypted and encoded)

You can use  Advanced REST client (chrome plugin) to check Authentication Header 

Step 1: set parameters (URL, request method)

image-1584503570782.png

Step 2: Set header with api-key and secret-key

image-1584503739410.png

Step 3: Check request headers

image-1584504595568.png

Step 4: Check response data

image-1584505107541.png

3.3 Sample Code (By JAVA)

AuthenticationHeader.java

public class AuthenticationHeader {

    public static final String RSA_PUBLIC_KEY_PATH = "path/to/PUBLIC.key";
    
    public static void main(String[] args) {
    	try {
            String apiKey = "your_api_key";
            String secretKey = "your_secret_key";
            
            RestTemplateUtilWithAuthentication restTemplate = new RestTemplateUtilWithAuthentication(
                    apiKey, secretKey, RSA_PUBLIC_KEY_PATH);
            String url = "http://[hostname]:[port]/rest/api/v1/devices";
            String value = restTemplate.doGetWithAuthentication(url);
            System.out.println("Response: " + value);
        } catch(Exception ex) {
            ex.printStackTrace();
        }
    }
}

RestTemplateUtilWithAuthentication.java

import java.nio.charset.Charset;

import java.util.HashMap;

import java.util.Map;

import org.springframework.http.HttpEntity;

import org.springframework.http.HttpHeaders;

import org.springframework.http.HttpMethod;

import org.springframework.http.MediaType;

import org.springframework.http.ResponseEntity;

import org.springframework.web.client.RestTemplate;

import com.daviteq.secure.Base64;

import com.daviteq.secure.RSA;


public class RestTemplateUtilWithAuthentication {

 private String apiKey;

 private String secretKey;

 private String publicKeyPath;



 public RestTemplateUtilWithAuthentication(

  String apiKey,

  String secretKey,

  String publicKeyPath) {

  this.apiKey = apiKey;

  this.secretKey = secretKey;

  this.publicKeyPath = publicKeyPath;

 }

 public String doGetWithAuthentication(

  String url) {

  RestTemplate restTemplate = new RestTemplate();

  Map < String, String > signature = this.getSignature();

  HttpHeaders headers = this.getHeadersForAuthentication(signature);

  HttpEntity httpEntity = new HttpEntity(headers);

  ResponseEntity < String > out = restTemplate.exchange(

   url, HttpMethod.GET, httpEntity, String.class);

  return out.getBody();

 }

 private HttpHeaders getHeadersForAuthentication(

  Map < String, String > signature) {

  HttpHeaders headers = new HttpHeaders();

  MediaType mediaType = new MediaType(

   "text", "plain", Charset.forName("UTF-8"));

  headers.setContentType(mediaType);

  for (Map.Entry < String, String > entry: signature.entrySet()) {

   String key = entry.getKey();

   String value = entry.getValue();

   headers.add(key, value);

  }

  return headers;

 }

 private Map < String, String > getSignature() {

  Map < String, String > signature = new HashMap < String, String > ();

  try {

   String encodedSecretKey = Base64.encode(

    RSA.encrypt(secretKey, publicKeyPath).getBytes());

   signature.put("api-key", apiKey);

   signature.put("secret-key", encodedSecretKey);

  } catch (Exception ex) {

   ex.printStackTrace();

  }

  return signature;

 }

 public String getApiKey() {

  return apiKey;

 }

 public void setApiKey(String apiKey) {

  this.apiKey = apiKey;

 }

 public String getSecretKey() {

  return secretKey;

 }

 public void setSecretKey(String secretKey) {

  this.secretKey = secretKey;

 }
}

4. Services Description

4.1 Authenticate login & get string ACCESS_TOKEN

4.1.1 Login authentication

No.

 

Title

 

URL

https://authorization.globiots.com/rest/api/v1/login/usernameOrEmail/{usernameOrEmail}/password/{encryptedPassword}

Method

POST

URL Params

usernameOrEmail: username login

encryptedPassword: password according to the rules

md5hash(usernameOrEmail + password).toUpperCase()

Data Params

{

            "responseMessage": "Success",

            "responseCode": 200,

            "account": {

                        "id": "account-2d4ded58-f099-4989-8ad3-70a223ff23a9",

                        "name": "DEMO OFFICE",

                        "address": "XCVV",

                        "country": "VN",

                        "province": "AN_GIANG",

                        "postalCode": "6666",

                        "faxNumber": "",

                        "emailAddress": "sales.pm.41@daviteq.com",

                        "createdDate": 1473925903589,

                        "lastUpdated": 1488794486739,

                        "expiredDate": null,

                        "status": "ACT",

                        "timeZone": "GMT+07:00",

                        "timeZoneName": "GMT+07:00",

                        "firstDayOfWeek": "MONDAY",

                        "beginTimeOfDay": "06:00",

                        "dateFormat": "dd/MM/yyyy",

                        "timeFormat": "HH:mm:ss",

                        "keepAliveTime": 300,

                        "realtimeRefreshTime": 1,

                        "deviceUsed": 6,

                        "userUsed": 10,

                        "parentId": "account-e4f64944-e638-4251-bf30-e85a1b5fef22",

                        "packageId": "package-a49d499f-8bf9-4aa4-baae-0ba653c2ca6f",

                        "nextHostname": "0.0.0.60",

                        "isActivedEmailAddress": false,

                        "appKey": "app-key-420ec00f-fd0b-41f0-ab6d-45ab8df45e2f",

                        "secretKey": "secret-key-5df9c18a-76b9-4214-b454-c49db4274b1c"

            },

            "user": {

                        "id": "user-7266966c-77b3-4e22-bb63-39e6232d26f0",

                        "fullName": "DEMO OFFICE",

                        "dateOfBirth": 884649600000,

                        "gender": "male",

                        "contactNumber": "+846502270",

                        "language": "en",

                        "username": "demooffice",

                        "password": "7BFCE32BE0CD842AA06E16DAB94C6D0B",

                        "failSignInAttempt": 0,

                        "emailAddress": "sales.pm.41@gmail.com",

                        "lastUpdated": 1513837330925,

                        "lastSignedIn": 1522054238414,

                        "createdDate": 1473925903610,

                        "isPasswordExpired": null,

                        "isActivedEmailAddress": true,

                        "lastChangedPassword": 1489029201446,

                        "isChangePassword": false,

                        "isActivedContactNumber": false,

                        "isAdministrator": true,

                        "status": "ACT",

                        "accountId": "account-2d4ded58-f099-4989-8ad3-70a223ff23a9"

            }

}

responseCode: return code of the transaction

responseMessage: return message (explanation for response_code)

  user: Data of parameter, if response_code is 200 (Success)

    + fullname: dashboard name

    + dateOfBirth:

    + gender:

    + contactNumber:

    + countryCode:

     + language:

     + username:

     + password:.

     + failSignInAttempt: login failed

     + recoverPasswordAttempt: .

     + emailAddress:

     + lastUpdated:

     + lastSignedIn:

     + createdDate: account creation date

     + isActivedEmailAddress: email exists or not.

     + lastChangedPassword:

     + isChangePassword: true or false if true means the new user created the first login.

     + isActivedContactNumber: true or false / the phone number exist or not

     + isAdministrator: true or false / is the user admin or not

     + status: ACT is active LOC is locked

     + accountId: The id account to which the user belongs

  account: account data, if response_code is 200 (Success)

    + id:

    + name:

    + address:

    + country:

    + province.

     + postalCode:.

     + faxNumber:

     + emailAddress:

     + createdDate:

     + lastUpdated:

     + expiredDate:.

     + status: ACT is active LOC is locked

     + timeZone: .

     + timeZoneName:.

     + firstDayOfWeek: start date of the week (for report)

     + beginTimeOfDay: start time of the day (used for report)

     + dateFormat:

     + timeFormat:

     + keepAliveTime:

     + realtimeRefreshTime:

     + deviceUsed: number of used equipment.

     + userUsed: number of users used

     + emailUsedInMonth:

 

Response code

200 : Success

500 : error

409  :  data not found

408  :  time out

Sample call

https://authorization.globiots.com/rest/api/v1/login/usernameOrEmail/demooffice/password/7BFCE32BE0CD842AA06E16DAB94C6D0B

Notes

Pages that take md5hash online:

http://www.md5online.org/md5-encrypt.html

http://www.md5.cz/

 

 

Data types for dates formatted according to Epoch time, refer to the address:

http://www.epochconverter.com/epoch/clock.php

4.1.2 Get access token

No.

 

Title

 

URL

https://authorization.globiots.com/oauth/token?grant_type={grant_type}&username={username}&password={password}&client_id={client_id}&client_secret={client_secret}&scope={scope}

Method

POST

URL Params

username:

password: md5hash(usernameOrEmail + password).toUpperCase()

client_id: In acount, get appKey property

client_seret: In acount, get setretKey property

grant_type: password

scope: read

Data Params

{

            "access_token": "a9b457ca-555e-4317-8ab7-618829b6bca4",

            "token_type": "bearer",

            "refresh_token": "1a9c0025-ad18-4b73-94e8-e3b610a6600f",

            "expires_in": 1208122,

            "scope": "read"

}

 

Notes :

   + access_token: Resources API authentication string

   + token_type:

   + refresh_token: The string used to refresh access token

   + expires_in: access token chain expiry time in milisecond

   + scope:

Response code

{

   "error": "unauthorized",

   "error_description": "Bad credentials"

}

Sample call

https://authorization.globiots.com/oauth/token?grant_type=password&username=demooffice&password=7BFCE32BE0CD842AA06E16DAB94C6D0B&client_id=app-key-420ec00f-fd0b-41f0-ab6d-45ab8df45e2f&client_secret=secret-key-5df9c18a-76b9-4214-b454-c49db4274b1c&scope=read

Notes

 

4.1.3 Refresh access token

No.

 

Title

 

URL

https://authorization.globiots.com/oauth/token?grant_type={grant_type}client_id={client_id}&client_secret={client_secret}&scope={scope}&refresh_token={refresh_token}

Method

POST

URL Params

client_id: In acount, get appKey property

client_seret: In acount, get setretKey property

grant_type: refresh_token

scope: read

refresh_token: The token refresh sequence returns when retrieving the access token

Data Params

{

            "access_token": "f6bf1b14-7c9c-41e6-a51e-9d2b37a5e5ad",

            "token_type": "bearer",

            "refresh_token": "1a9c0025-ad18-4b73-94e8-e3b610a6600f",

            "expires_in": 1209599,

            "scope": "read"

}

 

Notes :

   + access_token: Resources API authentication string

   + token_type:

   + refresh_token: The string used to refresh access token

   + expires_in: access token chain expiry time in milisecond

   + scope:

Response code

{

   "error": "unauthorized",

   "error_description": "Bad credentials"

}

Sample call

https://authorization.globiots.com/oauth/token?grant_type=refresh_token&client_id=app-key-420ec00f-fd0b-41f0-ab6d-45ab8df45e2f&client_secret=secret-key-5df9c18a-76b9-4214-b454-c49db4274b1c&scope=read&refresh_token=1a9c0025-ad18-4b73-94e8-e3b610a6600f

Notes

 

4.2 Account Management

4.2.1 Get account information by account id

No.

 

Title

 

URL

https://resources.globiots.com/rest/api/authenticated/vizou/mobile/v1/accounts/account-id/{accountId}?access_token={accessToken}

Method

GET

URL Params

accountId: id field in account

accessToken: authentication string to call to the API server

Data Params

{

            "responseMessage": "Success",

            "responseCode": 200,

            "account": {

                        "id": "account-b48dc757-802a-4074-b109-cbbd4fd191f9",

                        "name": "Test",

                        "address": "10",

                        "country": "VN",

                        "province": "HCM",

                        "postalCode": "",

                        "faxNumber": "",

                        "emailAddress": "asjsh@gmail.com",

                        "createdDate": 1502940270714,

                        "lastUpdated": 1502940270714,

                        "expiredDate": null,

                        "status": "ACT",

                        "timeZone": "GMT+07:00",

                        "timeZoneName": "GMT+07:00",

                        "firstDayOfWeek": "SUNDAY",

                        "beginTimeOfDay": "00:00",

                        "dateFormat": "dd/MM/yyyy",

                        "timeFormat": "HH:mm:ss",

                        "keepAliveTime": 300,

                        "realtimeRefreshTime": 1,

                        "deviceUsed": 4,

                        "userUsed": 1,

                        "emailUsedInMonth": 0,

                        "smsUsedInMonth": 0,

                        "accountUsed": 0,

                        "parentId": "account-c5557011-2f6a-4327-80a1-732287d1ca7e",

                        "packageId": "package-2a3a9fca-e9fc-471d-9fc1-c906d6f93b25",

                        "nextHostname": "0.0.1.5",

                        "isActivedEmailAddress": false,

                        "appKey": "app-key-91a6cac2-7c1a-46ce-aba5-c5bc6e67e02b",

                        "secretKey": "secret-key-bdb04f28-ab71-4509-918b-96bd133dc140"

            }

}

responseCode: return code of the transaction

responseMessage: return message (explanation for response_code)

  account: account data, if response_code is 200 (Success)

    + id:

    + name: tên

    + address: địa chỉ

    + country: mã quốc gia

    + province: mã tỉnh.

     + postalCode:.

     + faxNumber:

     + emailAddress: địa chỉ email.

     + createdDate: ngày tạo.

     + lastUpdated: ngày cập nhật gần nhất.

     + expiredDate:.

     + status: ACT là active LOC là locked

     + timeZone: .

     + timeZoneName:.

     + firstDayOfWeek: start date of the week (for report)

     + beginTimeOfDay: start time of the day (used for report)

     + dateFormat:

     + timeFormat:

     + keepAliveTime:

     + realtimeRefreshTime:

     + deviceUsed: number of used equipment.

     + userUsed: number of users used

     + emailUsedInMonth:

Response code

200 : Success

500 : error

409  :  data not found

408  :  time out

 

Invalid access token :

{

                "error": "invalid_token",

                "error_description": "Invalid access token: eb85cd6f-9975-457f-b3f9-067cc52958ef"

}

Sample call

 

Notes

Data types for dates formatted according to Epoch time, refer to the address: http://www.epochconverter.com/epoch/clock.php

4.2.2 Get account information by email

No.

 

Title

 

URL

https://resources.globiots.com/rest/api/authenticated/vizou/mobile/v1/accounts/email/{email}/?access_token={accessToken}

Method

GET

URL Params

email:

accessToken: authentication string to call to the API server

Data Params

{

            "responseMessage": "Success",

            "responseCode": 200,

            "account": {

                        "id": "account-b48dc757-802a-4074-b109-cbbd4fd191f9",

                        "name": "Test",

                        "address": "10",

                        "country": "VN",

                        "province": "HCM",

                        "postalCode": "",

                        "faxNumber": "",

                        "emailAddress": "asjsh@gmail.com",

                        "createdDate": 1502940270714,

                        "lastUpdated": 1502940270714,

                        "expiredDate": null,

                        "status": "ACT",

                        "timeZone": "GMT+07:00",

                        "timeZoneName": "GMT+07:00",

                        "firstDayOfWeek": "SUNDAY",

                        "beginTimeOfDay": "00:00",

                        "dateFormat": "dd/MM/yyyy",

                        "timeFormat": "HH:mm:ss",

                        "keepAliveTime": 300,

                        "realtimeRefreshTime": 1,

                        "deviceUsed": 4,

                        "userUsed": 1,

                        "emailUsedInMonth": 0,

                        "smsUsedInMonth": 0,

                        "accountUsed": 0,

                        "parentId": "account-c5557011-2f6a-4327-80a1-732287d1ca7e",

                        "packageId": "package-2a3a9fca-e9fc-471d-9fc1-c906d6f93b25",

                        "nextHostname": "0.0.1.5",

                        "isActivedEmailAddress": false,

                        "appKey": "app-key-91a6cac2-7c1a-46ce-aba5-c5bc6e67e02b",

                        "secretKey": "secret-key-bdb04f28-ab71-4509-918b-96bd133dc140"

            }

}

responseCode: return code of the transaction

responseMessage: return message (explanation for response_code)

  account: account data, if response_code is 200 (Success)

    + id:

    + name:

    + address:

    + country:

    + province:

     + postalCode:.

     + faxNumber:

     + emailAddress:

     + createdDate:

     + lastUpdated:.

     + expiredDate:.

     + status: ACT is active LOC is locked

     + timeZone: .

     + timeZoneName:.

     + firstDayOfWeek: start date of the week (for report)

     + beginTimeOfDay: start time of the day (used for report)

     + dateFormat:

     + timeFormat:

     + keepAliveTime:

     + realtimeRefreshTime:

     + deviceUsed: number of used equipment.

     + userUsed: number of users used

     + emailUsedInMonth:

Response code

200 : Success

500 : error

409  :  data not found

408  :  time out

 

Invalid access token :

{

                "error": "invalid_token",

                "error_description": "Invalid access token: eb85cd6f-9975-457f-b3f9-067cc52958ef"

}

 

Sample call

 

Notes

Data types for dates formatted according to Epoch time, refer to the address:

http://www.epochconverter.com/epoch/clock.php

4.2.3 Update Account

No.

 

Title

 

URL

https://resources.globiots.com/rest/api/authenticated/vizou/mobile/v1/accounts/{accountId}?access_token={accessToken}

Method

PUT

URL Params

accountId: id field in user

accessToken: authentication string to call to the API server

Request body(

seach key: restful post request body)

{

          "address": "So 11 Duong 2G, Binh Tan TPHCM",

          "last_updated": "1522047777981",

          "postal_code": "1234565431",

          "keep_alive_time": "1800",

          "province": "AN_GIANG",

          "timezone_name": "Asia/Ho_Chi_Minh",

          "first_day_of_week": "MONDAY",

          "fax_number": "2345617676",

          "realtime_refresh_time": "15",

          "time_format": "HH:mm:ss:SSS",

          "country": "VN",

          "time_zone": "GMT+07:00",

          "begin_time_of_day": "00:00",

          "email_address": "support@daviteq.com",

          "name": "Super Admin Daviteq",

          "date_format": "dd/MM/yyyy"

}

Notes:

  The json type of account properties is not the object object of the account

It's type <Key, value>  JAVA code Example:

account => The object account needs updating;Map<String, Object> cols = new HashMap<>();
cols.put("address", account.getAddress());
cols.put("last_updated", account.getLastUpdate ());
cols.put("postal_code", account.getPostalCode ());
cols.put("keep_alive_time", account.getKeepAliveTime());
cols.put("province", account.getProvince()));cols.put("timezone_name", account.getTimeZonename()));cols.put("first_day_of_week", account.getFirstDayOfWeek ()));cols.put("fax_number", account.getFaxNumber()));cols.put("realtime_refresh_time", account.getRealtimeRefreshTime()));cols.put("time_format", account.getTimeFormat()));cols.put("country", account.getCountry ()));cols.put("time_zone", account.getTimeZone()));cols.put("begin_time_of_day", account.getBeginTimeOfDay()));cols.put("email_address", account.getEmailAddress()));cols.put("first_day_of_week", account.getFirstDayOfWeek()));cols.put("name", account.getName()));cols.put("date_format", account.getDateFormat()));

 

DATA REQUEST => toJson(cols)

Data Params

{

            "responseMessage": "Success",

            "responseCode": 200

}

responseCode: return code of the transaction

responseMessage: return message (explanation for response_code)

Response code

200 : Success

500 : error

409  :  data not found

408  :  time out

Invalid access token :

{

                "error": "invalid_token",

                "error_description": "Invalid access token: eb85cd6f-9975-457f-b3f9-067cc52958ef"

}

 

Sample call

 

Notes

 

4.3 Devices Management

4.3.1 Retrieve all devices

No.

 

Title

 

URL

/rest/api/public/v2/devices

Method

GET

URL Params

{

    "responseMessage": "",

    "responseCode": ,

    "count": ,

    "devices": [

        {

            "id": "",

            "deviceName": "",

            "serialNumber": "",

            "hostName": "",

            "ncc": "",

            "fcc": "",

            "latitude": "",

            "longitude": "",

            "phoneNumber": "",

            "loggingSendFrequency": ,

            "healthSendFrequency": ,

            "isLoggingChanged": ,

            "isModbusConfigChanged": ,

            "isAlarmConfigChanged": ,

            "isEventConfigChanged": ,

            "createdDate": ,

            "lastUpdated": ,

            "attachedDate": ,

            "lastSignedIn": ,

            "status": "",

            "nodeId": "",

            "memmapId": "",

            "model": "",

            "manufactureDate": "",

            "hardwareVersion": "",

            "firmwareVersion": "",

            "memmapVersion": "",

            "imei": "",

            "cellularNetwork": "",

            "iccid": ""

        }

    ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of device.

devices: if response_code is 200 (Success), the data of devices will be an array type.

    + id: identification

    + deviceName: device name

    + serialNumber: serial number

    + hostname: IP address of device on Globiots system.

    + ncc: ncc of device on Globiots system.

    + fcc: fcc of device on Globiots system.

    + latitude:  latitude of iConnector.

    + longitude:  longitude of iConnector.

    + phoneNumber: phone number of SIM.

    + loggingSendFrequency: Log data will be sent to the server every loggingSendFrequency second cycle.

    + healthSendFrequency: Health data will be sent to the server every healthSendFrequency second cycle.

    + isLoggingChanged: sync status of parameter.

    + isModbusConfigChanged: sync status of modbus.

    + isAlarmConfigChanged: sync status of alarm.

    + isEventConfigChanged: sync status of event.

    + createdDate: created date.

    + attachedDate: Attached date

    + lastUpdated: Last updated

    + lastSignedIn: Last signed in

    + status: status of device (registered, attached, locked, de-attached)

    + nodeId: ID of node.

    + memmapId: id of memmap.

    + model: iconnector model

    + manufactureDate: manufacture date.

    + firmwareVersion: firmware version.

    + memmapVersion: memory map version.

    + imei: IMEI of SIM on device.

    + cellularNetwork: cellular network.

    + iccid:  ICCID of SIM on device.

Data Params

 

Response code

200: Success

401: Unauthorized

409: Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/devices
Method: GET

URL Params:

 

Response data:

 

{

    "responseMessage": "Success",

    "responseCode": 200,

    "count": 3,

    "devices": [

        {

            "id": "device-22e207c7-b9c8-4edf-966e-175e84cbacce",

            "deviceName": "DAVITEQ_0003",

            "serialNumber": "313231363031323130333439",

            "hostName": "00000003",

            "ncc": "30383678",

            "fcc": "34323230",

            "latitude": "10.726629",

            "longitude": "106.617905",

            "phoneNumber": "0101010101",

            "loggingSendFrequency": 600,

            "healthSendFrequency": 600,

            "isLoggingChanged": false,

            "isModbusConfigChanged": false,

            "isAlarmConfigChanged": false,

            "isEventConfigChanged": false,

            "createdDate": 1456394740010,

            "lastUpdated": 1475570349490,

            "attachedDate": 1474359756741,

            "lastSignedIn": 1456394740010,

            "status": "attached",

            "nodeId": "superadmin",

            "memmapId": "memmap-2881aa59-00af-4a96-8bb0-7e9d189c0498",

            "model": "",

            "manufactureDate": "",

            "hardwareVersion": "3.0",

            "firmwareVersion": "2.5.7",

            "memmapVersion": "2.6",

            "imei": "358945044492043",

            "cellularNetwork": "452019151822261",

            "iccid": "8984011602516415947F"

        },

        {

            "id": "device-0ab506f4-b545-4bbc-b2bb-d0a9f55c45b4",

            "deviceName": "Thuc_0000002",

            "serialNumber": "313233343536373938373938",

            "hostName": "00000048",

            "fcc": "32313335",

            "phoneNumber": "25874136985545645646",

            "loggingSendFrequency": 180,

            "healthSendFrequency": 300,

            "isLoggingChanged": true,

            "isModbusConfigChanged": true,

            "isAlarmConfigChanged": true,

            "isEventConfigChanged": true,

            "createdDate": 1477303645565,

            "lastUpdated": 1477303645565,

            "attachedDate": 1477303645565,

            "lastSignedIn": 1477303645565,

            "status": "registered",

            "nodeId": "node-8bc2de8b-ba52-47db-b45f-b4ca0cc66ef1",

            "memmapId": "memmap-6edc7332-4a30-45f1-9f75-f31c6c4632aa",

            "realParameterUsed": 2,

            "virtualParameterUsed": 2,

            "eventUsed": 1,

            "alarmUsed": 0

        },

        {

            "id": "device-7a4e49de-39e0-46e9-844f-e890628873e2",

            "deviceName": "Device_00001",

            "serialNumber": "313233313233313233313233",

            "hostName": "00000045",

            "fcc": "31323331",

            "phoneNumber": "2345234523",

            "loggingSendFrequency": 1800,

            "healthSendFrequency": 1800,

            "isLoggingChanged": true,

            "isModbusConfigChanged": true,

            "isAlarmConfigChanged": true,

            "isEventConfigChanged": true,

            "createdDate": 1475114053374,

            "lastUpdated": 1475114053374,

            "attachedDate": 1475114053374,

            "lastSignedIn": 1475114053374,

            "status": "registered",

            "nodeId": "node-e3fdaf2c-28ff-4f80-a9ef-d2bad97b542a",

            "memmapId": "memmap-7e030dd1-f706-4523-b707-458d007987e6"

        }

    ]

}

Notes

Use Epoch time format, Refer to: http://www.epochconverter.com/epoch/clock.php

4.3.2 Retrieve device by hostname

No.   

 

Title

 

URL

/rest/api/public/v2/devices/host-name/<host-name>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

Data Params

{

    "responseMessage": "",

    "responseCode": ,

    "count": ,

    "devices": [

        {

            "id": "",

            "deviceName": "",

            "serialNumber": "",

            "hostName": "",

            "ncc": "",

            "fcc": "",

            "latitude": "",

            "longitude": "",

            "phoneNumber": "",

            "loggingSendFrequency": ,

            "healthSendFrequency": ,

            "isLoggingChanged": ,

            "isModbusConfigChanged": ,

            "isAlarmConfigChanged": ,

            "isEventConfigChanged": ,

            "createdDate": ,

            "lastUpdated": ,

            "attachedDate": ,

            "lastSignedIn": ,

            "status": "",

            "nodeId": "",

            "memmapId": "",

            "model": "",

            "manufactureDate": "",

            "hardwareVersion": "",

            "firmwareVersion": "",

            "memmapVersion": "",

            "imei": "",

            "cellularNetwork": "",

            "iccid": ""

        }

    ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of device.

devices: if response_code is 200 (Success), the data of devices will be an array type.

    + id: identification

    + deviceName: device name

    + serialNumber: serial number

    + hostname: IP address of device on Globiots system.

    + ncc: ncc of device on Globiots system.

    + fcc: fcc of device on Globiots system.

    + latitude:  latitude of iConnector.

    + longitude:  longitude of iConnector.

    + phoneNumber: phone number of SIM.

    + loggingSendFrequency: Log data will be sent to the server every loggingSendFrequency second cycle.

    + healthSendFrequency: Health data will be sent to the server every healthSendFrequency second cycle.

    + isLoggingChanged: sync status of parameter.

    + isModbusConfigChanged: sync status of modbus.

    + isAlarmConfigChanged: sync status of alarm.

    + isEventConfigChanged: sync status of event.

    + createdDate: created date.

    + attachedDate: Attached date

    + lastUpdated: Last updated

    + lastSignedIn: Last signed in

    + status: status of device (registered, attached, locked, de-attached)

    + nodeId: ID of node.

    + memmapId: id of memmap.

    + model: iconnector model

    + manufactureDate: manufacture date.

    + firmwareVersion: firmware version.

    + memmapVersion: memory map version.

    + imei: IMEI of SIM on device.

    + cellularNetwork: cellular network.

    + iccid:  ICCID of SIM on device.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/devices/host-name/00000001
Method: GET

URL Params:

      <host-name>:  00000001

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "device": {

    "id": "device-22e207c7-b9c8-4edf-966e-175e84cbacce",

    "deviceName": "DAVITEQ_0003",

    "serialNumber": "313231363031323130333439",

    "hostName": "00000003",

    "ncc": "30383678",

    "fcc": "34323230",

    "latitude": "10.726629",

    "longitude": "106.617905",

    "phoneNumber": "0101010101",

    "loggingSendFrequency": 600,

    "healthSendFrequency": 600,

    "isLoggingChanged": false,

    "isModbusConfigChanged": false,

    "isAlarmConfigChanged": false,

    "isEventConfigChanged": false,

    "createdDate": 1456394740010,

    "lastUpdated": 1475570349490,

    "attachedDate": 1474359756741,

    "lastSignedIn": 1456394740010,

    "status": "attached",

    "nodeId": "superadmin",

    "memmapId": "memmap-2881aa59-00af-4a96-8bb0-7e9d189c0498",

    "model": "",

    "manufactureDate": "",

    "hardwareVersion": "3.0",

    "firmwareVersion": "2.5.7",

    "memmapVersion": "2.6",

    "imei": "358945044492043",

    "cellularNetwork": "452019151822261",

    "iccid": "8984011602516415947F"

  }

}

Notes

 

4.3.3 Retrieve device information by status

No.

 

Title

 

URL

/rest/api/public/v2/devices/status/<status>

Method

GET

URL Params

status: device status

Data Params

{

    "responseMessage": "",

    "responseCode": ,

    "count": ,

    "devices": [

        {

            "id": "",

            "deviceName": "",

            "serialNumber": "",

            "hostName": "",

            "ncc": "",

            "fcc": "",

            "latitude": "",

            "longitude": "",

            "phoneNumber": "",

            "loggingSendFrequency": ,

            "healthSendFrequency": ,

            "isLoggingChanged": ,

            "isModbusConfigChanged": ,

            "isAlarmConfigChanged": ,

            "isEventConfigChanged": ,

            "createdDate": ,

            "lastUpdated": ,

            "attachedDate": ,

            "lastSignedIn": ,

            "status": "",

            "nodeId": "",

            "memmapId": "",

            "model": "",

            "manufactureDate": "",

            "hardwareVersion": "",

            "firmwareVersion": "",

            "memmapVersion": "",

            "imei": "",

            "cellularNetwork": "",

            "iccid": ""

        }

    ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of device.

devices: if response_code is 200 (Success), the data of devices will be an array type.

    + id: identification

    + deviceName: device name

    + serialNumber: serial number

    + hostname: IP address of device on Globiots system.

    + ncc: ncc of device on Globiots system.

    + fcc: fcc of device on Globiots system.

    + latitude:  latitude of iConnector.

    + longitude:  longitude of iConnector.

    + phoneNumber: phone number of SIM.

    + loggingSendFrequency: Log data will be sent to the server every loggingSendFrequency second cycle.

    + healthSendFrequency: Health data will be sent to the server every healthSendFrequency second cycle.

    + isLoggingChanged: sync status of parameter.

    + isModbusConfigChanged: sync status of modbus.

    + isAlarmConfigChanged: sync status of alarm.

    + isEventConfigChanged: sync status of event.

    + createdDate: created date.

    + attachedDate: Attached date

    + lastUpdated: Last updated

    + lastSignedIn: Last signed in

    + status: status of device (registered, attached, locked, de-attached)

    + nodeId: ID of node.

    + memmapId: id of memmap.

    + model: iconnector model

    + manufactureDate: manufacture date.

    + firmwareVersion: firmware version.

    + memmapVersion: memory map version.

    + imei: IMEI of SIM on device.

    + cellularNetwork: cellular network.

    + iccid:  ICCID of SIM on device.

Response code

200 : Success

401 : Unauthorized

404 : Status is not available

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/devices/status/locked
Method: GET

URL Params:

      <status>:  locked

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "count": 1,

  "devices": [

    {

      "id": "device-9fbf9800-dcb5-4ea4-81d6-d3ff39c61f78",

      "deviceName": "111111111120",

      "serialNumber": "313131313131313131313230",

      "hostName": "00000021",

      "fcc": "32333333",

      "phoneNumber": "1",

      "loggingSendFrequency": 300,

      "healthSendFrequency": 900,

      "isLoggingChanged": true,

      "isModbusConfigChanged": true,

      "isAlarmConfigChanged": true,

      "isEventConfigChanged": true,

      "createdDate": 1465739971068,

      "lastUpdated": 1465739971068,

      "attachedDate": 1465739971068,

      "lastSignedIn": 1465739971068,

      "status": "locked",

      "nodeId": "node-0f0c71bd-c3b1-431a-b58c-5d366d72b751",

      "memmapId": "memmap-6edc7332-4a30-45f1-9f75-f31c6c4632aa"

    }

  ]

}

Notes

 

4.3.4 Retrieve device information by serial number

No.

 

Title

 

URL

/rest/api/public/v2/devices/serial-number/<serial-number>

Method

GET

URL Params

serialNumber: serial number of device

Data Params

{

    "responseMessage": "",

    "responseCode": ,

    "count": ,

    "devices": [

        {

            "id": "",

            "deviceName": "",

            "serialNumber": "",

            "hostName": "",

            "ncc": "",

            "fcc": "",

            "latitude": "",

            "longitude": "",

            "phoneNumber": "",

            "loggingSendFrequency": ,

            "healthSendFrequency": ,

            "isLoggingChanged": ,

            "isModbusConfigChanged": ,

            "isAlarmConfigChanged": ,

            "isEventConfigChanged": ,

            "createdDate": ,

            "lastUpdated": ,

            "attachedDate": ,

            "lastSignedIn": ,

            "status": "",

            "nodeId": "",

            "memmapId": "",

            "model": "",

            "manufactureDate": "",

            "hardwareVersion": "",

            "firmwareVersion": "",

            "memmapVersion": "",

            "imei": "",

            "cellularNetwork": "",

            "iccid": ""

        }

    ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of device.

devices: if response code is 200 (Success), the data of devices will be an array type.

    + id: identification

    + deviceName: device name

    + serialNumber: serial number

    + hostname: IP address of device on Globiots system.

    + ncc: ncc of device on Globiots system.

    + fcc: fcc of device on Globiots system.

    + latitude:  latitude of iConnector.

    + longitude:  longitude of iConnector.

    + phoneNumber: phone number of SIM.

    + loggingSendFrequency: Log data will be sent to the server every loggingSendFrequency second cycle.

    + healthSendFrequency: Health data will be sent to the server every healthSendFrequency second cycle.

    + isLoggingChanged: sync status of parameter.

    + isModbusConfigChanged: sync status of modbus.

    + isAlarmConfigChanged: sync status of alarm.

    + isEventConfigChanged: sync status of event.

    + createdDate: created date.

    + attachedDate: Attached date

    + lastUpdated: Last updated

    + lastSignedIn: Last signed in

    + status: status of device (available status: registered, attached, locked, de-attached)

    + nodeId: ID of node.

    + memmapId: id of memory map.

    + model: iConnector model

    + manufactureDate: date of manufacturing.

    + firmwareVersion: firmware version.

    + memmapVersion: memory map version.

    + imei: IMEI of SIM on device.

    + cellularNetwork: cellular network.

    + iccid:  ICCID of SIM on device.

Response code

200 : Success

401 : Unauthorized

403 :  Serial number not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/devices/serial-number/313231363031323130333439
Method: GET

URL Params:

      <serial-number>:  313231363031323130333439

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "device": {

    "id": "device-22e207c7-b9c8-4edf-966e-175e84cbacce",

    "deviceName": "DAVITEQ_0003",

    "serialNumber": "313231363031323130333439",

    "hostName": "00000003",

    "ncc": "30383678",

    "fcc": "34323230",

    "latitude": "10.726629",

    "longitude": "106.617905",

    "phoneNumber": "0101010101",

    "loggingSendFrequency": 600,

    "healthSendFrequency": 600,

    "isLoggingChanged": false,

    "isModbusConfigChanged": false,

    "isAlarmConfigChanged": false,

    "isEventConfigChanged": false,

    "createdDate": 1456394740010,

    "lastUpdated": 1475570349490,

    "attachedDate": 1474359756741,

    "lastSignedIn": 1456394740010,

    "status": "attached",

    "nodeId": "superadmin",

    "memmapId": "memmap-2881aa59-00af-4a96-8bb0-7e9d189c0498",

    "model": "",

    "manufactureDate": "",

    "hardwareVersion": "3.0",

    "firmwareVersion": "2.5.7",

    "memmapVersion": "2.6",

    "imei": "358945044492043",

    "cellularNetwork": "452019151822261",

    "iccid": "8984011602516415947F"

  }

}

Notes

 

4.4 Parameter Management

4.4.1 Retrieve all parameter by host name

No.

 

Title

 

URL

/rest/api/public/v2/parameters/host-name/<host-name>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

Data Params

{

  "responseMessage": "",

  "responseCode": ,

  "count": ,

  "parameters": [

    {

      "id": "",

      "name": "",

      "type": "",

      "address": "",

      "unit": ''",

      "decimalPlaces": ,

      "dataType": "",

      "dataLength": ,

      "isLogged": ,

      "loggingPriority": ,

      "loggingFrequency": ,

      "loggingTTL": ,

      "createdDate": ,

      "lastUpdated": ,

      "deviceId": ""

    }

  ]

}

 

responseCode: response code

responseMessage: response message (expain for response_code).

count: number of parameter.

parameters: if response_code is 200 (Success), the data of devices will be an array type.

    + id: parameter identification.

    + name: parameter name.

    + type: parameter type.

    + address: address (hexa) of parameter on memory map.

    + unit: unit of parameter.

    + decimalPlaces: length of fractional.

    + dataType: data type.

    + dataLength: data length.

    + expression: expression string defined by user (only for virtual parameter).

    + isLogged:  this is marked logged or no logged.

    + loggingPriority: priority (unused).

    + loggingFrequency: data will be logged every 'loggingFrequency' second cycle.

    + loggingTTL: time-to-live of data.

    + createdDate: created date.

    + lastUpdated: last updated.

    + deviceId: device identification.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

409 : Data not found

Sample call

URL:

http://restest.globiots.com//rest/api/public/v2/parameters/host-name/00000003

Method: GET

URL Params:

      <host-name>:  00000003

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "count": 3,

  "parameters": [

    {

      "id": "parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049",

      "name": "3000",

      "type": "real_parameter",

      "address": "3000",

      "unit": "%/min",

      "decimalPlaces": 4,

      "dataType": "float",

      "dataLength": 4,

      "isLogged": true,

      "loggingPriority": 123,

      "loggingFrequency": 1,

      "loggingTTL": 1036800,

      "createdDate": 1474276465221,

      "lastUpdated": 1474363305602,

      "deviceId": "device-22e207c7-b9c8-4edf-966e-175e84cbacce"

    },

    {

      "id": "parameter-19ced2d2-409c-42ee-9c34-0e1a1f56779f",

      "name": "Pin",

      "type": "real_parameter",

      "address": "2304",

      "unit": "none",

      "decimalPlaces": 2,

      "dataType": "float",

      "dataLength": 4,

      "isLogged": true,

      "loggingPriority": 1,

      "loggingFrequency": 5,

      "loggingTTL": 1036800,

      "createdDate": 1474362121104,

      "lastUpdated": 1474362121104,

      "deviceId": "device-22e207c7-b9c8-4edf-966e-175e84cbacce"

    },

    {

      "id": "parameter-5e0f3f59-03e8-4486-b548-44cbb728f063",

      "name": "Power",

      "type": "real_parameter",

      "address": "2300",

      "unit": "none",

      "decimalPlaces": 2,

      "dataType": "float",

      "dataLength": 4,

      "isLogged": true,

      "loggingPriority": 1,

      "loggingFrequency": 5,

      "loggingTTL": 1036800,

      "createdDate": 1474362019531,

      "lastUpdated": 1474362019531,

      "deviceId": "device-22e207c7-b9c8-4edf-966e-175e84cbacce"

    }

  ]

}

Notes

 

4.4.2 Retrieve parameter information by address

No.

 

Title

 

URL

/rest/api/public/v2/parameters/host-name/<hostname>/address/<address>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system. 

<address>: address (hexadecimal) on memory map.

Data Params

{

  "responseMessage": "",

  "responseCode": ,

  "count": ,

  "parameters": [

    {

      "id": "",

      "name": "",

      "type": "",

      "address": "",

      "unit": ''",

      "decimalPlaces": ,

      "dataType": "",

      "dataLength": ,

      "isLogged": ,

      "loggingPriority": ,

      "loggingFrequency": ,

      "loggingTTL": ,

      "createdDate": ,

      "lastUpdated": ,

      "deviceId": ""

    }

  ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of parameter.

parameters: if response_code is 200 (Success), the data will be an array type.

    + id: parameter identification.

    + name: parameter name.

    + type: parameter type.

    + address: address (hexa) of parameter on memory map.

    + unit: unit of parameter.

    + decimalPlaces: length of fractional.

    + dataType: data type.

    + dataLength: data length.

    + expression: expression string defined by user (only for virtual parameter).

    + isLogged:  this is marked logged or no logged.

    + loggingPriority: priority (unused).

    + loggingFrequency: data will be logged every 'loggingFrequency' second cycle.

    + loggingTTL: time-to-live of data.

    + createdDate: created date.

    + lastUpdated: last updated.

    + deviceId: device identification.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

406 : Status not support

409 : Data not found

Sample call

URL:

http://restest.globiots.com//rest/api/public/v2/parameters/host-name/00000003/address/3000

Method: GET

URL Params:

      <host-name>:  00000003

      <address>: 3000

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "parameter": {

    "id": "parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049",

    "name": "3000",

    "type": "real_parameter",

    "address": "3000",

    "unit": "%/min",

    "decimalPlaces": 4,

    "dataType": "float",

    "dataLength": 4,

    "isLogged": true,

    "loggingPriority": 123,

    "loggingFrequency": 1,

    "loggingTTL": 1036800,

    "createdDate": 1474276465221,

    "lastUpdated": 1474363305602,

    "deviceId": "device-22e207c7-b9c8-4edf-966e-175e84cbacce"

  }

}

Notes

 

4.4.3 Retrieve device information according to logged status

No.

 

Title

 

URL

/rest/api/public/v2/parameters/host-name/<host-name>/logged/<status>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

<status>: status of parameter (true: logged, false: no logged)

Data Params

{

  "responseMessage": "",

  "responseCode": ,

  "count": ,

  "parameters": [

    {

      "id": "",

      "name": "",

      "type": "",

      "address": "",

      "unit": ''",

      "decimalPlaces": ,

      "dataType": "",

      "dataLength": ,

      "isLogged": ,

      "loggingPriority": ,

      "loggingFrequency": ,

      "loggingTTL": ,

      "createdDate": ,

      "lastUpdated": ,

      "deviceId": ""

    }

  ]

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

count: number of parameter.

parameters: if response code is 200 (Success), the data will be an array type.

    + id: parameter identification.

    + name: parameter name.

    + type: parameter type.

    + address: address (hexadecimal) of parameter on memory map.

    + unit: unit of parameter.

    + decimalPlaces: length of decimal.

    + dataType: data type.

    + dataLength: data length.

    + expression: expression string defined by user (only for virtual parameter).

    + isLogged:  this is marked logged or no logged.

    + loggingPriority: priority (unused).

    + loggingFrequency: data will be logged every 'loggingFrequency' second cycle.

    + loggingTTL: time-to-live of data.

    + createdDate: created date.

    + lastUpdated: last updated.

    + deviceId: device identification.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

406 : Status not support

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/parameters/host-name/00000001/logged/true

Method: GET

URL Params:

      <host-name>:  00000001

      <logged>: false

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "count": 3,

  "parameters": [

    {

      "id": "parameter-df6fdcf8-d1c1-4692-8b32-cd793cf8b659",

      "name": "Power Factor 1-PM128 + 5",

      "type": "virtual_parameter",

      "address": "4084",

      "value": "",

      "unit": "kg/l",

      "decimalPlaces": 4,

      "dataType": "float",

      "dataLength": 4,

      "expression": "[2030] + 5",

      "isLogged": false,

      "loggingPriority": 1,

      "loggingFrequency": 5,

      "loggingTTL": 5184000,

      "createdDate": 1455510675036,

      "lastUpdated": 1455510675036,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "parameter-57f742e1-6067-4f09-8e2d-263152b2c48f",

      "name": "[iConnector Power Supply] + [iConnector Battery]",

      "type": "virtual_parameter",

      "address": "4088",

      "value": "",

      "unit": "A",

      "decimalPlaces": 6,

      "dataType": "float",

      "dataLength": 4,

      "expression": "[2300] + [2304]",

      "isLogged": false,

      "loggingPriority": 1,

      "loggingFrequency": 5,

      "loggingTTL": 5184000,

      "createdDate": 1455596199590,

      "lastUpdated": 1455596199590,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "parameter-aab8bc36-1321-428e-b427-b3715712e503",

      "name": "[Voltage 1N-PM128] + [Active Energy-PM128] - 10",

      "type": "virtual_parameter",

      "address": "4080",

      "value": "",

      "unit": "A",

      "decimalPlaces": 5,

      "dataType": "float",

      "dataLength": 4,

      "expression": "([2000] + [2040]) - 10",

      "isLogged": false,

      "loggingPriority": 1,

      "loggingFrequency": 5,

      "loggingTTL": 5184000,

      "createdDate": 1455510575550,

      "lastUpdated": 1455510575550,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    }

  ]

}

Notes

 

4.5 Alarm Management

4.5.1 Retrieve all alarm configuration

No.

 

Title

 

URL

/rest/api/public/v2/alarms/parameter-id/<parameter-id>

Method

GET

URL Params

<parameter-id>: parameter indentify

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "alarm-config": {

        "name": "",

        "h": "",

        "hihi": "",

        "hOfHihi": "",

        "hihiCmt": "",

        "hi": "",

        "hOfHi": "",

        "hiCmt": 0,

        "lo": 0,

        "hOfLo": 0,

        "loCmt": 0,

        "lolo": 0,

        "hOfLolo": 0,

        "loloCmt": 0,

        "createdDate": 1435740094,

        "lastUpdated": 1435740094,

        "parameterId": ""

    }

}

 

responseCode: response code

responseMessage: response message (expain for response_code).

alarms:  if response_code is 200 (Success), the data will be an array type.

    + id: alarm identification

    + name: alarm name

    + h: hysteresis value of alarm

    + hihi: hihi value of alarm

    + hOfHihi: hysteresis value of hihi state

    + hihiCmt: comment of hihi state

    + hi: hi value

    + hOfHi: hysteresis value of hi state

    + hiCmt: comment of hi state

    + lo: lo value

    + hOfLo: hysteresis value of lo

    + loCmt: comment of lo state

    + lolo: lolo value

    + hOfLolo: hysteresis value of lolo state

    + loloCmt: comment of lolo state

    + createdDate: created date on iConfig

    + lastUpdated: last updated on iConfig

    + parameterId: parameter identification

Response code

200 : Success

401 : Unauthorized

407 : Parameter id not found

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/alarms/parameter-id/parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049

Method: GET

URL Params:

      <parameter-id>:  parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "alarm-config": {

    "id": "alarm-config-c90915c0-09cb-4aea-931d-030b2595868d",

    "priority": 255,

    "name": "Alarm 3000",

    "hihi": 1000,

    "hyOfHihi": 1,

    "hihiCmt": "HiHi",

    "hi": 500,

    "hyOfHi": 1,

    "hiCmt": "Hi",

    "lo": 200,

    "hyOfLo": 1,

    "loCmt": "Lo",

    "lolo": 100,

    "hyOfLolo": 1,

    "loloCmt": "LoLo",

    "parameterId": "parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049"

  }

}

Notes

 

4.6 Event Management

4.6.1 Retrieve all event configuration

No.

 

Title

 

URL

/rest/api/public/v2/events/host-name/<hostname>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "count": 2,

    "event-configs": [

        {

            "id":"",

            "name": "",

            "comment": "",

            "isNotificationServer": "",

            "timeoutTrue": "",

            "timeoutFalse": "",

            "logicalOperator": "",

            "deviceId": "",

            "conditionCount": 2,

            "actionCount": 2,

            "conditions": [

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "comparisionOperator": "",

                    "parameterIdPrimary": "",

                    "parameterIdSecondary": "",

                    "constant": "",

                    "eventConfigId": ""

                },

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "comparisionOperator": "",

                    "parameterIdPrimary": "",

                    "parameterIdSecondary": "",

                    "constant": "",

                    "eventConfigId": ""

                }

            ],

            "actions": [

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "parameterId": "",

                    "valueTrue": "",

                    "valueFalse": "",

                    "eventConfigId": ""

                },

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "parameterId": "",

                    "valueTrue": "",

                    "valueFalse": "",

                    "eventConfigId": ""

                }

            ]

        },

        {

            "id":"",

            "name": "",

            "comment": "",

            "isNotificationServer": "",

            "timeoutTrue": "",

            "timeoutFalse": "",

            "logicalOperator": "",

            "deviceId": "",

            "conditionCount": 2,

            "actionCount": 2,

            "conditions": [

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "comparisionOperator": "",

                    "parameterIdPrimary": "",

                    "parameterIdSecondary": "",

                    "constant": "",

                    "eventConfigId": ""

                },

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "comparisionOperator": "",

                    "parameterIdPrimary": "",

                    "parameterIdSecondary": "",

                    "constant": "",

                    "eventConfigId": ""

                }

            ],

            "actions": [

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "parameterId": "",

                    "valueTrue": "",

                    "valueFalse": "",

                    "eventConfigId": ""

                },

                {

                    "id": "",

                    "name": "",

                    "type": "",

                    "parameterId": "",

                    "valueTrue": "",

                    "valueFalse": "",

                    "eventConfigId": ""

                }

            ]

        }

    ]

}

 

responseCode: response code

responseMessage: responseMessage: response message (explain for response_code).

count: number of event.

events: if response_code is 200 (Success), the data will be an array type.

    + id: event identification

    + name: event name

    + comment: comment.

    + isNotificationServer: true: send to server, false: no send to server.

    + timeoutTrue: TRUEvalue period of event.

    + timeoutFalse: FALSE value period of event.

    + logicalOperator: logical operator (AND, OR)

    + deviceId: device identification

    + conditionCount: number of condition.

    + actionCount: number of action.

    + conditions:

         - id: condition identification

         - name: condition name

         - type: condition type

         - comparisionOperator: comparison operator

         - parameterIdPrimary: first parameter of condition.

         - parameterIdSecondary: second parameter of condition

         - constant: constant.

         - eventConfigId: event identification

    + actions:

         - id: action identification

         - name: action name

         - type: action type

         - parameterId: parameter identification

         - valueTrue: first value.

         - valueFalse: second value.

         - eventConfigId: event identification.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/events/host-name/00000003

Method: GET

URL Params:

      <host-name>:  00000003

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "event-configs": [

    {

      "id": "event-config-d0ffcb25-b9e2-40ab-b1e4-dcd75a48e3a3",

      "uniqueId": 1,

      "parameterId": "parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049",

      "name": "Event 3000 > 100",

      "priority": 255,

      "comment": "Comment",

      "isNotificationServer": true,

      "timeoutTrue": 1,

      "timeoutFalse": 1,

      "logicalOperator": "AND",

      "deviceId": "device-22e207c7-b9c8-4edf-966e-175e84cbacce",

      "status": true,

      "conditions": [

        {

          "id": "condition-61b2f2e4-fbd4-450a-9ce6-0bcc555bb298",

          "name": "Condition",

          "type": "01",

          "comparisionOperator": "greater_than_or_equal_to",

          "parameterIdPrimary": "parameter-cbd80f6e-d9f4-41ae-b2cb-01824fc07049",

          "constant": "100",

          "eventConfigId": "event-config-d0ffcb25-b9e2-40ab-b1e4-dcd75a48e3a3",

          "status": true

        }

      ],

      "actions": []

    }

  ],

  "count": 1

}

Notes

 

4.7 Memory Map Management

4.7.1 Retrieve all address on memory map

No.

 

Title

 

URL

/rest/api/public/v2/memmap/host-name/<host-name>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "count": 2,

    "addresses": [

        {

            "id": "",

            "address": "",

            "value": "",

            "dataType": "",

            "dataLength": "",

            "canRead": "",

            "canWrite": "",

            "isChanged": true,

            "createdDate": 1435740094,

            "lastUpdated": 1435740094,

            "deviceId": ""

        }

    ]

}

 

responseCode: response code

responseMessage: responseMessage: response message (explain for response_code).

count: number of event.

addresses: if response_code is 200 (Success), the data will be an array type.

    + id: identification

    + address: address (hexa) on memory map.

    + value: value of address (not real-time).

    + dataType: data type.

    + dataLength: data length.

    + canRead: marked of address can read or no (true: read, false: no read).

    + canWrite: marked of address can write or no (true: write, false: no write).

    + isChanged: marked of address is changed or no on iConnector.

    + createdDate: created date on iConfig.

    + lastUpdated: last updated on iConfig.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/memmap/host-name/00000001

Method: GET

URL Params:

      <host-name>:  00000001

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "count": 12,

  "addresses": [

    {

      "id": "memmap-config-233e17af-8106-416f-ba8d-48dd7aab30e0",

      "label": "mbCycle",

      "address": "0807",

      "value": "1",

      "dataType": "unsigned_integer_32",

      "dataLength": 4,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501573968,

      "lastUpdated": 1452501573969,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-01b805e6-e942-4660-918a-98e032a1c8f0",

      "label": "Port",

      "address": "01C0",

      "value": "",

      "dataType": "unsigned_integer_32",

      "dataLength": 4,

      "canRead": true,

      "canWrite": false,

      "isChanged": false,

      "createdDate": 1456391222115,

      "lastUpdated": 1464840747256,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-7539c9f0-585a-413e-95bf-f5adc1770650",

      "label": "mbCommMode",

      "address": "0801",

      "value": "0",

      "dataType": "byte",

      "dataLength": 1,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574220,

      "lastUpdated": 1452501574220,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-99da961b-1bb8-48d5-be67-d24d2d729e33",

      "label": "Timezone",

      "address": "01de",

      "value": "0",

      "dataType": "unsigned_integer_16",

      "dataLength": 2,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1463996750442,

      "lastUpdated": 1463996833685,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-e6f2ae7a-d9c9-4c86-8b60-54799b6c0b3f",

      "label": "mbTimeOut",

      "address": "0805",

      "value": "1000",

      "dataType": "unsigned_integer_16",

      "dataLength": 2,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574057,

      "lastUpdated": 1452501574057,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-47c5e7b5-d80c-4607-9ff8-53cec564e189",

      "label": "Time",

      "address": "2420",

      "value": "",

      "dataType": "string",

      "dataLength": 6,

      "canRead": true,

      "canWrite": false,

      "isChanged": false,

      "createdDate": 1463999092834,

      "lastUpdated": 1467342149434,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-bf014b70-6f80-4008-aa36-6aa321374b4a",

      "label": "mbParity",

      "address": "0803",

      "value": "0",

      "dataType": "byte",

      "dataLength": 1,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574130,

      "lastUpdated": 1452501574130,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-7584ee1f-3383-420f-8191-f97716d3ba9a",

      "label": "Hostname",

      "address": "0180",

      "value": "",

      "dataType": "string",

      "dataLength": 64,

      "canRead": true,

      "canWrite": false,

      "isChanged": false,

      "createdDate": 1456391168888,

      "lastUpdated": 1464840733717,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-9e2efb6c-5e87-46f5-b7c9-eb627aa9158e",

      "label": "Date",

      "address": "2426",

      "value": "",

      "dataType": "string",

      "dataLength": 6,

      "canRead": true,

      "canWrite": false,

      "isChanged": false,

      "createdDate": 1463999078766,

      "lastUpdated": 1463999176756,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-ecc75326-f6db-4728-9ec5-ad6e0bd1e55f",

      "label": "mbBaudRate",

      "address": "0802",

      "value": "2",

      "dataType": "byte",

      "dataLength": 1,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574092,

      "lastUpdated": 1465009184434,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-c09c2b87-a7b4-4c93-ac28-128fb7389b43",

      "label": "mbStopBits",

      "address": "0804",

      "value": "1",

      "dataType": "byte",

      "dataLength": 1,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574011,

      "lastUpdated": 1452501574011,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    },

    {

      "id": "memmap-config-deea8825-6214-49ec-bb5f-cdc32f0b7930",

      "label": "mbPortNumber",

      "address": "0800",

      "value": "1",

      "dataType": "byte",

      "dataLength": 1,

      "canRead": true,

      "canWrite": true,

      "isChanged": false,

      "createdDate": 1452501574175,

      "lastUpdated": 1452501574175,

      "deviceId": "device-fa48cc49-2856-4365-90ca-db02f27cc3eb"

    }

  ]

}

Notes

 

4.8 Logging Data

4.8.1 Retrieve the final data of the day

No.

 

Title

 

URL

rest/api/public/v2/data-log/last-value?hostname={hostname}&address={addresses}

Method

GET

URL Params

hostname: IP address of device on Globiots system.

addresses: address (hexadecimal) on memory map.

Data Params

{
  "data": [
    {
      "hostName": "",
      "address": "",
      "timestamp": "",
      "rawValue": ""
    }
  ],
  "responseMessage": "Success",
  "responseCode": 200
}

 

responseCode: response code

responseMessage: response message (explain for response_code).

hostName: IP address of device on Globiots system.

address: address (hexadecimal) on memory map.

rawValue: Last value of the day

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than  value of 'toDate' field

409 : Data not found

Sample call

URL:

http://localhost:8080/globiots-resources/rest/api/public/v2/data-log/last-value?hostname=00000012&address=2000

Method: GET

URL Params:

      <host-name>:  00000012,

      <addresses>: 2000

 

Response data:

{
  "data": [
    {
      "hostName": "00000012",
      "address": "2000",
      "timestamp": "1564821007000",
      "rawValue": "1"
    }
  ],
  "responseMessage": "Success",
  "responseCode": 200
}

Notes

Only get the last value of the day. If the iConnector is offline then will not get the last value.

4.8.2 Retrieve the final data of the day with multiple addresses

No.

 

Title

 

URL

rest/api/public/v2/data-log/last-value?hostname={ hostname }

Method

POST

URL Params

hostname: IP address of device on Globiots system.

addresses: address (hexadecimal) on memory map.

fromDate: start point get data, yyyyMMddHHmmss format (GMT + 0).

toDate: end point get data, yyyyMMddHHmmss format (GMT + 0).

Request Body

{
  "hostnameA": ["addressA1","addressA2"],
   "hostnameB": ["addressB1","addressB2"],
}

Data Params

{
  "data": [
    {
      "hostName": "",
      "address": "",
      "timestamp": "",
      "rawValue": ""
    }
  ],
  "responseMessage": "Success",
  "responseCode": 200
}

 

responseCode: response code

responseMessage: response message (expain for response_code).

hostName: IP address of device on Globiots system.

address: address (hexadecimal) on memory map.

rawValue: Last value of the day

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than  value of 'toDate' field

409 : Data not found

Sample call

URL:

http://localhost:8080/globiots-resources/rest/api/public/v2/data-log/last-value?hostname=00000012

Method: POST

URL Params:

      <host-name>:  00000003

Request Body:

{
  "00000012": [
    "2000",
    "2004"
  ],
  "00000010": [
    "2008",
    "200C"
  ]
}

Response data:

{
  "responseMessage": "Success",
  "responseCode": 200,
  "data": [
    {
      "hostName": "00000012",
      "address": "2000",
      "timestamp": "1564821307000",
      "rawValue": "1"
    },
    {
      "hostName": "00000012",
      "address": "2004",
      "timestamp": "1564821307000",
      "rawValue": "1"
    },
    {
      "hostName": "00000010",
      "address": "2008"
    },
    {
      "hostName": "00000010",
      "address": "200C"
    }
  ]
}

Notes

 

4.8.3 Retrieve log data

No.

 

Title

Retrieve log data

URL

/rest/api/public/v2/data-log?

hostname={hostname}&address={address}&fromDate={fromDate}&toDate={toDate}

Method

GET

URL Params

hostname: IP address of device on Globiots system.

address: address (hexadecimal) on memory map.

fromDate: start point get data, yyyyMMddHHmmss format (GMT + 0).

toDate: end point get data, yyyyMMddHHmmss format (GMT + 0).

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "count": ,

    "hostname":"",

    "address":"",

    "fromDate": ,

    "toDate": ,

    "data": [

                [timestamp, value]

            ]

}

 

responseCode: response code.

responseMessage: response message (explain for response_code).

count: number of record.

hostname: IP address of device on Globiots system.

address: address (hexadecimal) on memory map.

fromDate: start point get data, yyyyMMddHHmmss format (GMT + 0).

toDate: end point get data, yyyyMMddHHmmss format (GMT + 0).

data: if response_code is 200 (Success), the data will be an array type.

    + [1435820730000,0]: This is an array with 2 elements, first element is timestamp, second element is value.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

405 : Address not found

408 : Value of 'fromDate' field is greater than  value of 'toDate' field

409 : Data not found

Sample call

URL:   http://localhost:8080/globiots-resources/rest/api/public/v2/data-log?hostname=00000010&address=2000&fromDate=20190630070000&toDate=20190701070100

Method: GET

URL Params:

      <host-name>:  00000010,

      <address>:  2000

      fromDate: 20190630070000

      toDate:  20190630070100

 

Response data:

{
  "hostname": "00000010",
  "address":  "2000",
  "fromDate": "20190630070000",
  "toDate":   "20190630070100",
  "count": 12,
  "responseMessage": "Success",
  "responseCode": 200,
  "data": [
    [
      1561878051000,
      "1"
    ],
    [
      1561878056000,
      "1"
    ]
  ]
}

 Notes

The date range does not exceed 1 hour.

4.8.4 Retrieve log data by multiple address

No.

 

Title

Retrieve log data by multiple address

URL

/rest/api/public/v2/data-log?

hostname={hostname}&fromDate={fromDate}&toDate={toDate}

Method

POST

URL Params

hostname: IP address of device on Globiots system.

addresses: address (hexadecimal) on memory map.

fromDate: start point get data, yyyyMMddHHmmss format (GMT + 0).

toDate: end point get data, yyyyMMddHHmmss format (GMT + 0).

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "count": ,

    "hostname":"",

    "address":"",

    "fromDate": ,

    "toDate": ,

    "data": [

                [timestamp, value]

            ]

}

 

responseCode: response code

responseMessage: response message (expain for response_code).

count: number of record.

hostname: IP address of device on Globiots system.

address: address (hexadecimal) on memory map.

fromDate: start point get data.

toDate: end point get data.

data: if response_code is 200 (Success), the data will be an array type.

    + [1435820730000,0]: This is an array with  2 elements, first element is timestamp, second element is value.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than  value of 'toDate' field

409 : Data not found

Sample call

URL:

http://localhost:8080/globiots-resources/rest/api/public/v2/data-log?hostname=00000010&fromDate=20190630070000&toDate=20190630070100

Method: POST

URL Params:

      <host-name>:  00000010,

      fromDate: 20190630070000

      toDate:  20190630070100

 

Request Body:

      <addresses>: ['2000', '2004']

 

Response data:

{
  "hostname": "00000010",
  "fromDate": "20190630070000",
  "toDate": "20190630070100",
  "responseMessage": "Success",
  "responseCode": 200,
  "datas": [
    {
      "address": "2000",
      "data": [
        [
          1561878001000,
          "1"
        ],
        [
          1561878006000,
          "1"
        ]
      ],
      "count": 2
    },
    {
      "address": "2004",
      "data": [
        [
          1561878001000,
          "1"
        ],
        [
          1561878006000,
          "1"
        ]
      ],
      "count": 2
    }
  ]
}

Notes

-          The date range does not exceed 1 hour.

-          Only allow maximum 10 addresses for each call API.

4.9 Alarm Log Data

4.9.1 Retrieve all log data of alarm summary

No.

 

Title

Retrieve all log data of alarm summary

URL

/rest/api/public/v2/alarm-log/summary

Method

GET

URL Params

 

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "hostname":"",

    "fromDate": ,

    "toDate": ,

    "datas": [

        {

            "address": "",

            "count": ,

            "data": [

                 [timestamp, value]

            ]

        },

        {

            "address": "",

            "count": ,

            "data": [

                [timestamp, value]

            ]

        }

    ]  

}

 

responseMessage: response message (explain for response_code).

hostname: IP address of device on Globiots system.

fromDate: start point get data.

toDate: end point get data.

datas: if response_code is 200 (Success), the data will be an array type.

      + count: number of record.

      + address: address (hexadecimal) on memory map.

     + data: if response_code is 200 (Success), the data will be an array type.       

         - [timestamp, value]: data array consists of 2 elements, the first element is timestamp, the next element is value.

Response code

200 : Success

401 : Unauthorized

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/alarm-log/summary

Method: GET

URL Params:

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "data": {

    "count": 7,

    "alarm-logs": [

      {

        "hostname": "00000001",

        "address": "3004",

        "timestamp": "1465842108000",

        "comment": "lolo",

        "state": "0",

        "value": "0",

        "status": "ack"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1477471176000",

        "comment": "LoLo",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3004",

        "timestamp": "1473410738000",

        "comment": "lolo",

        "state": "0",

        "value": "0"

      },

      {

        "hostname": "00000013",

        "address": "2118",

        "timestamp": "1465545240000",

        "comment": "Dòng quá thấp",

        "state": "0",

        "value": "0.0",

        "status": "ack"

      },

      {

        "hostname": "00000014",

        "address": "2000",

        "timestamp": "1465869463000",

        "comment": "LoLo",

        "state": "0",

        "value": "0",

        "status": "ack"

      },

      {

        "hostname": "00000016",

        "address": "3003",

        "timestamp": "1465654546000",

        "comment": "hihi",

        "state": "4",

        "value": "110",

        "status": "ack"

      },

      {

        "hostname": "00000016",

        "address": "3005",

        "timestamp": "1465878896000",

        "comment": "lolo",

        "state": "0",

        "value": "0.0",

        "status": "ack"

      }

    ]

  }

}

Notes

 

4.9.2 Retrieve alarm summary by hostname

No.

 

Title

Retrieve alarm summary by hostname

URL

/rest/api/public/v2/alarm-log/detail/host-name/<host-name>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

Data Params

{

    "responseCode": "",

    "responseMessage": "",

    "hostname":"",

    "fromDate": ,

    "toDate": ,

    "datas

": [

        {

            "address": "",

            "count": ,

            "data": [

                 [timestamp, value]

            ]

        },

        {

            "address": "",

            "count": ,

            "data": [

                [timestamp, value]

            ]

        }

    ]  

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

hostname: IP address of device on Globiots system.

fromDate: start point get data.

toDate: end point get data.

datas: if response_code is 200 (Success), the data will be an array type.

      + count: number of record.

      + address: address (hexadecimal) on memory map.

     + data: if response_code is 200 (Success), the data will be an array type.       

  - [timestamp, value]: data array consists of 2 elements, the first element is timestamp, the next element is value.

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/alarm-log/summary/host-name/00000003

Method: GET

URL Params:

      <host-name>: 00000003

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "data": {

    "count": 2,

    "alarm-logs": [

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1477471176000",

        "comment": "LoLo",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3004",

        "timestamp": "1473410738000",

        "comment": "lolo",

        "state": "0",

        "value": "0"

      }

    ]

  }

}

Notes

 

4.9.3 Retrieve alarm detail by hostname

No.

 

Title

Retrieve alarm detail by hostname

URL

/rest/api/public/v2/alarm-log/detail/host-name/<hostname>

Method

GET

URL Params

<host-name>: IP address of device on Globiots system.

fromDate: start point get data.

toDate: end point get data.

Data Params

{

    "responseCode": 200,

    "responseMessage": "",

    "data": {

        ''count'': 2,

        "alarms": [

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": "",

                "solution": "",

                "user": ""

            },

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": "",

                "solution": "",

                "user": ""

            }

        ]

    }

}

 

responseCode: response code

responseMessage: response message (expain for response_code).

data: if response_code is 200 (Success), the data will be an array type.

    + count: number of record

    + alarms:

        - hostname: IP address of device on Globiots system.

        - address: address (hexadecimal) on memory map.

        - timestamp: time of occurence.

        - comment: Alarm commentation by user.

        - state: state of alarm (0 – LOLO, 1 – LO, 2 – NORMAL, 3 – HI, 4 – HIHI).

        - value: alarm value.

        - status: alarm status ("ack")

        - solution: commentation of user after acknowledging

        - user: user’s name of acknowledging

 

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than value of 'toDate' field

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/alarm-log/detail/host-name/00000003?fromDate=1475254800000&toDate=1477846800000

Method: GET

URL Params:

      <host-name>: 00000003

      fromDate: 1475254800000

      toDate: 1477846800000

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "data": {

    "count": 4,

    "alarm-logs": [

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475565383000",

        "comment": "",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475565392000",

        "comment": "",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475571304000",

        "comment": "",

        "state": "1",

        "value": "123.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1476714184000",

        "comment": "LoLo",

        "state": "0",

        "value": "0.0"

      }

    ]

  }

}

Notes

 

4.9.4 Retrieve alarm historical

No.

 

Title

Retrieve alarm historical

URL

/rest/api/public/v2/alarm-log/history/host-name/<hostname>

Method

GET

URL Params

hostname: IP address of device on Globiots system

fromDate: start point

toDate: end point

Data Params

{

    "responseCode": 200,

    "responseMessage": "",

    "data": {

        "count": 2,

        "alarms": [

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": "",

                "solution": "",

                "user": ""

            },

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": "",

                "solution": "",

                "user": ""

            }

        ]

    }

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

data: if response_code is 200 (Success), the data will be an array type.

    + count: number of record

    + alarms:

        - hostname: IP address of device on Globiots system.

        - address: address (hexadecimal) on memory map.

        - timestamp: time of occurence.

        - comment: Alarm commentation by user.

        - state: state of alarm (0 – LOLO, 1 – LO, 2 – NORMAL, 3 – HI, 4 – HIHI).

        - value: alarm value.

        - status: alarm status ("ack")

        - solution: commentation of user after acknowledging

        - user: user’s name of acknowledging

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than value of 'toDate' field

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/alarm-log/history/host-name/00000003?fromDate=1475254800000&toDate=1477846800000

Method: GET

URL Params:

      <host-name>: 00000003

      fromDate: 1475254800000

      toDate: 1477846800000

 

Response data:

{

  "responseMessage": "Success",

  "responseCode": 200,

  "data": {

    "count": 9,

    "alarm-logs": [

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475565383000",

        "comment": "",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475565392000",

        "comment": "",

        "state": "0",

        "value": "0.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475571304000",

        "comment": "",

        "state": "1",

        "value": "123.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475571440000",

        "comment": "HiHi ",

        "state": "4",

        "value": "2221.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475571634000",

        "comment": "LoLo",

        "state": "0",

        "value": "12.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1475572053000",

        "comment": "",

        "state": "2",

        "value": "345.0"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1476181914972",

        "comment": "LoLo",

        "state": "0",

        "value": "12.0",

        "status": "ack",

        "solution": "ggfhggh",

        "user": "superadmin"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1476181931394",

        "comment": "HiHi ",

        "state": "4",

        "value": "2221.0",

        "status": "ack",

        "solution": "hjgghghgh",

        "user": "superadmin"

      },

      {

        "hostname": "00000003",

        "address": "3000",

        "timestamp": "1476714184000",

        "comment": "LoLo",

        "state": "0",

        "value": "0.0"

      }

    ]

  }

}

 

Notes

 

4.10 Event Log Data

4.10.1 Retrieve event historical

No.

 

Title

Get event history data

URL

/rest/api/public/v2/event-log/history/host-name/<hostname>

Method

GET

URL Params

hostname: IP address of device on Globiots system.

fromDate: start point get data

toDate: end point get data

Data Params

{

    "responseCode": 200,

    "responseMessage": "",

    "data": {

        ''count'': 2,

        "events": [

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": ""

            },

            {

                "hostname": "",

                "address": "",

                "timestamp": 1435820730000,

                "comment": "",

                "state": "hi",

                "value": 0,

                "status": ""

            }

        ]

    }

}

 

responseCode: response code

responseMessage: response message (explain for response_code).

    data: if response_code is 200 (Success), the data will be an array type.

    + count: number of record

    + alarms:

        - hostname: IP address of device on Globiots system.

        - address: address (hexadecimal) on memory map.

        - timestamp: time of occurence.

        - comment: Alarm commentation by user.

        - state: state of alarm (0 – LOLO, 1 – LO, 2 – NORMAL, 3 – HI, 4 – HIHI).

        - value: alarm value.

        - status: alarm status ("ack").

Response code

200 : Success

401 : Unauthorized

402 : Hostname not found

408 : Value of 'fromDate' field is greater than value of 'toDate' field

409 : Data not found

Sample call

URL:

http://restest.globiots.com/rest/api/public/v2/event-log/history/host-name/00000003?fromDate=1475254800000&toDate=1477846800000

Method: GET

URL Params:

      <host-name>: 00000003

      fromDate: 1475254800000

      toDate: 1477846800000

 

Response data:

{

    "responseMessage": "Success",

    "responseCode": 200,

    "count": 3,

    "event-logs": [

        {

            "address": "3000",

            "timestamp": "1475571304000",

            "comment": "Comment",

            "state": "1",

            "value": "123.0",

            "priority": "255",

            "uniqueId": "1",

            "eventName": "Event 3000 > 100",

            "hostname": "00000003"

        },

        {

            "address": "3000",

            "timestamp": "1475571634000",

            "comment": "Comment",

            "state": "0",

            "value": "12.0",

            "priority": "255",

            "uniqueId": "1",

            "eventName": "Event 3000 > 100",

            "hostname": "00000003"

        },

        {

            "address": "3000",

            "timestamp": "1475572054000",

            "comment": "Comment",

            "state": "1",

            "value": "345.0",

            "priority": "255",

            "uniqueId": "1",

            "eventName": "Event 3000 > 100",

            "hostname": "00000003"

        }

    ]

}

Notes

 

 

5. Support Contacts

Distributor in Malaysia

AVO.png

AVO Technology Sdn. Bhd.

Official Website: www.avo.com.my

No. 17, Jalan 3/23A, Taman Danau Kota, 53300 Kuala Lumpur, Wilayah Persekutuan Kuala Lumpur, Malaysia

General : +603-4143 2288

Mobile : +012-376 7181
Fax : +603-4143 3388

Distributor in Australia and New Zealand

temploggerlogo.png

Templogger Pty Ltd

Tel: 1800 LOGGER

Email: contact@templogger.net

Manufacturer

logo.jpg

Dai Viet Controls & Instrumentation Company Ltd.
No.11 Street 2G, Nam Hung Vuong Res., An Lac Ward, Binh Tan Dist., Ho Chi Minh City, Vietnam.
Tel: +84-28-6268.2523/4 (ext.122)

Email: info@daviteq.com | www.daviteq.com