Integrating with API - POST /Session/Query/

I am using the ‘API -POST/Session/Query’ to fetch the SessionID of the current LoggedIn User on the basis of User’s AccountID and getting the StatusCode as OK in the Response but still the required data is not available with the Response.

Following are the required details –

POST /API/Session/Query/?sessionId=88d50c82-e695-4d66-93f0-a5b471c9280b HTTP/1.1

HOST: analyticsdev.purpleseven.com

content-type: application/json

content-length: 218

{“QuerySessionOptions”:{“Filter”:[{“Field”:3,“Operator”:0,“Options”:0,“Value”:“a99a2d31-512a-4ddf-93d4-4a840d20f1bb”}],“OrderBy”:[{“SessionQueryField”:3,“SortDirection”:1}],“PageNumber”:1,“PageSize”:2},“SessionIds”:[]}

Where:

  • SessionId : ‘88d50c82-e695-4d66-93f0-a5b471c9280b’ in the URI is the Session of the ‘API Account’ User.

  • Value : ‘a99a2d31-512a-4ddf-93d4-4a840d20f1bb’ is the AccountID of the Current Logged in User for which we require the SessionID.
    Am I doing anything wrong ??

Hi Aseem,

Can you try getting the JSON from the response, using something like response.json() ? (This works in python) I have used this API - Session/Query in one of the Dundas BI data cube using Python Data Generator. So, there if I just return the response then I just get a status code like this -
image

And to get the value returned in the response I need response.json() which returns the response data in this case, the sessiondata.


I hope this helps. Please let me know in case you have any questions about this.