Get Non-Active Users

Description

'Get-Not-Active-Users' returns a list of users who have been inactive since X number of days along with the teams in which these users are enrolled. We can also retrieve the name and number of the teams in which the user is a member. Along with this the last active time and date of the user can be retrieved. 

Request URL

(GET) http://{controllerMachine}:{controllerPort}/api/v4/user/notActive/{date}/{teamId}

Input parameters

Field

Type

Description

Comment

Date

DateTime

Date from which we need to check user has not been active

This is Mandatory parameter

 

TeamId

Guid

The teamId is a unique Id for the team defined under the Leapwork Enterprise Edition

This is optional parameter and The teamId can be fetched from the Response Body of Get All Team endpoint

Examples

Curl

curl -X GET --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb'

'http://localhost:9001/api/v4/user/notActive/2023-06-24T05:04:18.070Z/9fb4ef50-6924-471d-8261-052aa8b572c9'

PowerShell 

$headers = @{} $headers.Add("accessKey","UsctfG8Mg1LVa29L")

Invoke-WebRequest -Uri " http://localhost:9001/api/v4/user/ notActive/2023-06-24T05:04:18.070Z/9fb4ef50-6924-471d-8261-052aa8b572c9" -

ContentType "application/json" -Headers $headers -Method GET

Response object

Field

Type

Description

Values

$id

string

ID of internal object

 

Id

string

Unique Id of User (UserId)

 

UserName

string

Unique name of the user

 

FullName

string

Full name of the user

 

UserType

string

Type of user

Leapwork, ActiveDirectory

 

Response

[
    {
        "$id": "1",
        "Id": "cd3c7af-e06a-4b76-b742-0c12fddb9475",
        "UserName": "admin",
        "FullName": "admin",
        "UserType": "Leapwork",
        "LastActiveDate": "2023-07-03T05:30:20.5009037+00:00",
        "TeamNames": [
            "Team 1"
        ]
    }
]

Response Code

200 (OK)

400 (Bad Request)

401 (Unauthorized - eg: “Incorrect Accesskey”)

403 (Forbidden – eg: “AccessKey does not have the relevant scope permission”)

404 (Not Found – eg: “User not found”, “Team(s) not found”, “User does not exist in a team(s).”)

409 (Conflict – eg: “At least one team should contain an administrator”)

500 (Internal Server Error)