I use community edition and ı want to try alfresco rest api on postman. But ı get 401 unauthorize message while trying rest api. I think, it wants a token . But ı dont know how can ı token locally. Thanks.
Solved! Go to Solution.
In postman: (note that I am using Alfresco CE 201702, but this should work back to 5.0)
Set the URL to http(s)://hostort/alfresco/api/-default-/public/authentication/versions/1/tickets
Leave the Authorization tab blank
In the 'Body' tab, change the data type to 'raw' and select JSON (application/json) from the dropdown
In the body enter:
{
"userId": "yourusernamehere",
"password": "passwordinplaintext"
}
Hit send..
I should note that I am not using the tickets feature in my REST API calls. I am adding basic auth headers to all requests. If you want to go that route just enter your username/password in the Authorization table and click Update Request. That will add a new header to the HTTP request containing your username/password.
Finally, the API-explorer add-on is wonderful. I deployed it on my test server and you can try out all the REST APIs without having to use Postman. You have to build it yourself, but it is IMHO worth the time to do.
GitHub - Alfresco/rest-api-explorer: Public REST API Explorer
In postman: (note that I am using Alfresco CE 201702, but this should work back to 5.0)
Set the URL to http(s)://hostort/alfresco/api/-default-/public/authentication/versions/1/tickets
Leave the Authorization tab blank
In the 'Body' tab, change the data type to 'raw' and select JSON (application/json) from the dropdown
In the body enter:
{
"userId": "yourusernamehere",
"password": "passwordinplaintext"
}
Hit send..
I should note that I am not using the tickets feature in my REST API calls. I am adding basic auth headers to all requests. If you want to go that route just enter your username/password in the Authorization table and click Update Request. That will add a new header to the HTTP request containing your username/password.
Finally, the API-explorer add-on is wonderful. I deployed it on my test server and you can try out all the REST APIs without having to use Postman. You have to build it yourself, but it is IMHO worth the time to do.
GitHub - Alfresco/rest-api-explorer: Public REST API Explorer
Thank you your answer. It runs successfully. I want to write in detail for help to encounter like my problem.
I pass usernameassword(But base64 encoded) Authorization field in header and it works without error.
Thank you again.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.