Content
You are here:
API always return "You need to be authenticated to access this resource."
Added by Jérémy Pinto over 9 years ago
Hello,
I try to use the API V3 to call this ressource “https://community.openproject.com/api/v3/users/39083” but it always give me the same response :
errorIdentifier need to be authenticated to access this resource."
I do it with curl :
curl -u apikey:$APIKEY https://community.openproject.com/api/v3/users/39083
Either in my terminal or in my website with php, I get this error message.
Did I miss something ?
Replies (4)
Two problems:
1. it is community.openproject.org
2. basic auth is only working from OpenProject 4.2 upwards, not on OpenProject 4.1
The latter one is an issue of proper documentation on our side. The right documentation for your version of OpenProject can be found within your installation directory under
doc
.There are some slight differences between the documentation and the implementation, but I hope that we will eventually remove these…
I am using the 4.1.1 version, I will update my OpenProject and try.
Thanks for this rapid answer.
I have just seen 4.2 is not a release ?
Does it mean the api V3 doesn’t work with official releases?
Basic auth authentication will just be a new thing with 4.2, which is not yet released.
Up until 4.1 the only way of authentication is cookie based, that means: When your browser is logged in, your browser can make requests (that is what the angular client does). External clients are officially supported starting with OP 4.2.
One last word of warning: The reason why we titled the APIv3 specification as a “draft” is that we do not want to call it stable yet. One thing is that many important endpoints are simply not there yet (e.g. list work packages), the other point is that we might find that a decision about an existing endpoint was not as clever as we thought and we will change that existing endpoint again (I am currently doing such things to the attachments endpoint and the watchers endpoints).
In the end this should lead to a consistent API that everyone will enjoy. While we are on the way it surely means, that the API will change and evolve.
That being said I’d love people make use of the API already, just don’t be disapointed when things change :)
Best regards
Jan Sandbrink