Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ghaliabed
Partner - Creator
Partner - Creator

Assign license to users consuming too many Tokens

Hello,

We are trying to leverage Qlik APIs to automate license management on our Qlik Sense environment.

Goal:

Detect users that are consuming tokens, not a full license, over a certain limit .

Give these users a full license

Automate this process.

Currently to do this we are using the license monitor dashboard to detect users consuming too many tokens and then manually going and giving them a full license.

Is there a way to do this automation? we are thinking of using API calls and endpoints to extract information and then do the logic of license assignment there also.

Are there any endpoints that give information like User A has consumed 10 Tokens ? or something close to it ?

Also is there an endpoint that gives information to which license group the user is consuming his tokens from ?

1 Reply
Levi_Turner
Employee
Employee

Hey Abed,

The key endpoint will be: GET /qrs/license/loginaccessusage/full

Example response:

[

  {

    "id": "7dd69dbf-416c-47a8-bf15-b1a7d3b30f59",

    "createdDate": "2018-08-27T19:47:28.729Z",

    "modifiedDate": "2018-08-27T19:47:28.729Z",

    "modifiedByUserName": "SECURITYRULE\\tokenusage2",

    "user": {

      "id": "107ac19b-0b89-443d-aa8d-9da2809eb139",

      "userId": "tokenusage2",

      "userDirectory": "SECURITYRULE",

      "name": "tokenusage2",

      "privileges": null

    },

    "sessions": [

      {

        "id": "7904a906-1bfa-494f-a050-5ddc40ee4683",

        "createdDate": "2018-08-27T19:47:28.729Z",

        "modifiedDate": "2018-08-27T19:47:28.729Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage2",

        "sessionID": "a8eb8314-3abb-408c-bfb6-e8ac4bf84f00",

        "latestActivity": "2018-08-27T19:47:28.724Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      }

    ],

    "loginAccessType": {

      "id": "2d28e029-0f1e-40f3-b62b-2049f63314c4",

      "name": "Temp",

      "privileges": null

    },

    "useStartTime": "2018-08-27T19:47:28.724Z",

    "latestActivity": "2018-08-27T19:47:28.724Z",

    "hostName": "::1",

    "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

    "privileges": null,

    "schemaPath": "License.LoginAccessUsage"

  },

  {

    "id": "6bd2d7ef-3221-4c54-936b-92075de3d3fc",

    "createdDate": "2018-08-27T19:44:26.345Z",

    "modifiedDate": "2018-08-27T20:44:22.726Z",

    "modifiedByUserName": "SECURITYRULE\\tokenusage",

    "user": {

      "id": "c01759c7-a4b8-4d67-85d6-ea1ff7924c7a",

      "userId": "tokenusage",

      "userDirectory": "SECURITYRULE",

      "name": "tokenusage",

      "privileges": null

    },

    "sessions": [

      {

        "id": "26b05f76-faec-401f-b10d-6a9ab222c8f6",

        "createdDate": "2018-08-27T20:44:22.726Z",

        "modifiedDate": "2018-08-27T20:44:22.726Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage",

        "sessionID": "8a5ee971-88cc-4b22-b8b6-5ef55ebf7b41",

        "latestActivity": "2018-08-27T20:44:22.709Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      },

      {

        "id": "8205f26b-c15c-428b-a001-a6e3a7e33340",

        "createdDate": "2018-08-27T19:47:38.955Z",

        "modifiedDate": "2018-08-27T20:44:22.726Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage",

        "sessionID": "b19e3c59-75bb-4d97-b080-9b5ccff052a6",

        "latestActivity": "2018-08-27T19:52:39.884Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      },

      {

        "id": "40750719-57c9-4d8f-8645-ac981134d5f9",

        "createdDate": "2018-08-27T19:44:39.442Z",

        "modifiedDate": "2018-08-27T20:44:22.726Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage",

        "sessionID": "b5613e15-a497-4829-a040-510f7591991c",

        "latestActivity": "2018-08-27T19:44:39.422Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      },

      {

        "id": "c6bd1797-e954-43e3-a0ec-71add6b64ccf",

        "createdDate": "2018-08-27T19:44:26.345Z",

        "modifiedDate": "2018-08-27T20:44:22.726Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage",

        "sessionID": "c93a8fad-9dc1-4ffe-9476-ee73308dbc36",

        "latestActivity": "2018-08-27T19:44:33.663Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      }

    ],

    "loginAccessType": {

      "id": "2d28e029-0f1e-40f3-b62b-2049f63314c4",

      "name": "Temp",

      "privileges": null

    },

    "useStartTime": "2018-08-27T19:44:26.314Z",

    "latestActivity": "2018-08-27T20:44:22.709Z",

    "hostName": "::1",

    "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

    "privileges": null,

    "schemaPath": "License.LoginAccessUsage"

  },

  {

    "id": "00da201c-a95c-4ce1-b3f3-cbfba1bc3b9d",

    "createdDate": "2018-08-27T20:44:48.495Z",

    "modifiedDate": "2018-08-27T20:44:57.888Z",

    "modifiedByUserName": "SECURITYRULE\\tokenusage",

    "user": {

      "id": "c01759c7-a4b8-4d67-85d6-ea1ff7924c7a",

      "userId": "tokenusage",

      "userDirectory": "SECURITYRULE",

      "name": "tokenusage",

      "privileges": null

    },

    "sessions": [

      {

        "id": "ccf870b4-7cd6-486f-8515-19c98ccb75ce",

        "createdDate": "2018-08-27T20:44:48.495Z",

        "modifiedDate": "2018-08-27T20:44:57.888Z",

        "modifiedByUserName": "SECURITYRULE\\tokenusage",

        "sessionID": "8a5ee971-88cc-4b22-b8b6-5ef55ebf7b41",

        "latestActivity": "2018-08-27T20:44:57.872Z",

        "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

        "schemaPath": "License.LoginAccessUsage.Session"

      }

    ],

    "loginAccessType": {

      "id": "2d28e029-0f1e-40f3-b62b-2049f63314c4",

      "name": "Temp",

      "privileges": null

    },

    "useStartTime": "2018-08-27T20:44:48.491Z",

    "latestActivity": "2018-08-27T20:44:57.872Z",

    "hostName": "::1",

    "serverNodeConfigurationId": "f206bf30-1e5c-498a-8f73-f1f9e2120863",

    "privileges": null,

    "schemaPath": "License.LoginAccessUsage"

  }

]

From there you can aggregate on the usages by userid then conditionally assign a user access pass.

Hope that helps.