Skip to main content

Get Records

In Zoho IoT, a record is an entity which stores all the combined information of a particular model or module, which is acquired from various sources. The records API allows the user to get, create, update, delete, or search records.


Purpose

To retrieve the records that match your search criteria.

Endpoints

CopiedGET/{module_api_name}

GET/{module_api_name}/{record_id}

Request Details
 

Request URL

{api-domain}/iot/{version}/{module_api_name}

To get specific record:
https://zoho_iot_apis.com/iot/{version}/{module_api_name}/{record_id}
 

Supported modules

Devices, Assets, Locations, Alarms, Datapoints, Products, Manufacturers, Vendors, Certificates, Policies, Commands, Users.
 

Headers

Authorization: Zoho-oauthtoken {{oauth}}


Scope

scope=ZohoIOT.modules.{module_name}.{operation_type}


Possible module names

devices, assets, locations, alarms, datapoints, products, manufacturers, vendors, certificates, policies, commands, users.


Possible operation types

ALL - Full access to the record
READ - Get records from the module


Parameters

Param name, type, mandatory

  • per_page - int,optional

    To get the list of records available per page. The default and the maximum possible value is 20 and 200 respectively. 
    Possible values: Positive integer values only.

  • entity_id,long, optional

    To retrieve specific records based on their unique entity ID.
    Possible values: Valid unique IDs of records. Example: 2000000098001

  • relation_id,long, optional

    To retrieve specific records based on their unique relation ID.
    Possible values: Valid unique relation IDs of records. Example: 2000000077228

  • page,integer

    To get the list of records from the respective pages. The default value is 1
    Possible values: Positive integer values only.

  • cvid,long, optional

    To get the list of records based on custom views. Note that you cannot use this param with the "sort_by" param.You can get custom view id from Custom View Meta API
    Possible values: {custom_view_id}.

  • filter,JSONObject, optional

    To get the list of records based on the filter options.
    Possible values : Positive integer values only.

  • model_idlong, optional

    To get the list of records based on the model.
    Possible values: Valid unique model IDs of records. Example: 2000000077228

  • fields,string, optional

    To get the list of records for the specified field names.
    Possible valuesField API names as comma separated values.

  • sort_order,string, optional

    To sort the available list of records in either ascending or descending order.
    Possible values: asc ascending order, desc - descending order. The default value is 'desc'.

  • sort_by,string

    To sort the records based on the fields
    id, Created_Time, and Modified_Time.The default value is 'id'. Note that you cannot use this param with the "cvid" param.

Sample Request: First API Call

Copiedcurl --location -g '{{api-domain}}/iot/v1/assets?per_page=10&page=1' \
--header 'Authorization: Zoho-oauthtoken {{oauth}}' \
--header 'Content-Type: application/json'

Response to the First API Call

Copied{
    "assets": [
        {
            "layout": {
                "name": "Pheripheral asset model",
                "icon": "asset",
                "id": "308000000201239"
            },
            "connected_gateway": null,
            "parent_id": null,
            "connection_status": {
                "name": "Unconnected Asset",
                "color_code": "#F44336"
            },
            "located_at": null,
            "name": "Instance",
            "record_image": "rb97s7e2d8273a9f74b9ebe9f2588e5b58792",
            "id": "308000000201425",
            "status_update_time": {
                "millis_in_gmt": 1682504565000,
                "formatted": [
                    "5 months ago"
                ],
                "value": "2023-04-26T15:52:45"
            },
            "status": {
                "level": 5,
                "name": "Clear",
                "id": "308000000074953",
                "color_code": "#1CBC9D"
            }
        }
    ],
    "info": {
        "per_page": 10,
        "count": 1,
        "page": 1,
        "more_records": false
    }
}