thing.tag.cloud

The thing.tag.cloud command is used to generate a Thing tag cloud. Filtering by tags and/or keys will generate a tag cloud containing the different tags associated to the request params (tags/keys). The following use cases provide sample API requests and responses that explains how the thing.tag.cloud works.

The response will only show the associated tags count and will not show the input tags count.

TR50 Request

{
  "cmd": {
    "command": "thing.tag.cloud",
    "params": {
      "tags": ["tag1", "tag2"],
      "keys": ["mything1", "mything2"]
    }
  }
}

Request Parameters

Name Type Required Description
tags Array Yes An array of tags. The result will be limited to the tags associated with Things that has the indicated tags.
keys Array An array of thing keys. The result will be limited to the tags associated with Things identified by the submitted Thing keys.
query String   The query is any value of a field within a Thing which is the search criteria used to return tags belonging to matching things. An @ (at) symbol is considered a word delimiter and will create an OR condition in the search. For example, "attrs.email.value:"john.doe@telit.com"". For more information and few sample of the search criteria, see Using Search.

TR50 Response

If the command is sent successfully a success message and the tag cloud object is returned. Otherwise, an error and error message will be returned.

{
  "cmd": {
    "success": true,
    "params": {
      "result": [
        {
          "tag3": 1
        },
        {
          "tag4": 2
        }
      ],
      "special": [
        {
          "connected": 5
        },
        {
          "disconnected": 5
        }
      ]
    }
  }
}

Response Parameters

Name Type Description
result Array An array of objects. Each object will list the tags count associated to the input tags and/or keys. In the above example, 1 thing has tag3 along with tag1 or tag2 and along with mything1 or mything2, and 3 things have tag4 along with tag1 or tag2 and along with mything1 or mything2.
special Array An array of objects. Each object will list the special tags associated to the input tags and/or keys. In the above example, there are 5 Things that are connected and are associated to tag1 or tag2, and 5 things that are disconnected and are associated to tag1 or tag2.

Related Topics Link IconRelated Topics