cancel
Showing results for 
Search instead for 
Did you mean: 

no active session when sending API request

tomer_iyar
New Contributor III
Hi,
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. 


3 REPLIES 3

lawrence_smith_
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":"5.1.1.0.598"}
i dont see any JSESSION ID.

thanks.

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