08-23-2021 07:07 AM
Good morning,
I do the authentication qith my credentials and i obtain correctly the token, but after I
execute the next operation get with this token I receive response code 401 and 200 with the same request.
Why I receive sometimes error code 401?
Attach my postman with responses
Regards
08-23-2021 09:12 AM
I am not sure what steps you exactly followed but the error you mentioned is something strange.
These are two approaches to work with rest apis:
1- Get the basic auth base64 encoded string for the user credentials and use it for susequent requests by passing it as auth header. (not recommended)
2- Use the auth rest api to get the alf_ticket and use it for susequent request as auth header by converting to base64 encoded string. see the example here:
https://docs.alfresco.com/content-services/6.1/develop/rest-api-guide/install/#using-the-ticket
$ curl -X GET -H 'Accept: application/json' -H 'Authorization: Basic VElDS0VUXzA4ZWI3ZTJlMmMxNzk2NGNhNTFmMGYzMzE4NmNjMmZjOWQ1NmQ1OTM=' 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term=dog
Can you try the same request via curl and see what result you get? if you are using endpoint which is behind LB, then try hitting the nodes one by one and see what response you get.
Explore our Alfresco products with the links below. Use labels to filter content by product module.