Get a list of Sessions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • avc859587618170
    Brainiac
    • Jun 2024
    • 66

    Get a list of Sessions

    Is there any way to get a list of sessions that are active?
    Dave Morrison
    Software Engineer
  • flynn1
    Brainiac
    .
    • Jun 2011
    • 82

    #2
    GetSessionIdList will return a list of all the DMCC Session IDs that are opened by this CTI user. This includes sessions opened using WTI and directly via DMCC.
    Example:
    API Call: /api/fe/v1/GetSessionIdList
    body:
    {}
    ======== Incoming WTI Response =============

    {"GetSessionIdListResponse": {"sessionIDList": {"sessionID": [
    "A999713208B1CF0AD942946346ECC486-78",
    "2E2E4F2670066408C1D9282BB9FFE5CA-81",
    "C708019565C971EF2755604B39CC6A0E-77",
    "07F2120ED6EACABC282940BCE7B4191E-82"
    ]}}}
    Last edited by jtb1; 10-03-2024, 09:48 AM.

    Comment

    • avc859587618170
      Brainiac
      • Jun 2024
      • 66

      #3
      I just downloaded the newest sdk's.. and I am seeing this endpoint. The blurb it gives is:

      This is a request to get the list of session identifiers that were established by the user name.
      The GetDeviceIdListId request has no parameters:
      The list of session identifiers is returned in the GetSessionIdListResponse.
      There are no events generated from a GetSessionIdList request.
      Since it says "...that were established by the user name." I'm assuming I have to pass the same username and password I use for the ApplicationSession endpoint. However, when I do that, I get a 410 unauthorized response. I must be missing something?

      Thanks!!

      Dave
      Dave Morrison
      Software Engineer

      Comment

      • jtb1
        Whiz
        .
        • Feb 2017
        • 33

        #4
        I believe you have to create a session first and then send the GetDeviceIdListId in the context of that session.
        Last edited by jtb1; 10-03-2024, 10:29 AM.

        Comment

        • avc859587618170
          Brainiac
          • Jun 2024
          • 66

          #5
          Originally posted by jtb1 View Post
          I believe you have to create a session first and then send the GetDeviceIdListId in the context of that session.
          I'm not quite sure how to do that. I'm calling the "GetSessionIdList" endpoint though, just in case you mis-read that. It says it doesn't have any parameters, so I can't pass anything in the body. Since it says "...get the list of session identifiers that were established by the user name.", that would mean I need to include the user name somewhere. Since I can't pass parameters, the only other thing I can think of is the username that I use to create a session..

          Thanks for the response!

          Dave
          Last edited by jtb1; 10-03-2024, 10:29 AM.
          Dave Morrison
          Software Engineer

          Comment

          • avc859587618170
            Brainiac
            • Jun 2024
            • 66

            #6
            Ok, this actually did work. Once I created an application session, it returns a token and a session Id. I can use the token to get all the sessions that are still active for this application.. if that makes sense. So I first called this endpoint:

            ApplicationSession and it generated this payload:

            Code:
            {
                "token": "mytokenwashere",
                "sessionID": "mysessionidwashere",
                "actualSessionDuration": 300,
                "actualProtocolVersion": "10.1.0.2"
            }
            I called the above endpoint a second time so I had two active sessions.

            I then used one of the generated tokens, I don't think it matters which you use, for the following endpoint and it shows the two sessions:

            GetSessionIdList, passing no parameters, and it returned this payload:

            Code:
            {
                "GetSessionIdListResponse": {
                    "sessionIDList": {
                        "sessionID": [
                            "AE7574FBD21B08230BE8D1E257F5DC8C-907",
                            "A53296F81E52689819410B3CEA6B32E9-908"
                        ]
                    }
                }
            }​
            Once the sessions either times out, or you kill it, it drops off that list..

            Hope this helps someone else!

            Dave
            Last edited by avc859587618170; 10-03-2024, 01:08 PM.
            Dave Morrison
            Software Engineer

            Comment

            • jtb1
              Whiz
              .
              • Feb 2017
              • 33

              #7
              When in Rome, do as DMCC would have done. Glad you figured it out.

              Comment

              Loading