Skip to main content

Put Records

Purpose   

To update existing entities in the module.

Endpoints

CopiedPUT /{module_api_name}

PUT /{module_api_name}/{record_id}

 

Request Details   


Request URL   

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

To update a specific record:
{api-domain}/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 api names   

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

Possible operation types   

ALL - Full access to the record
UPDATE - Put records in the module
 

Request JSON Keys  

  • id - String, mandatory

Specify the unique ID of the record that you want to update. Refer to Get Records API to get the unique ID of the record.

  • $modified_values JSON object, optional

Represents the value that has to be modified for the particular record.

Sample Request: First API Call

Copiedurl --location -g --request PUT '{{api-domain}}/iot/v1/trips/2000000087157' \
--header 'Authorization: Zoho-oauthtoken {{oauth}}' \
--header 'Content-Type: application/json' \
--data '{

{"assets":{"name":"a1","connected_gateway":"469000000187815","edge_name":"","located_at":"469000000217089","serial_id":"","geolocation":null,"model_id":"469000000050182","undefined":"469000000167203","id":"469000000177001"}}
}'

Sample Input

Copied{"assets":{"record_image":"kzzrdc697e5ef5d44427d9260974404f29d13","name":"a1","description":"","connected_gateway":"469000000187815","edge_name":"","located_at":"469000000217089","serial_id":"","geolocation":null,"model_id":"469000000050182","undefined":"469000000167203","id":"469000000177001"}}

Sample Output

Copied{
    "assets": [
        {
            "code": "SUCCESS",
            "name": "a1",
            "id": "469000000177001",
            "message": "record updated",
            "status": "success"
        }
    ]
}