Bug with session token?
Hi,
I have noticed that some request that I do with the session token return an empty success anwser and if I remove the session token I receive the good answer with data.
Example of request with session token:
Request:
/restapi/v1/boards/id/Setup/threads?restapi.session_key=ZUELDAYXkLATuJ7r0sfQbCKs_6wo75EbG_oDxAGl7kk.
Response:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="success">
<threads/>
</response>
The same request but without the session_key:
Request:
http://coveo.demo.lithium.com/restapi/v1/boards/id/Setup/threads
Response:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="success">
<threads>
<thread type="thread" href="/threads/id/4287">
<messages>
<count type="int">3</count>
<topic type="message" href="/messages/id/4287">
....
Am I the only one that noticed that?
Thanks
maybe you are using a different account in REST, which has limited permissions? for example, you are viewing the community in browser as administrator, so you can see all threads via browser, incl private board threads. while in your program/code, your rest api user can only view public threads.
As HaidongG is saying I think the problem is:
If you specify the session token Lithium is trying to perform the call using the user linked to the session which the session token refers to.
If you don't specify the session token Lithium will use your session cookie to determine what permission to aply to the call. Chances are that you were already logged in as Administrator and for such reason you are getting the right result.
Probably the user linked to the session token doesn't have permission to access the board you were trying to query.
I hope this helps,
Nico