> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/api-docs-contextual-information/player-activity.md).

# Player Activity

\[ Base URL: `api.ggwp.com`]

`POST` /users/v1/activity&#x20;

## **Description**

To provide a holistic snapshot of a player's contribution to the community, GGWP takes a player's activity into account. This information is used by GGWP to calibrate reputation scores, to adjust reporter credibilities (when applicable) and to derive relevant metrics that can be consumed through the player's profile page.&#x20;

## **Parameters**

`body`: Dictionary containing the following fields:

* **user\_id**: ID of the player/user
* **login\_time**: Timestamp in the format *YYYY-MM-DD HH:MM:SS*, in UTC
* (OPTIONAL) **logout\_time:** Timestamp in the format *YYYY-MM-DD HH:MM:SS*, in UTC
* (OPTIONAL) **username** : Name of player/user
* (OPTIONAL) **source** : Indicates the source to which the user belongs.
  * Accepted values : chat, voice, game, discord
  * Default value : chat
* Sample Call

  ```bash
  curl --request POST 'https://api.ggwp.com/users/v1/activity' \
  --header 'x-api-key: api_key' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "user_id": "<id1>",
    "login_time": "2022-09-10 23:03:27",
    "logout_time": "2022-10-10 23:03:27",
    "username": "<username>",
    "source" : "<source>"
  }'
  ```

## **Output**

* 200 - successful operation

  ```json
  {
      "success": true
  }
  ```
* 400 - Bad request
  * Error response. The user activity has not been logged into the system. This error is thrown when value passed in
    * `user_id`
      * Field missing from request body
    * `login_time`
      * Field is not a valid timestamp
      * Field missing from request body
      * login\_time can not be greater than logout\_time
    * `logout_time`
      * Field is not a valid timestamp
      * login\_time can not be greater than logout\_time
    * `source`
      * source accepts only these values(chat/voice/game/discord)&#x20;
* 403
  * Invalid or missing API key
* 500
  * Error response. The user activity has not been logged into the system. There was some error on the server while processing the request
