Update a data source

PATCH/homes/{homeId}/dataSources/{dataSourceKey}

Base URL: https://api.tinkermode.com

Update the data source with the specified key. deviceId is optional and must be the ID of a device in the home.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user API key, a service account token, or a project API key with "Admin" privileges.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique ID for a specified home.
dataSourceKeystringYesA compound key consisted catalogId, sourceId, and deviceId with the separator :: e.g. bu01::a4dd89297bfd::1234. The device ID is optional when the data source is associated with integration module e.g. heartbeat::sensor-1 or heartbeat::sensor-1::0

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
attributesobjectNoOptional/informational key-values associated with device. Can be used to store the serial number, for example.
catalogIdstringYesread-only (server-generated)Data Source Catalog ID.
createdAtstringNoread-only (server-generated); format: date-timeTimestamp of data source creation.
dataTypesarray<string>Noread-only (server-generated)Data types of the data source. It must be one of the supported data types: metrics, locations, and customLog. These values are annotations for filtering data sources in data route panel.
deliveryPolicystringNoone of: buffered, unbufferedThe deliveryPolicy field of the dataSource object configures the data transmission method utilized by the Gateway. When the deliveryPolicy is set to buffered, the Gateway ensures guaranteed delivery of data. In the absence of this setting, the Gateway operates in a best effort delivery, which does not guarantee delivery but minimizes delays. This field is enabled only when the dataSource object includes a deviceId. If this field is not specified, the system defaults to the buffered setting.
deviceIdnumberNoThe device ID is associated with the catalogId and sourceId. The specified device ID must be attached to a home. The device ID is optional when the sourceId is a data source of integration module.
enabledbooleanNoThe flag indicates whether the data source is enabled.
homeIdintegerYesread-only (server-generated)Home that this data source belongs to.
imageDataobjectNoMetadata used for the uploaded image of the data source.
Properties of imageData
PropertyTypeRequiredConstraintsDescription
fileNamestringNoFileName represents the name of the file uploaded.
urlstringNoA temporary signed URL for file download.
multibooleanNoread-only (server-generated)The flag indicates whether the data source can attach to the multiple routings.
namestringYesDisplay name of data source.
projectIdintegerYesread-only (server-generated)Project that this data source belongs to.
sourceIdstringYesread-only (server-generated)Unique Data Source ID.
updatedAtstringNoread-only (server-generated); format: date-timeTimestamp of the last update on the data source.

Request example

{
  "attributes": {
    "manufacturer": "MODE, inc.",
    "serial": "0000001234"
  },
  "catalogId": "bu01",
  "createdAt": "2021-09-02T22:19:39Z",
  "dataType": "metrics",
  "deviceId": 1234,
  "enabled": true,
  "homeId": 1234,
  "imageData": {
    "fileName": "thumbnail.png",
    "url": "https://example.com/images/thumbnail.png"
  },
  "multi": false,
  "name": "Sensor 1",
  "projectId": 1234,
  "sourceId": "a3b2ac399abc",
  "updatedAt": "2021-09-02T22:19:39Z"
}

Responses

204 Successfully updated the data source with specified key. There is no return body.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The requested dataSource does not exist or is not accessible.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.