Forum Discussion
Thank you for all these information AdamA, everything is working almost perfectly fine, except for the last step, the actual "Add a me too".
I have successfully logged in in the name of the user, and have tested API calls through AJAX like fetching a given message (testing the read permissions), or editing an existing message (testing the writing permissions). Both of those calls worked well.
As for the AJAX Post call to "/messages/id/<message-id>/ratings/key/question_metoo/ratings/add?rating.value=1" after successfully logging in, however, I keep getting the "Autorisation refusée" (Authorization refused) with a 303 code from the API.
The code is pretty straightforward :
$.ajax({ type: "POST", url: "/restapi/vc/authentication/sessions/login", data: ({ "xslt":"json.xsl" }), success: function(loginResponse) { $.ajax({ type: "POST", url: "/restapi/vc/messages/id/" + questionId + "/ratings/key/question_metoo/ratings/add?rating.value=1, data: ({ "rating.value=1", "xslt":"json.xsl" }), success: function(meTooResponse) { console.log(meTooResponse.response); } }); } });
(We are using auto-cookie login, that's why we don't have to use the session_key after loging in).
As for permissions, I have authorized API Reading and Writing Permissions in the Admin of course (the two previous successful calls I made confirm that those settings are indeed active).
Do you know why I am getting this 303 error only for Adding a Me Too to a question ? Is there a setting I might have overlooked ?
Thanks in advance for any help you can provide !
EDIT : To add more info to my post, I have also tried to make the call via the FreeMarker Rest API, and the result is the same, i.e. "Authorization Refused".
VincentGabou: I'm getting the same error.
AdamA: Do you know why this error occurs please?
best,
Clement
Related Content
- 4 years agoInactive User
- 5 months ago