URL
GET https://{api-url}/api/v2/tenants/{tenantId}/users/loginHistory/search
Sample URLs
https://{api-url}/api/v2/tenants/client_93/users/loginHistory/search?pageSize=2&queryString=userId:USR0000000029+startLoginDate:2014-12-12T01:13:12 0000+endLoginDate:2015-12-12T01:13:12 0000
https://{api-url}/api/v2/tenants/msp_92/users/loginHistory/search?pageSize=2&queryString=userId:USR0000000055+startLoginDate:2014-12-12T01:13:12 0000+endLoginDate:2015-12-12T01:13:12 0000
Parameters
All of the parameters are optional:
Field | Default Value |
---|---|
pageNo={pageNo} | 1 |
pageSize={pageSize} | 100 |
isDescendingOrder={true/false} | true |
sortName={field} | id |
queryString={queryString} | NA |
NA indicates that the value is not applicable.
Query variables
Query Variables | Description |
---|---|
id | User ID. |
loginName | User login name. |
startLoginDate | Search for the users who logged in within a specific duration.startLoginDate denotes the from date. |
endLoginDate | Search for the users who logged in within a specific duration.endLoginDate denotes the to date. |
startLogoutDate | Search for the users who logged out within a specific duration.startLogoutDate denotes the from date. |
endLogoutDate | Search for the users who logged out within a specific duration.endLogoutDate denotes the to date. |
Notes
There are special characters that can be used in a query string:
- (+) represents the next field and must be URL-encoded.
- (:) represents equals. An example is
key : value
. - Date format must be yyyy-MM-ddTHH:mm:ssZ (GMT).
Sample response
{
"results" : [
{
"id" : 12716,
"partner" : {
"id" : 92,
"uniqueId" : "msp_92",
"name" : "Brocade Inc",
"activated" : true
},
"client" : {
"id" : 93,
"uniqueId" : "client_93",
"name" : "Brocade Lab",
"activated" : true
},
"user" : {
"id" : "USR0000002114",
"loginName" : "John.Smith",
"lastName" : "Smith",
"firstName" : "John",
"email" : "John.Smith@organization.com",
"changePassword" : false
},
"sourceIp" : "127.0.0.1",
"sourceHost" : "127.0.0.1",
"sessionId" : "DD8288A5906A694C67C982ADF0E54750",
"status" : "Logged Out",
"loginType" : "Success",
"logoutType" : "Normal",
"loginTime" : "2016-01-28T07:58:54+0000",
"logoutTime" : "2016-01-28T09:59:57+0000"
},
{
"id" : 12709,
"partner" : {
"id" : 92,
"uniqueId" : "msp_92",
"name" : "Brocade Inc",
"activated" : true
},
"client" : {
"id" : 93,
"uniqueId" : "client_93",
"name" : "Brocade Lab",
"activated" : true
},
"user" : {
"id" : "USR0000002114",
"loginName" : "James.Scott",
"lastName" : "Scott",
"firstName" : "James",
"email" : "james.scott@organization.com",
"changePassword" : false
},
"sourceIp" : "127.0.0.1",
"sourceHost" : "127.0.0.1",
"sessionId" : "1BC85D994F8B2919A24BCE82D61D8AEB",
"status" : "Logged Out",
"loginType" : "Success",
"logoutType" : "Normal",
"loginTime" : "2016-01-25T07:01:11+0000",
"logoutTime" : "2016-01-25T07:01:31+0000"
}
],
"totalResults" : 94,
"orderBy" : "id",
"pageNo" : 1,
"pageSize" : 2,
"totalPages" : 47,
"nextPage" : true,
"nextPageNo" : 2,
"previousPageNo" : 0,
"descendingOrder" : true
}