I'm trying to acquire a valid logon session, but I get "no active session"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017 03:54 AM
Beginner here, I'm following API guide to acquire a login session.
I'm testing with curl command like this
But I get the following error:
{"message":"Current session has timed out.","errorCode":201,"errorType":"No active session"}
I'm testing with curl command like this
curl https://{server-ip:server-port}/wsg/api/public/v5_1/session -k -X GET
But I get the following error:
{"message":"Current session has timed out.","errorCode":201,"errorType":"No active session"}
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017 04:00 AM
Hi,
You need to be doing sending a POST rather than a GET and you also need to pass in JSON for the username/pass
data = { "username": username,
"password": password,
"timeZoneUtcOffset": "+00:00"
}
You need to be doing sending a POST rather than a GET and you also need to pass in JSON for the username/pass
data = { "username": username,
"password": password,
"timeZoneUtcOffset": "+00:00"
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017 04:12 AM
Hi, I tried like you said, specifying also Content-type it seems to work!
curl https://{ip:port}/wsg/api/public/v5_1/session -k -X POST --data '{"username":"admin","password":"Mypass.1","timeZoneUtcOffset":"+01:00"}' -H 'Content-type: application/json'thank you
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017 04:44 AM
No problems!
Once you logon it'll give you back a session ID which needs to be passed with every API call along with the content type so for example;
{'Content-Type': 'application/json;charset=UTF-8','Cookie': 'JSESSIONID='GDHDHDAAA'}
Once you logon it'll give you back a session ID which needs to be passed with every API call along with the content type so for example;
{'Content-Type': 'application/json;charset=UTF-8','Cookie': 'JSESSIONID='GDHDHDAAA'}

