cancel
Showing results for 
Search instead for 
Did you mean: 

Call authenticated webscript via URL and get JSON

vojtechm
Confirmed Champ
Confirmed Champ

Hello,

what is the best way for calling Alfresco webscript (with autentication) via URL request from external Java application?

I need to send authenticated (username and password) request to Alfresco via URL and fetch JSON back to Java application.

Is there some code example to check?

Thank you.

Br, Vojtech

3 REPLIES 3

yogeshpj
Star Contributor
Star Contributor

Hi Molin,

You can use token mechanism of alfresco.

First get alfresco token using username and password and then use that token to call webscript.

Thanks,

Yogesh Prajapati

afaust
Legendary Innovator
Legendary Innovator

It is better to use proper names in referring to authentication mechanisms because you will likely not find anything in the documentation about "token mechanism". is referring to Alfresco's authentication ticket feature where you call the /alfresco/s/api/login ReST operation first to authentication using username + password in the JSON POST request which will give you an authentication ticket. This ticket can then be used as a URL parameter called "alf_ticket" in any subsequent web script calls using /alfresco/s/ as the service endpoint to re-use the previously validated login.

Hello,

thank you both for explanation!

Br, Vojtech