The "alterThing" action modifies an existing object to represent a sensor, device, equipment, server, software application, etc.
Request examples
Minimal
{
"action": "alterThing",
"params": {
"id": 1,
"newThingName": "My New Device Name"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "",
"action": "alterThing",
"params": {
"id": 2,
"newThingName": "Changed Name",
"status": "inactive",
"manufacturer": "Changed Manufacturer",
"model": "Changed Device Model",
"serialNumber": "Changed Serial Number",
"thingType": "Changed Device Type",
"purpose": "Changed Device Purpose",
"location": "Changed Device Location",
"lifecycleLabels": ["out-of-warranty", "deprecated"],
"hostnames": [ "ChangedHostname","unchangedHostName" ],
"description": "Changed description.",
"metadata": { "myProperty": "myValue" },
"photo": "ffd8ffee002141646f62650064400000000103001003020306",
"binaryFormat": "hex"
},
"responseOptions": {
"binaryFormat": "base64",
"dataFormat": "objects",
"numberFormat": "string",
"variantFormat": "variantObject"
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "1",
"debug": "none"
}
Response examples
Minimal
{
"result": {
"id": 1,
"thingName": "My New Device Name",
//...use the values for "My Device" in the response to describeThings...
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"errorCode": 0,
"errorMessage": ""
}Maximal
{
"result": {
"id": 2,
"thingName": "Changed Name",
//...use the values for "Changed Name" in the response to describeThings...
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "1",
"errorCode": 0,
"errorMessage": ""
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
binaryFormat |
The "binaryFormat" property designates the format of binary values embedded in JSON strings. For more details, see "binaryFormat". |
Optional with default of "hex"
|
string | One of the following: "base64", "hex", or "byteArray". |
description |
The "description" property describes objects such as code packages, labels, or things. The server indexes this field with a full-text index so that you can search for any word or phrase. You cannot use this property for filtering in the Thing API. |
Optional with default of "unknown" |
string | 1 to 512 bytes |
hostnames |
The
When you use the
The Thing API implements the
|
Optional with default of []
|
string | Array of user-defined hostnames. Each hostname is a string from 0 to 64 bytes. Values are managed in the Label API with the group of "faircom/hostnames". |
id |
The |
Automatically generated by the server | integer |
|
lifecycleLabels |
The "lifecycleLabels" property assigns zero or more lifecycle labels to a thing. You can use it for fast lookups and filtering. |
Optional with default of []
|
array of strings |
"archived""acquired""deprecated""decommissioned""disposed""end-of-life""out-of-warranty""operational""testing""unknown"
|
location |
The
This API uses the Label API to manage manufacturers.
|
Optional with default of "unknown"
|
string |
1 to 64 bytes Values are managed in the Label API with the group of |
manufacturer |
The
This API uses the Label API to manage manufacturers.
|
Optional with default of "unknown"
|
string | 1 to 64 bytes |
metadata |
The "metadata" property contains user-defined properties that add keywords and tags about the code package. The server indexes this field with a full-text index so you can search for any word or phrase to find code packages. |
Optional with default of {}
|
object | 0 or more key/value pairs |
model |
The
This API uses the Label API to manage models.
|
Optional with default of "unknown"
|
string | 1 to 64 bytes |
newThingName |
The
|
Optional with default of ""
|
string | 1 to 64 bytes |
photo |
The "photo" property contains a photo of a thing. You cannot use it for lookups and filtering. |
Optional with default of null
|
string containing a binary value | Up to 2 GB |
purpose |
The
In the Thing API, the
The Thing API uses the Label API to manage purposes.
|
Optional with default of
|
string | 1 to 64 bytes |
serialNumber |
The "serialNumber" property specifies a thing's serial number. Typically a serial number uniquely identifies a thing, but things from different manufacturers may have the same serial numbers. You can use it to do partial lookups and filtering. |
Optional with default of "unknown"
|
string | 1 to 64 bytes |
status |
The
When the
To create, alter, and list inactive items, set the |
Optional with default of "active"
|
string enum |
|
thingType |
The
This API uses the Label API to manage types.
|
Optional with default of "unknown"
|
string | 1 to 64 bytes |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
id |
The |
integer |
|
thingName |
The "thingName" property specifies the unique name of a thing. It cannot be the empty string "". |
string | 1 to 64 bytes |