1. Omprakash Gupta
  2. PowerServer
  3. Monday, 5 December 2022 20:26 PM UTC

How do I get individual sessions connected to PowerServer 2022 Web API?

 

Thank You,

OP Gupta

mike S Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 21:45 PM UTC
  2. PowerServer
  3. # 1

 

inv_HttpClient.clearrequestheaders( )

ls_authtoken = GetApplication().GetHttpRequestHeader("Authorization")
if ls_authtoken > ' ' then

   inv_HttpClient.SetRequestHeader("Authorization", ls_authtoken , true) //If authentication is enabled
end if

//GetSessions url:
ls_url = GetApplication().getpowerserverurl( )
ls_url += "/api/Session/LoadAll" 

inv_HttpClient.sendrequest("Get",ls_url)

if inv_HttpClient.getresponsestatuscode() = 200 then
     inv_HttpClient.getresponsebody(ls_json)
else
    is_lasterror = inv_HttpClient.getresponsestatustext( )
    setnull(ls_json)
end if

 

//ls_json holds the session list

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 21:03 PM UTC
  2. PowerServer
  3. # 2

Hi OP;

     I wrote a free PowerServer console PB App that can list all the sessions & then optionally, allow you to kill any combination of sessions thereof ...

FYI:  http://chrispollach.blogspot.com/2022/04/psconsole.html 

Download: https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/PS_Console 

HTH

Regards ... Chris 

 

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 20:58 PM UTC
  2. PowerServer
  3. # 3

Refer to the Swagger documentation of the Web APIs: https://docs.appeon.com/ps2022/Use_PowerServer_Management_APIs.html

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.