How can I use web services to retrieve information on folders?

The web service to be used in order to retrieve information on folders is findByProperties2. Such web service allows you to perform three different operations: 

Folders list

This operation will allow you to retrieve the whole folder tree related to the token used to perform the request, meaning all the folders that specific token is capable of seeing:

  • If it is an application's token, the root of the tree will be the main folder on which the application has been installed.
  • If it is a user token, the root is not defined and the service will return one or main folders, according to the access rights related to the specific token.

This is an example of the request, you can paste this JSON in our Developer Center and test it.

{
    "client": {
        "clientId": ""
    },
    "properties": {},
    "offset": 0,
    "numberOfResult": 50
}

Detail of one or more folders

You can obtain the full detail of one or more specific folder, passing the categoryId or the prettyId in the categoryIds array; by doing this, the web service will return the detail of such folders, without any reference to their sub-folders.

This is an example of the request, you can paste this JSON in our Developer Center and test it. 

{
    "client": {
        "clientId": ""
    },
    "properties": {
        "categoryIds": ["categoryIds or prettyIds here"]
    },
    "offset": 0,
    "numberOfResult": 50
}

List of the subfolders related to a specific folder

In this case you simply have to set the field childOf with the categoryId or the prettyId of a specific folder (only one folder at a time); the service will return all the subfolders of such folder.

{
    "client": {
        "clientId": ""
    },
    "properties": {
        "childOf": "categoryId or prettyId here"
    },
    "offset": 0,
    "numberOfResult": 50
}
Was this article helpful?
1 out of 1 found this helpful

Have any question?

Open a ticket
Comments