Content Repository Resource - Components
A cr/comp resource is used to organize and secure components. 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/comp/{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/comp
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/comp
Parameters
byFolderPath | Optional | Return the node by its path. Example: byFolderPath=Components/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/comp?fullPath=true&childCounts=true
Response
Body
{
"message": "",
"cr_node": {
"id": "",
"uid": "b4ea8adc-7a22-32c2-98c8-560d0ae8beb7",
"text": "Components",
"folderCount": 1,
"parentUid": "",
"modDate": 1432664235650,
"iconUrl": "",
"fullPath": "/",
"itemCount": 4,
"type": "cr_node",
"crDate": 1432664235650
},
"success": true
}
GET cr/comp/{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/comp/{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/comp/4794edc0-a2da-49a8-bbe5-2851f632cc0d
Response
Body
{
"message": "",
"cr_node": {
"id": "",
"uid": "b4ea8adc-7a22-32c2-98c8-560d0ae8beb7",
"text": "Components",
"folderCount": 1,
"parentUid": "",
"modDate": 1432664235650,
"iconUrl": "",
"fullPath": "/",
"itemCount": 4,
"type": "cr_node",
"crDate": 1432664235650
},
"success": true
}
GET cr/comp/{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/comp/{nodeUid}/children
Parameters
. |
Example Requests
/cr/comp/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"
},
{
"id": "",
"uid": "ee13fe9f-2a98-31e6-831c-70972f70d002",
"text": "Region 1",
"iconUrl": "",
"type": "cr_node"
}
]
},
"success": true
}
PUT cr/comp/{nodeUid}
This
call will:
|
Resource Information | |
Rate Limited? | Yes | |
session, oauth and org tokens compatible? | Yes | |
api_key token compatible | Yes | |
Resource URL
http://grovestreams.com/api/cr/comp/{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/comp/4794edc0-a2da-49a8-bbe5-2851f632cc0d ?contentType=cr_node&parentFolderUid=f037db6a-bc48-374e-b914-8435f274525c&text=A%20new%20folderThis 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/comp
Used to
update an existing node's contents:
|
Resource Information | |
Rate Limited? | Yes | |
session, oauth and org tokens compatible? | Yes | |
api_key token compatible | Yes | |
Resource URL
http://grovestreams.com/api/cr/comp/{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/comp/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/comp/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/comp/{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/comp/{nodeUid}
Parameters
byFolderPath | Optional | Delete the node by its path. Leave nodeUid off of the URL if including this parameter. Example: byFolderPath=Components/site 1/building 10 |
Example Requests
Delete a cr_node and all of its children and all of their children and so on.../cr/comp/c6ba7960-d416-4ae7-9bdf-9b5a09d49845
Response
Body
{
"message": "Deleted content node with uid
'c6ba7960-d416-4ae7-9bdf-9b5a09d49845'",
"success": true
}