Content Repository Resource - Tools

A cr/tools resource is used to organize and secure tool objects. Folders are designed to support a large number of sub-folders or objects. One folders' contents are retrieved at a time - usually when a folder is expanded by a user.

It is a recursive operation when a folder is deleted. Not only will sub-folders be deleted but any entity within a sub-folder will be deleted too. There is also a "cr/tools/{nodeUid}/perm" API that allows object permissions to be set within the content repository. They are not documented here. Contact us if you would like to use these APIs.


GET cr/tools


Returns the root folder.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token token compatible? Yes



Resource URL

http://grovestreams.com/api/cr/tools

Parameters

byFolderPath Optional Return the node by its path. Example: byFolderPath=Tools/Units/site 1/building 10
fullPath Optional Include the node's full path in the response body.
childCounts Optional Include the node's child counts in the response body.

Example Requests

/cr/tools?fullPath=true&childCounts=true

Response Body
{
  "message": "",
  "cr_node": {
    "id": "",
    "uid": "b4ea8adc-7a22-32c2-98c8-560d0ae8beb7",
    "text": "Tools",
    "folderCount": 1,
    "parentUid": "",
    "modDate": 1432664235650,
    "iconUrl": "",
    "fullPath": "/",
    "itemCount": 4,
    "type": "cr_node",
    "crDate": 1432664235650
  },
  "success": true
}

GET cr/tools/{nodeUid}



Returns a cr_node's properties.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible? Yes



Resource URL

http://grovestreams.com/api/cr/tools/{nodeUid}

Parameters

fullPath Optional Include the node's full path in the response body.
childCounts Optional Include the node's child counts in the response body.

Example Requests

/cr/tools/4794edc0-a2da-49a8-bbe5-2851f632cc0d

Response Body
{
  "message": "",
  "cr_node": {
    "id": "",
    "uid": "b4ea8adc-7a22-32c2-98c8-560d0ae8beb7",
    "text": "Tools",
    "folderCount": 1,
    "parentUid": "",
    "modDate": 1432664235650,
    "iconUrl": "",
    "fullPath": "/",
    "itemCount": 4,
    "type": "cr_node",
    "crDate": 1432664235650
  },
  "success": true
}


GET cr/tools/{nodeUid}/children



Returns a cr_node's children.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible? Yes



Resource URL

http://grovestreams.com/api/cr/tools/{nodeUid}/children

Parameters



.

Example Requests

/cr/tools/f037db6a-bc48-374e-b914-8435f274525c/children

Response Body
{
  "message": "",
  "cr_node": {
    "uid": "f037db6a-bc48-374e-b914-8435f274525c",
    "children": [
      {
        "id": "",
        "uid": "186a917c-3a92-3795-b39b-f2b01a302c00",
        "text": "r1p1",
        "iconUrl": "comp_tan",
        "type": "component_template"
      },
      {
        "id": "",
        "uid": "ee13fe9f-2a98-31e6-831c-70972f70d002",
        "text": "Region 1",
        "iconUrl": "",
        "type": "cr_node"
      }
    ]
  },
  "success": true
}


PUT cr/tools/{nodeUid}



This call will:
  1. Create a new folder or tools node.
  2. Save the new node in the store with the passed in name and default values
  3. Place the new node under the folder with the passed in parentnodeUid
  4. Return the new node
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes



Resource URL

http://grovestreams.com/api/cr/tools/{nodeUid}

Parameters

parentnodeUid Mandatory
The uid of the parent folder.
contentType Mandatory The type of content being inserted. Set to "cr_node" or "component".
text Mandatory The name of the new folder or component.
iconUrl Optional The icon for the cr_node (only used for components today).
id Optional The ID for the cr_node (only used for components today).

Example Requests

/cr/tools/4794edc0-a2da-49a8-bbe5-2851f632cc0d ?contentType=cr_node&parentFolderUid=f037db6a-bc48-374e-b914-8435f274525c&text=A%20new%20folder

This call will create a new folder and return its new uid.


Response Body
{
"message": "Inserted content node with uid 'ee13fe9f-2a98-31e6-831c-70972f70d002'",
"cr_node": {
"id": "",
"uid": "ee13fe9f-2a98-31e6-831c-70972f70d002",
"text": "A new folder",
"iconUrl": "",
"type": "cr_node"
},
"success": true
}


POST cr/tools



Used to update an existing node's contents:
  • Rename a node
  • Move a node


Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes



Resource URL

http://grovestreams.com/api/cr/tools/{nodeUid}

Parameters

action
Mandatory
Set to "rename" or "move"
toFolder
Mandatory if action is "move" and toFolderName is not used.
The uid of the folder the item is being moved to. Leave blank if it is the root folder.
toFolderName
Mandatory if action is "move" and toFolder is not used.
The full path of the folder the item is being moved to. Leave blank if it is the root folder.
newName
Mandatory if action is "rename"
The new name of the item.

Example Requests

Rename a folder under the root folder.

/cr/tools/c6ba7960-d416-4ae7-9bdf-9b5a09d49845?&newName=Meters&action=rename


Request Body

None

Response Body
{
  "message": "Renamed content node with uid 'c6ba7960-d416-4ae7-9bdf-9b5a09d49845'",
  "success": true
}

Move a component from one folder to another.

/cr/tools/96099e24-93d9-4a57-b019-477e0ee45df5?&toFolder=c6b1e641-dad6-431c-8c79-245af06c3cf5&action=move


Request Body
None


Response Body
{
  "message": "Moved content node with uid '96099e24-93d9-4a57-b019-477e0ee45df5'",
  "success": true
}

DELETE cr/tools/{nodeUid}



Deletes a cr_node or a component. This call is recursive. All children, folders and components will be deleted.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes



Resource URL

http://grovestreams.com/api/cr/tools/{nodeUid}

Parameters

byFolderPath Optional Delete the node by its path. Leave nodeUid off of the URL if including this parameter. Example: byFolderPath=Tools/Units/site 1/building 10



Example Requests

Delete a cr_node and all of its children and all of their children and so on...

/cr/tools/c6ba7960-d416-4ae7-9bdf-9b5a09d49845


Response Body
{
  "message": "Deleted content node with uid 'c6ba7960-d416-4ae7-9bdf-9b5a09d49845'",
  "success": true
}