Page 1 of 1

API Session ID

Posted: Thu Dec 21, 2017 8:03 am
by royalpublishing
Using JSON via the API, is there a way to check whether an API session ID is valid or not? I know you can always just create a new session ID but it seems like a logical approach would be to test whether a session ID is still valid (ie it exists and is not expired) first before requesting a new one.

Re: API Session ID

Posted: Thu Dec 21, 2017 9:08 am
by shaunw
You can call APIAuthentication->isLoggedIn() to check that.

Alternatively the API will return a SESSION code error if the session has expired, in which case you could just call Login() again.

Re: API Session ID

Posted: Thu Dec 21, 2017 9:13 am
by royalpublishing
Excellent, thank you sir.