NAV Navbar
example
  • Introduction
  • Technical Overview
  • Connectivity
  • Data Logger
  • OAuth2.0
  • Errors
  • RESTful APIs
  • Introduction

    The ORing IIoT Platform is a powerful managed cloud platform designed for industrial IoT applications, it provides all the back-end functionality needed to operate large-scale IoT solutions. With support for MQTT and CoAP protocols, you can easily connect your devices to the platform and interact with cloud applications.

    ORing IIoT Platform offers the following features:

    For more information, please visit our website.

    Technical Overview

    The ORing IIoT Platform is the best choice for rapid IoT application development, it can be deployed in public and private cloud or even hybrid cloud.

    Function Block

    The platform consists of 4 main features which are as follows:

    Account Management:

    Account Architecture

    Thing Management:

    Application Management

    Data Logger

    IoT Protocols

    All communication between ORing IIoT Platform and devices/gateways/apps are through the following open standard protocols: HTTPS, MQTT, CoAP.

    With protocol bridging technology, ORing IIoT Platform allows two devices communicate by different protocols, for example, device A publishs a message via MQTT and device B can receive the data via CoAP observe.

    Protocol Bridging Scenario: CoAP --> MQTT

    Protocol Bridging Scenario: MQTT --> CoAP

    Connectivity

    ORing IIoT Platform supports MQTT and CoAP protocols, the server's address and port are shown in the table below.

    Address Port Description
    mqtt.iiot.oringnet.cloud 1883 MQTT Port
    mqtt.iiot.oringnet.cloud 8083 MQTT/SSL Port
    mqtt.iiot.oringnet.cloud 8883 MQTT/WebSocket Port
    mqtt.iiot.oringnet.cloud 8884 MQTT/WebSocket/SSL
    coap.iiot.oringnet.cloud 5683 CoAP Port

    Connect Authentication

    When you create a thing on the platform, we will generate a unique thing id and thing secret automatically, you can get your thing's connection credentials via RESTful API or User console thing management page.

    MQTT Topic Authentication

    With thing id and thing secret, you can use it to publish or subscribe thing's topics.

    MQTT Topic Pattern

    thing/:thingId/:secret/${WHAT_EVER_YOU_WANT}

    CoAP Authentication

    With thing id and thing secret, you can use it to GET or PUT CoAP endpoint.

    CoAP Endpoint Pattern

    coap://coap.iiot.oringnet.cloud:5683/${thingId}/${secret}/${WHAT_EVER_YOU_WANT}.

    Data Logger

    Collecting and analyzing data from connected devices is one of the most recurring IoT use cases. Data Logger service make these tasks totally straightforward, even at massive scale.

    Data Logger is a powerful service to storage your IoT sensor data. With Data Logger you can easily store the data from your IoT sensors and things safely and securely. We also provide RESTful APIs let you manage your data remotely. All of your sensor data are protected by OAuth 2.0 server and no one can access your data without being authorized.

    Data Logger can be separated into Data bucket and Data shape, please see details below.

    Data Bucket

    For example, you have a 3 in 1 sensor which will upload temperature, humidity, and pm2.5 values periodically. In this scenario, you can create a data bucket called sensorData to aggregate all the sensor data.

    Data Shape

    Data shape is used for describing what data will present in the data bucket. As the scenario above, the sensorData data bucket should have three data shapes:

    1. {"dataId": "temperature", "valueType": "float"}

    2. {"dataId": "humidity", "valueType": "float"}

    3. {"dataId": "pm2-5", "valueType": "float"}

    Upload Data

    After data bucket and data shapes are set, you can connect your thing to the platform and start to upload sensor data.

    Upload data via MQTT

    MQTT simulator example in Javascript

    import mqtt from 'mqtt';
    const client = mqtt.connect('mqtt://mqtt.iiot.oringnet.cloud:8083');
    client.on('connect', () => {
      client.publish('thing/H18g6433W/CV9IFMDfEblfnj2m/sensorData',
      JSON.stringify(
        [
          {
            id: 'temperature',
            value: 25.01,
          },
          {
            id: 'humidity',
            value: 0.75,
          },
          {
            id: 'pm2-5',
            value: 11,
          },
        ],
      ));
    });
    

    If you are using MQTT protocol, just connect your thing to the platform's MQTT broker and publish data to the specific topic.

    The pattern of the topic is thing/:thingId/:secret/:bucketId where :bucketId should be sensorData as the scenario above.

    Upload data via CoAP

    CoAP simulator example in Javascript

    import coap from 'coap';
    const req = coap.request({
      host: 'coap.iiot.oringnet.cloud',
      port: 5683,
      pathname: 'thing/H18g6433W/CV9IFMDfEblfnj2m/sensorData',
      method: 'PUT',
    });
    req.write(JSON.stringify({
      id: 'temperature',
      value: Math.floor(Math.random() * 100),
    }));
    req.on('response', (res) => {
      res.pipe(process.stdout);
    });
    req.end();
    

    If you are using CoAP protocol, just send a request with PUT method to the thing's CoAP endpoint.

    The pattern of the CoAP endpoint is coap://coap.iiot.oringnet.cloud:5683/:thingId/:secret/:bucketId.

    Upload Sensor Data

    Transform Function

    If you need to do data correction and filtering before the data being stored, ORing IIoT Platform provides transform function.

    Each Data Shape can define one transform function. Once the new data arrived, the pre-defined transform function will be executed.

    The transform function is a pure function written in Javascript, the function takes the original data from your device as input, after the caculation inside the function, it will return a new tranformed value.

    Usage Example

    For example, the original data format published by device:

    { "id": "Temperature", "value": ["2501"]}

    In order to get the real value 25.01 degree, we need to extract the string value "2501" from the value[0], and parse it into number and divide it by 100.

    1. Create a Temperature data shape in the sensorData data bucket.

    2. Define a transform function to the Temperature data shape.

    Transform Function

    Transform Function Correction Example

    return parseInt(context.value[0], 10) / 100;
    

    Transform Function Filter Example

    /**
      *
      * Return null to filter out
      * the value that less than 100.
      */
    if(context.value < 100) return null;
    return context.value;
    

    OAuth2.0

    ORing IIoT Platform OAuth 2.0 is ORing's secure and safe server-based authorization program. It provides a simple, straight-forward method of authentication and solid protection for your personal data.

    Before using the ORing OAuth 2.0, please login to the user console application management page to create an application.

    Authorization URL

    https://api.iiot.oringnet.cloud/v1/oauth/authorize

    Token URL

    https://api.iiot.oringnet.cloud/v1/oauth/token

    OAuth2.0 Scopes

    Scopes pattern

    There are three levels of scopes available to applications.

    1. read: Perform read only access to the specific api, including GET method.

    2. write: Perform read and write access to the specific api, including GET, POST, and PATCH methods.

    3. admin: Perform full access to the specific api, including GET, POST, PATCH and DELETE methods.

    Name Description Public
    admin:* Grants full access to the organization's resource, except create, update, and delete members. false
    admin:app Grants read, write and delete access to organization's applications. Superset of read:app, write:app. false
    write:app Grants write access to organization's applications. Superset of read:app. false
    read:app Grants read-only access to organization's applications and public applications on the app store. false
    write:org Grants read, write access to organization's profile. Superset of read:org. false
    write:user Grants write access to user's profile. Superset of read:user. false
    read:user Grants read-only access to user's profile. true
    read:org Grants read-only access to organization's profile. true
    read:org_member Grants read-only access to organization's members. true
    admin:thing Grants read, write and delete access to things and thing's categories. Superset of read:thing, write:thing. true
    write:thing Grants read, write access to things and thing's categoies. Superset of read:thing. true
    read:thing Grants read-only access to things and thing's categoies. true
    admin:data_bucket Grants read, write and delete access to data buckets and datas inside the bucket. Superset of read:data_bucket, write:data_bucket. true
    write:data_bucket Grants read, write access to data buckets. Superset of read:data_bucket. true
    read:data_bucket Grants read-only access to data buckets and datas inside the bucket. true

    Authorization Code Grant

    The Authorization Code grant is used by server-side clients that are capable of securely storing secrets.

    Step 1:

    The client will redirect user to the authorization server's authorization URL with the following query string parameters:

    Example Request

    curl -X GET \
      'https://api.iiot.oringnet.cloud/v1/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&state=SECURE_RANDOM' \
      -H 'cache-control: no-cache'
    
    Parameter Type Required Description
    client_id string Required Registered application’s client ID.
    redirect_uri string Required URL server would redirect to after authorization has been completed, the URL should be encoded.
    response_type string Required Fixed value: 'code'.
    state string Optional A random state value that will be returned, it use for prevent cross-site request forgery attacks.

    Step 2:

    The client will send a POST request to the authorization server's token URL with the following parameters:

    Example Request

    curl -X POST \
      https://api.iiot.oringnet.cloud/v1/oauth/token \
      -H 'cache-control: no-cache' \
      -H 'content-type: application/json' \
      -d '{
        "grant_type":"authorization_code",
        "client_id": "YOUR_CLIENT_ID",
        "client_secret": "YOUR_CLIENT_SECRET",
        "redirect_uri": "YOUR_REDIRECT_URI",
        "code": "xxxxxxxx"
    }'
    
    Parameter Type Required Description
    grant_type string Required Fixed value: 'authorization_code'.
    client_id string Required Registered application’s client ID.
    client_secret string Required Registered application’s client credential.
    redirect_uri string Required URL server would redirect to after authorization has been completed, the URL should be encoded.
    code string Required Authorization code returned by step 1.

    The authorization server will respond a JSON object containing the following properties:

    Parameter Type Description
    access_token string RESTful API access token.
    token_type string Fixed value: 'Bearer'.
    expires_in integer TTL of the access token.

    Example Response

      {
        "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",
        "token_type": "Bearer",
        "expires_in": 604800
      }
    

    Implicit Grant

    The Implicit grant is used by clients that are incapable of securely storing secrets, such as single-page JavaScript applications.

    Step 1:

    The client will redirect user to the authorization server's authorization URL with the following query string parameters:

    Example Request

    curl -X GET \
      'https://api.iiot.oringnet.cloud/v1/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=token&state=SECURE_RANDOM'
    
    Parameter Type Required Description
    client_id string Required Registered application’s client ID.
    redirect_uri string Required URL server would redirect to after authorization has been completed, the URL should be encoded.
    response_type string Required Fixed value: 'token'.
    state string Optional A random state value that will be returned, it use for prevent cross-site request forgery attacks.

    Step 2:

    After the user authorize the client, the authorization server will redirect back to the client redirect_uri. The redirection URI includes the access token in the URI fragment.

    Example Response

      https://www.your-app.com/oauth/callback#access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ&token_type=Bearer&expires_in=604800
    

    The user-agent executes the script provided by the web-hosted client resource locally, which extracts the access token.

    Errors

    HTTP Status Codes

    ORing IIoT Platform uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error caused by the information provided (i.e., a required parameter was omitted, a method was not found, etc.), and codes in the 5xx range indicate an error with server (these are rare).

    Code Status Text Description
    200 OK The request has succeeded. The meaning of a success varies depending on the HTTP method:
    GET: The resource has been fetched and is transmitted in the message body.
    PATCH: The resource has been updated.
    201 Created The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a POST request.
    202 Accepted The request has succeeded and has been added to the queue, but the resource has not yet been created. This is typically the response sent after PUT and POST requests.
    204 No Content There is no content to send for this request. This is common for DELETE requests.
    400 Bad Request This response means that server could not understand the request due to invalid syntax.
    401 Unauthorized Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible.
    403 Forbidden Client does not have access rights to the content so server is refusing to give proper response.
    404 Not Found Server cannot find the requested resource.
    409 Conflict This response would be sent when a request conflicts with the current state of the server.
    50X Internal Server Error The server has encountered some situations and temporarily unable to service your request.

    RESTful APIs

    Along with the ORing IIoT Platform, RESTful API will be provided to help you track your device connectivity and access data from all of your devices. The ORing IIoT Platform provides serveral RESTful APIs, Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors.

    API Endpoint

    https://api.iiot.oringnet.cloud/v2

    Example Request

    curl https://api.iiot.oringnet.cloud/v2/me \
            -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
    

    Making requests

    When making an API call, bring your access token in the authorization header.

    Authorization: Bearer <access_token>

    Get Me

    Get current user's profile. Return a JSON object.

    Example Response

    {
      "status": {
        "error": false,
        "type": "success",
        "message": "Success."
      },
      "data": {
        "id":"nYrnfYEv",
        "email":"oring@oringnet.com",
        "role":"admin",
        "name":"ORing Boss",
        "avatar":null,
        "jobTitle":"CEO",
        "orgId":"a4vhAoFG",
        "createdAt":1501839433000,
        "updatedAt":1502102987000,
        "authorizedScopes":[  
            "read:user"
        ]
      }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/me

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Organization Profile

    Get organization profile. Return a JSON object.

    Example Response

    {
      "status": {
        "error": false,
        "type": "success",
        "message": "Success."
      },
      "data": {
        "id": "a4vhAoFG",
        "name": "oringnet",
        "displayName": "ORing Industrial Networking Corp",
        "status": "active",
        "description": "ORing Industrial Networking Corp. the global leading brand company, established in 2005 and focuses on innovation of Industrial networking products.",
        "website": "http://oringnet.com",
        "location": "3F., No.542-2, Zhongzheng Rd., Xindian Dist., New Taipei City 23148, Taiwan (R.O.C)",
        "email": "info@oringnet.com",
        "billingEmail": "fa@oring-networking.com",
        "createdAt": 1506935702000,
        "updatedAt": 1506935702000
      }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/orgs/:orgId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Members

    Get organization's members. Return an array with member JSON objects.

    Example Response

    {
      "status": {
        "error": false,
        "type": "success",
        "message": "Success."
      },
      "data": [
        {
          "id": "nYrnfYEv",
          "email": "oring@oringnet.com",
          "role": "admin",
          "name": "K",
          "avatar": null,
          "jobTitle": "CEO",
          "orgId": "a4vhAoFG",
          "createdAt": 1501839433000,
          "updatedAt": 1502102987000
        },
        {
          "id": "rJX43o5PZ",
          "email": "test_oring@oringnet.com",
          "role": "member",
          "name": "test",
          "avatar": null,
          "jobTitle": null,
          "orgId": "a4vhAoFG",
          "createdAt": 1502424107000,
          "updatedAt": 1502424107000
        }
      ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/orgs/:orgId/members

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Create Thing Category

    Create a thing category. Thing category's name must be unique. Return the created thing category JSON object.

    Example Request Body

    {
        "name":"my-category",
        "description": "test."
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "BJEBi_mKG",
            "name": "my-category",
            "description": "test.",
            "createdAt": 1520827195634,
            "updatedAt": 1520827195634
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing-categories

    Parameter Type Required Description
    name string Required thing-category's name, cannot be duplicate and must match /^[a-zA-Z0-9\-]+$/ pattern.
    description string Optional thing-category's description.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Thing Categories

    Get thing categories. Return an array with thing category JSON object.

    Query Parameters

    Query Examples

    https://api.iiot.oringnet.cloud/v2/thing-categories?limit=5

    https://api.iiot.oringnet.cloud/v2/thing-categories?name=magicity-sensor

    http://api.iiot.oringnet.cloud/v2/thing-categories?sort=+createdAt

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "paging": {
            "beforeCursor": null,
            "afterCursor": "WyIyMDE4LTAxLTE3VDAwOjAwOjEyLjAwMFoiLDEyXQ==",
            "previousLink": null,
            "nextLink": "https://api.iiot.oringnet.cloud/v2/thing-categories?limit=2&nextCursor=WyIyMDE4LTAxLTE3VDAwOjAwOjEyLjAwMFoiLDEyXQ%3D%3D"
        },
        "metadata": {
            "totalCount": 3
        },
        "data": [
            {
                "id": "SkS85Jbzz",
                "name": "magicity-sensor",
                "description": null,
                "createdAt": 1516147217000,
                "updatedAt": 1513318989000
            },
            {
                "id": "SJaXmealM",
                "name": "magicity-streetlight",
                "description": null,
                "createdAt": 1516147212000,
                "updatedAt": 1512010532000
            }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing-categories

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Thing Category by ID

    Get specific thing category information by ID. Return a thing category JSON object.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "SkS85Jbzz",
            "name": "magicity-sensor",
            "description": null,
            "createdAt": 1516147217000,
            "updatedAt": 1513318989000
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing-categories/:categoryId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Update Thing Category by ID

    Update specific thing category information by ID. Return the updated thing category JSON object.

    Example Request Body

    {
        "description": "updated."
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "BJEBi_mKG",
            "name": "my-category",
            "description": "updated.",
            "createdAt": 1520827195000,
            "updatedAt": 1520832535227
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing-categories/:categoryId

    Parameter Type Required Description
    name string Optional thing-category's name, cannot be duplicate and must match /^[a-zA-Z0-9\-]+$/ pattern.
    description string Optional thing-category's description.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Delete Thing Category by ID

    Delete a specific thing category by ID.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing-categories/:categoryId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Create Thing

    Create a thing.

    Thing Attributes

    Example Request Body

    {
        "name":"my-thing",
        "description": "my awesome thing.",
        "categoryName": "magicity-sensor",
        "attributes": {
            "serialNumber": "12345678",
            "manufacture": "ORingnet"
        }
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "Hklmc5mtz",
            "name": "my-thing",
            "secret": "bMZavx9Zfsjf8Pt0",
            "description": "my awesome thing.",
            "status": "active",
            "attributes": {
                "serialNumber": "12345678",
                "manufacture": "ORingnet"
            },
            "category": {
                "id": "SkS85Jbzz",
                "name": "magicity-sensor",
                "description": null,
                "createdAt": 1516147217000,
                "updatedAt": 1513318989000
            },
            "createdAt": 1520835095524,
            "updatedAt": 1520835095524
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things

    Parameter Type Required Description
    name string Required thing's name, between 1 and 255 chars long.
    categoryName string Required classified thing category name.
    attributes string Optional thing's attributes, require a json object.
    description string Optional thing's description, between 1 and 500 chars long.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Things

    Get thing list. Return an array with thing JSON object.

    Query Parameters

    Query Examples

    https://api.iiot.oringnet.cloud/v2/things?limit=5

    https://api.iiot.oringnet.cloud/v2/things?categoryName=magicity-streetlight

    https://api.iiot.oringnet.cloud/v2/things?attributes={"poleId":99079323}

    http://api.iiot.oringnet.cloud/v2/things?status=active

    http://api.iiot.oringnet.cloud/v2/things?sort=+createdAt

    https://api.iiot.oringnet.cloud/v2/things?extend=dataLogger

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "paging": {
            "beforeCursor": null,
            "afterCursor": "WyIyMDE4LTAxLTE3VDAwOjA5OjU3LjAwMFoiLDU5N10=",
            "previousLink": null,
            "nextLink": "https://api.iiot.oringnet.cloud/v2/things?limit=2&nextCursor=WyIyMDE4LTAxLTE3VDAwOjA5OjU3LjAwMFoiLDU5N10%3D"
        },
        "metadata": {
            "totalCount": 382
        },
        "data": [
            {
                "id": "H19gE0j_z",
                "name": "hfsd",
                "secret": "AClX9gL6rQyDVpKN",
                "description": "ddd",
                "status": "active",
                "attributes": {},
                "category": {
                    "id": "SkS85Jbzz",
                    "name": "magicity-sensor",
                    "description": null,
                    "createdAt": 1516147217000,
                    "updatedAt": 1513318989000
                },
                "createdAt": 1520325618000,
                "updatedAt": 1520325683000
            },
            {
                "id": "HylMR8xOGbG",
                "name": "99079323",
                "secret": "LLixlHsX3wcqilW6",
                "description": "",
                "status": "active",
                "attributes": {
                    "poleId": "99079323",
                    "location": [
                        121.0889335,
                        14.6203941
                    ]
                },
                "category": {
                    "id": "SJaXmealM",
                    "name": "magicity-streetlight",
                    "description": null,
                    "createdAt": 1516147212000,
                    "updatedAt": 1512010532000
                },
                "createdAt": 1516147807000,
                "updatedAt": 1520235799000
            }
        ]
    }
    

    Example Response With Data Logger Extension

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "paging": {
            "beforeCursor": null,
            "afterCursor": "WyIyMDE4LTAxLTE3VDAwOjEwOjA3LjAwMFoiLDYwN10=",
            "previousLink": null,
            "nextLink": "https://api.iiot.oringnet.cloud/v2/things?extend=dataLogger&limit=1&nextCursor=WyIyMDE4LTAxLTE3VDAwOjEwOjA3LjAwMFoiLDYwN10%3D"
        },
        "metadata": {
            "totalCount": 381
        },
        "data": [
        {
            "id": "HylMR8xOGbG",
            "name": "99079323",
            "secret": "LLixlHsX3wcqilW6",
            "description": "",
            "status": "active",
            "dataLoggerExtend": [
                {
                    "bucketId": "report",
                    "dataShapeslastRecord": [
                        {
                            "dataId": "wanrssi",
                            "valueType": "float",
                            "value": null,
                            "recordAt": null
                        },
                        {
                            "dataId": "voltage",
                            "valueType": "float",
                            "value": 105.655,
                            "recordAt": 1519972455741
                        },
                        {
                            "dataId": "current",
                            "valueType": "float",
                            "value": 0.004,
                            "recordAt": 1519972455741
                        },
                        {
                            "dataId": "rssi",
                            "valueType": "float",
                            "value": -113,
                            "recordAt": 1519972455741
                        },
                        {
                            "dataId": "status",
                            "valueType": "float",
                            "value": null,
                            "recordAt": null
                        },
                        {
                            "dataId": "brightness",
                            "valueType": "float",
                            "value": 0,
                            "recordAt": 1519972455741
                        },
                        {
                            "dataId": "power",
                            "valueType": "float",
                            "value": null,
                            "recordAt": null
                        }
                    ]
                },
                {
                    "bucketId": "command",
                    "dataShapeslastRecord": [
                        {
                            "dataId": "brightness",
                            "valueType": "float",
                            "value": null,
                            "recordAt": null
                        }
                    ]
                }
            ],
            "attributes": {
                "poleId": "99079323",
                "location": [
                    121.0889335,
                    14.6203941
                ]
            },
            "category": {
                "id": "SJaXmealM",
                "name": "magicity-streetlight",
                "description": null,
                "createdAt": 1516147212000,
                "updatedAt": 1512010532000
            },
            "createdAt": 1516147807000,
            "updatedAt": 1520235799000
        }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v1/things

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Thing by ID

    Get specific thing information. Return a thing JSON object.

    Query Parameters

    Query Examples

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG?extend=dataLogger

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "HylMR8xOGbG",
            "name": "99079323",
            "secret": "LLixlHsX3wcqilW6",
            "description": "",
            "status": "active",
            "attributes": {
                "poleId": "99079323",
                "location": [
                    121.0889335,
                    14.6203941
                ]
            },
            "category": {
                "id": "SJaXmealM",
                "name": "magicity-streetlight",
                "description": null,
                "createdAt": 1516147212000,
                "updatedAt": 1512010532000
            },
            "createdAt": 1516147807000,
            "updatedAt": 1520235799000
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing/:thingId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Update Thing by ID

    Update specific thing information by ID. Return the updated thing JSON object.

    Example Request Body

    {
        "name":"new-name"
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "Hklmc5mtz",
            "name": "new-name",
            "secret": "bMZavx9Zfsjf8Pt0",
            "description": "my awesome thing.",
            "status": "active",
            "attributes": {
                "serialNumber": "12345678",
                "manufacture": "ORingnet"
            },
            "category": {
                "id": "SkS85Jbzz",
                "name": "magicity-sensor",
                "description": null,
                "createdAt": 1516147217000,
                "updatedAt": 1513318989000
            },
            "createdAt": 1520835095000,
            "updatedAt": 1520835598711
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing/:thingId

    Parameter Type Required Description
    name string Required thing's name, between 1 and 255 chars long.
    categoryName string Required classified thing category name.
    attributes string Optional thing's attributes, require a json object.
    description string Optional thing's description, between 1 and 500 chars long.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Delete Thing by ID

    Delete a specific thing by ID.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing/:thingId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Create Data Bucket

    Create thing's data bucket. Return the created data bucket JSON object.

    Example Request Body

    {
        "bucketId":"my-bucket",
        "description": "My demo bucket."
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "my-bucket",
            "description": "My demo bucket.",
            "createdAt": 1520837270072,
            "updatedAt": 1520837270072
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets

    Parameter Type Required Description
    bucketId string Required Data bucket's identifier, between 1 and 20 chars long and match /^[a-zA-Z0-9_-]+$/ pattern.
    description string Optional Data bucket's description, between 1 and 500 chars long.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Buckets

    Get thing's data buckets. Return an array with data bucket JSON object.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": [
            {
                "id": "report",
                "description": null,
                "createdAt": 1512370298000,
                "updatedAt": 1512370298000,
                "dataShapes": [
                    {
                        "id": "wanrssi",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "voltage",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "current",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "rssi",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "status",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "brightness",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    },
                    {
                        "id": "power",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    }
                ]
            },
            {
                "id": "command",
                "description": null,
                "createdAt": 1512370298000,
                "updatedAt": 1512370298000,
                "dataShapes": [
                    {
                        "id": "brightness",
                        "valueType": "float",
                        "transformFunction": null,
                        "createdAt": 1512370358000,
                        "updatedAt": 1512370358000
                    }
                ]
            },
            {
                "id": "my-bucket",
                "description": "My demo bucket.",
                "createdAt": 1520837270000,
                "updatedAt": 1520837270000,
                "dataShapes": [
                    {
                        "id": "temperature",
                        "valueType": "float",
                        "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs=",
                        "createdAt": 1520837661000,
                        "updatedAt": 1520837661000
                    }
                ]
            }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Bucket by ID

    Get specific thing's data bucket information by ID. Return a data bucket JSON object.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "report",
            "description": null,
            "createdAt": 1512370298000,
            "updatedAt": 1512370298000,
            "dataShapes": [
                {
                    "id": "wanrssi",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "voltage",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "current",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "rssi",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "status",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "brightness",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                },
                {
                    "id": "power",
                    "valueType": "float",
                    "transformFunction": null,
                    "createdAt": 1512370358000,
                    "updatedAt": 1512370358000
                }
            ]
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Delete Data Bucket by ID

    Delete specific data bucket by ID.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/thing/:thingId/data-buckets/:bucketId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Create Data Shape

    Create specific data bucket's data shape. Return the created data shape JSON object.

    Example Request Body

    {
        "dataId":"temperature",
        "valueType": "float",
        "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs="
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "temperature",
            "valueType": "float",
            "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs=",
            "createdAt": 1520837661496,
            "updatedAt": 1520837661496
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes

    Parameter Type Required Description
    dataId string Required Data's identifier.
    valueType string Required Must be one of (string, integer, float, hex, gps, boolean).
    transformFunction string Optional Base-64 enconding string.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Shapes

    Get specific data bucket's data shapes. Return an array with data shape JSON object.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": [
            {
                "id": "temperature",
                "valueType": "float",
                "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs=",
                "createdAt": 1520837661000,
                "updatedAt": 1520837661000
            }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Shape by ID

    Get specific data bucket's data shape by ID. Return a data shape JSON object.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "temperature",
            "valueType": "float",
            "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs=",
            "createdAt": 1520837661000,
            "updatedAt": 1520837661000
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes/:dataId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Update Data Shape by ID

    Update specific data bucket's data shape by ID. Return the updated data shape JSON object.

    Example Request Body

    {
        "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs="
    }
    

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "id": "temperature",
            "valueType": "float",
            "transformFunction": "aWYoY29udGV4dC52YWx1ZVswXSA8IDEwMCkgcmV0dXJuIG51bGw7DQpyZXR1cm4gY29udGV4dC52YWx1ZVswXTs=",
            "createdAt": 1520837661000,
            "updatedAt": 1520837661000
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes/:dataId

    Parameter Type Required Description
    transformFunction string Optional Base-64 enconding string.

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Delete Data Shape by ID

    Delete specific data bucket's data shape by ID.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        }
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v1/things/:thingId/data-buckets/:bucketId/data-shapes/:dataId

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Record

    Get data inside the specific data bucket with selected data shape.

    Query Parameters

    Query Examples

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?limit=100

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?start=1519972455741

    Timeline

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?end=1519972455741

    Timeline

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?start=1519972455272&end=1519972453977

    Timeline

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?sort=+recordAt

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "paging": {
            "beforeCursor": null,
            "afterCursor": "WzE1MTk5NzI0NTU1NTcsMTIyMDU2XQ==",
            "previousLink": null,
            "nextLink": "https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/data?limit=2&nextCursor=WzE1MTk5NzI0NTU1NTcsMTIyMDU2XQ%3D%3D"
        },
        "metadata": {
            "totalCount": 4
        },
        "data": [
            {
                "value": 105.655,
                "recordAt": 1519972455741
            },
            {
                "value": 105.655,
                "recordAt": 1519972455557
            }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes/:dataId/data

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Data Bucket Last Record

    Get specific data bucket's last record of each data shape.

    Example Response

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": [
            {
                "dataId": "wanrssi",
                "valueType": "float",
                "value": null,
                "recordAt": null
            },
            {
                "dataId": "voltage",
                "valueType": "float",
                "value": 105.655,
                "recordAt": 1519972455741
            },
            {
                "dataId": "current",
                "valueType": "float",
                "value": 0.004,
                "recordAt": 1519972455741
            },
            {
                "dataId": "rssi",
                "valueType": "float",
                "value": -113,
                "recordAt": 1519972455741
            },
            {
                "dataId": "status",
                "valueType": "float",
                "value": null,
                "recordAt": null
            },
            {
                "dataId": "brightness",
                "valueType": "float",
                "value": 0,
                "recordAt": 1519972455741
            },
            {
                "dataId": "power",
                "valueType": "float",
                "value": null,
                "recordAt": null
            }
        ]
    }
    

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes-last-record

    SUCCESS STATUS CODE

    REQUIRED SCOPE

    Get Statistic of Data Record

    Get summary statistic of specific data bucket with selected data shape, including sum, avg, max and min.

    The data shape's valueType must be one of integer, float and hex.

    Example Response (groupByDate = true)

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": [
            {
                "recordDate": "2018-03-02",
                "sum": 422.6199951171875,
                "avg": 105.65499877929688,
                "max": 105.655,
                "min": 105.655
            }
        ]
    }
    

    Example Response (groupByDate = false)

    {
        "status": {
            "error": false,
            "type": "success",
            "message": "Success."
        },
        "data": {
            "sum": 422.6199951171875,
            "avg": 105.65499877929688,
            "max": 105.65499877929688,
            "min": 105.65499877929688
        }
    }
    

    Query Parameters

    Query Examples

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/statistic?dateIn=2018-01-31

    https://api.iiot.oringnet.cloud/v2/things/HylMR8xOGbG/data-buckets/report/data-shapes/voltage/statistic?dateIn=2018-01-31to2018-12-31

    HTTP REQUEST

    https://api.iiot.oringnet.cloud/v2/things/:thingId/data-buckets/:bucketId/data-shapes/:dataId/statistic

    SUCCESS STATUS CODE

    REQUIRED SCOPE