Get History

GET /gym/visit/{client_id}

Get any client's gym visit history using their client_id.

Path parameters

  • client_id integer Required

    Id of the client in database

Responses

  • 200 application/json

    Successful retrieval of client's gym visit history.

    Hide response attributes Show response attributes object
    • success boolean

      Whether the retrieval is successful

    • visit_history array[object]
      Hide visit_history attributes Show visit_history attributes object
    • graph object
      Hide graph attribute Show graph attribute object
      • * number Additional properties
  • 401 application/json

    User is not unauthorized or permissions are missing.

    Hide response attributes Show response attributes object
  • 404 application/json

    Nothing found with given input.

    Hide response attributes Show response attributes object
  • 429 application/json

    Rate limit exceeded - 100 queries per 15 minutes.

    Hide response attributes Show response attributes object
GET /gym/visit/{client_id}
curl \
 -X GET http://63.141.232.244:25540/v0/gym/visit/{client_id} \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "visit_history": [
    {
      "gym_id": 1,
      "left_at": "2024-10-10T20:36:47Z",
      "entered_at": "2024-10-10T18:36:47Z",
      "visit_history_id": 1
    }
  ],
  "graph": {
    "2024-10-01": 8280000,
    "2024-10-02": 0,
    "2024-10-03": 3600000
  }
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (404)
{
  "success": false,
  "error": "Not found"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}