How to upload content to a public folder from external source

Business Case:

KPI to be measured

Bookmark this resource Follow

Ask a question

Was this article helpful? 0 out of 0 found this helpful

The following approach is recommended for integration projects involving the upload of content to THRON from an external source.
The first step is to identify the public folder in which the content will be published. On this folder it is important to ensure that all the stakeholders, whether users or groups, have access to the content with their own set of access rights.
Once the folder has been identified, it is necessary to install a THRON Custom Application Manager on it, whose credentials will be used to authenticate to THRON and obtain the token with which to upload the content.

To install a THRON Custom Application Manager, select the folder and then click on the "+" button in the Cockpit menu; then click on "THRON Custom Application Manager". You will be shown a modal where you will have to put a name and a prettyID for the application. Make sure the correct folder is selected in the dropdown:

 

Schermata_2018-03-01_alle_09.15.53.png

 

Once the application has been activated you will be redirected to its configuration panel.

In this screen, make sure you undertake the following steps:

 

managementPane.png

 

 

  1. Take note of the appId, as it will be used to perform authentication and invoke web services
  2. Under "Content Management", make sure you select "Can create new content", and the choose the user that will be impersonated by the app to perform content upload. Basically, it will be the owner of the uploaded content. You can either choose the application's owner (default), or a different user. Choose this second if you want to avoid notifications on such content. In either case, take note of the username, since it will be used to perform authentication.
  3. Scroll down and take note of the appKey, as it will be used to perform authentication and invoke web services

Now the set up is complete, you can integrate web services requests to your external sources. To do so, proceed as follows.

The first thing to do is to obtain a valid token via application. To do that, you will have to invoke a su web service, which is a POST request that will return you a token that must be used to upload content. The url of the request is structured as follows:

 

//<clientId>-view.thron.com/api/xadmin/resources/apps/su


Required parameters are: your clientId, which is the domain name used to access THRON, the appId and appKey you previously took note of and the username of the user selected during app’s configuration.

 

{
  "clientId": "",
  "appId": "",
  "username": "",
  "appKey": ""
}

 

In the response you will obtain a token that must be used in the subsequent request, the one that will perform content upload. To upload content use the insert web service, following the procedure described in this article. The only measures you need to take are the following:

  1. Make sure you use the token returned by the "su" request 
  2. Make sure the "linkedCategories" parameter is filled with the ID or the prettyID of the folder in which the application has been installed, like in this example below


    Install a THRON Custom Application Manager on the public folder where content must be uploaded
  • Create a group that contains all the users that must access to such content and grant this group visibility on the same folder
  • Configure the THRON Custom Application Manager by making sure it can create new content and can publish content in the folder. To do this:
    1. Access the application management by clicking on its icon in the header menu of THRON Dashboard
    2. Under “Content Management” select “Can create new content” and choose the user to be impersonated when uploading content
  • Before uploading content make sure you have the application impersonate the user by using the su web service, which will return you a token that must be used to upload content. Required parameters are: your clientId the appId and appKey, the username of the user selected during app’s configuration. In thisscreencast you see all the info you need.
  • Upload content with the insert web service, using the obtained token, and making sure that the “linkedCategories” parameter is filled with the target folder’s ID or prettyId, like in the example below:

 

{
	"param": {
		"contentType": "",
		"contentOpt": {
			"initAllLocales": false,
			"basicInfoByLocale": [{
				"locale": "EN",
				"name": "",
				"description": "",
				"prettyId": ""
			}],
			"linkedCategoryIds": [
				""
			]
		},
		"sources": [{
			"web": {
				"url": "",
				"newFileName": ""
			}
		}]
	},
	"silentMode": false
}
Was this article helpful?
0 out of 0 found this helpful

Have any question?

Open a ticket
Comments