thing.replicate

The thing.replicate command is used to copy a thing to another organization.

This command requires organization administrator privileges in both organizations.

The following items are copied from the source thing:

  • attributes

  • alarms

  • alarms history

  • event Logs

  • geofence history

  • location history

  • property history

TR50 Request

{
  "cmd": {
    "command": "thing.replicate",
    "params": {
      "key": "mycar",
      "orgKey": "NEWORG"
  }
}
 
{
  "cmd": {
    "command": "thing.replicate",
    "params": {
      "key": "mycar",
      "newKey": "mynewcar"
  }
}
      

Request Parameters

Name

Type

Required

Description

key

String

Yes

The key of the thing to replicate.

orgKey

String

 

The key of the destination organization. Defaults to being the current organization.

newKey

String

 

Optional new key for the new thing. Defaults to the same key as the source thing. If the destination organization is the same as the source organization, the newKey parameter is required and must be different from the key parameter. Otherwise, the command returns an error to indicate that the thing already exists.

defKey

String

 

When replicating to a different organization, the thing definition key. Defaults to the current definition key. The destination definition must match the existing definition. If this definition does not exist, it is created.

TR50 Response

If the command is sent successfully, a success message is returned. Otherwise, an error and error message are returned.

{
  "cmd": {
    "success": true
  }
}