> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocoondata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# <access-service>/api/v1/dashboard/users/activity

## URL structure&#x20;

```text theme={null}
https://access-service.xy-company.com/api/v1/dashboard/users/activity
```

## Supported methods and overview&#x20;

* `GET` - retrieves data about [Cocoon Data users](/CS1.2/admin-org/administering-users-within-an-organisation.md)' daily sign-in activities on the Cocoon Data Platform over a period of time until the current day.

## Detailed description&#x20;

This API endpoint retrieves data values about Cocoon Data users' daily sign-in activities on the Cocoon Data Platform over a period of time until the current day.

These activities (calculated for each day of the time period specified) include the numbers of Cocoon Data users (for each [account type](/CS1.2/admin-org/administering-users-within-an-organisation.md#account-type)) who successfully signed in, the total numbers of users who failed to sign in and the date for each day of the time period specified.

By default, daily sign-in activities from the last 7 days are returned in the [response](/CS1.2/api/access-service-api-v1-dashboard-users-activity.md#access-service-api-v1-dashboard-users-activity-returns) from this API endpoint. However, daily sign-in activities from the last day up to the last year (i.e. 365 days) can be retrieved.

The information returned by this API endpoint is utilised on the [SafeShare Administration dashboard](/CS1.2/admin-platform/accessing-platform-administration.md#the-platform-administration-dashboard).

## Supported roles&#x20;

This API endpoint supports the following Cocoon Data user [roles](/CS1.2/admin-platform/administering-platform-administrator-users.md#platform-administrators-and-user-roles) (as described in the [SafeShare Administrator's Guide](/CS1.2/admin-platform.md)):

* [SafeShare administrator](/CS1.2/admin-platform/administering-platform-administrator-users.md#platform-administrator-role)

The Cocoon Data Platform's resources available to one of these Cocoon Data users (above) is determined by the access token submitted in the [header](/CS1.2/api/access-service-api-v1-dashboard-users-activity.md#access-service-api-v1-dashboard-users-activity-required-headers) of requests to this endpoint.

## Required headers&#x20;

The appropriate access token as the `Bearer` token:

* `Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...`

## Optional parameters&#x20;

The following optional parameter can be sent in the **URL** of the GET request:

* **lastDays** - An integer value representing the number of days back from the current time through which to calculate daily data values for all sign-in activities retrieved by this API endpoint. \

  **Notes:**

  * If this parameter is not specified, then a default value of `7` days is assumed.
  * If a parameter value is specified which is outside the permitted range of `1` to `365` days, then the default of `7` days is assumed.
* **uniqueLogin** - A boolean value representing whether or not to retrieve values representing a maximum of one sign-in success/failure per Cocoon Data user account (i.e. `true`) or each/every sign-in success/failure event (i.e. `false`). If this parameter is not specified, then the default value is `false`. \

  **Example (request):**

  ```text theme={null}
  https://access-service.xy-company.com/api/v1/dashboard/users/activity?lastDays=14
  ```

## Returns&#x20;

A JSON-formatted response containing the following members:

* **daysReported** - An array containing date and time values for the last number of days specified by the **lastDays** parameter in the request.
* **loginFailures** - An array containing the number of sign-in failures corresponding to the last number of days specified by the **lastDays** parameter in the request.
* **loggedInUsersExternal** - An array containing the number of successful sign-in attempts for Cocoon Data user accounts of the **External** [Account Type](/CS1.2/admin-org/administering-users-within-an-organisation.md#account-type), corresponding to the last number of days specified by the **lastDays** parameter in the request.
* **loggedInUsersLocal** - An array containing the number of successful sign-in attempts for Cocoon Data user accounts of the **Local** Account Type, corresponding to the last number of days specified by the **lastDays** parameter in the request.
* **loggedInUsersLDAP** - An array containing the number of successful sign-in attempts for Cocoon Data user accounts of the **LDAP** Account Type, corresponding to the last number of days specified by the **lastDays** parameter in the request. \

  **Example (response):**

  ```json theme={null}
  {
      "daysReported": ["2016-09-09T14:00:00.000Z", "2016-09-10T14:00:00.000Z", "2016-09-11T14:00:00.000Z", "2016-09-12T14:00:00.000Z", "2016-09-13T14:00:00.000Z", "2016-09-14T14:00:00.000Z", "2016-09-15T14:00:00.000Z"],
      "loginFailures": [0, 0, 0, 1, 1, 0, 0],
      "loggedInUsersExternal": [0, 0, 0, 0, 0, 0, 0],
      "loggedInUsersLocal": [0, 0, 6, 10, 15, 12, 5],
      "loggedInUsersLDAP": [0, 0, 0, 0, 0, 0, 0]
  }
  ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.