How can I retrieve all content that an application can "see"?

If you wish to retrieve all content an application can “see”, the first thing to do is to authenticate to the platform using the application's credentials; this can be done by retrieving the appId: invoke the appsList web service with a token related to a user with the administrative permission to create and manage applications and identify the appId related to the application of interest.

Once you have the appId you can authenticate to the platform by using the loginApp web service: use the form:

//[clientId]-view.thron.com/api/xadmin/resources/apps/loginApp?clientId=[clientId]&appId=[appId]

Where clientId is the domain name used to access THRON (usually your company name), while the appId is the one you previously retrieved.

In the response of this web service you will find a tokenId which can be used in all the subsequent requests by including it in the headers (X-TOKENID).

Among the parameters of the response you will also find "rootcategoryId" which is actually the ID of the folder where the application has been installed

Now that you have a valid platform token you can retrieve all the content that the application can see; to do so, invoke the findByProperties web service, providing the following body (remember to include the X-TOKENID among the headers):

{
    "client": {
        "clientId": "",
        "criteria": {}
    }
}

If instead you wish to limit your search to one of the subfolders that the application can see, you can invoke the same we service, providing in the body the “linkedCategoriesOP” parameters, filled with the categoryId of the folder you want to search in.

{
    "client": {
        "clientId": "<YOUR CLIENTID HERE>"
    },
    "criteria": {
        "linkedCategoryOp": {
            "linkedCategoryIds": [
                ""
            ],
            "cascade": false
        }
    }
}

If you wish to obtain also tags and metadata linked to these specific content, please remember to set to "true" the specific parameters in the request body: returnItags and returnImetadata:

{
    "client": {
        "clientId": ""
    },
    "criteria": {
        "returnItags": true,
        "returnImetadata": true,
        "ignoreITagCombining": false
    }
}
Was this article helpful?
0 out of 0 found this helpful

Have any question?

Open a ticket
Comments