Showing results for 
Search instead for 
Did you mean: 

no active session when sending API request

New Contributor III
according to documentation the logon require 2 request (which i am able to run successfully)

 curl -k -X POST  https://my-ip/wsg/api/public/v8_1/session --data '{"username":"admin","password":"password"}' -H 'Content-type: application/json'
this returns only version which has no use.

the 2nd request is the serviceticket -
curl -k -X POST  https://my-ip/wsg/api/public/v8_1/serviceTicket --data '{"username":"admin","password":"password"}' -H 'Content-type: application/json' - this return a string

now the request i am trying to run is /v8_1/aps - to get the list of aps

according to documentation i need a session ID instead of the user password i dont seem to find session ID in the 2 request above, i tried using the service ticket instead of the session ID without success obviously, 

any ideas how to get it done or what i am missing? thanks. 


New Contributor II
When you submit your first POST you will get a JSESSION Cookie ID. Add that that to your second (and any subsequent) API call(s) payload and you should get authenticated.

Hi Lawrence,
thanks for replying but when i run the first post-
[root@ct82-0108 ~]# curl -k -X POST  https://my-ip/wsg/api/public/v8_1/session --data '{"username":"admin","password":"my-password"}' -H 'Content-type: application/json'  

this is the response i get- {"controllerVersion":""}
i dont see any JSESSION ID.


Oh, yes - you need to add the "-i" option to the curl to see the cookie.