Add Gym

POST /gym

Add new gym. You can only add gym if you're admin.

application/json

Body Required

Responses

  • 200 application/json

    Successful adding of a gym.

    Hide response attributes Show response attributes object
    • success boolean

      Whether gym was added

    • gym object

      Additional properties are allowed.

      Hide gym attributes Show gym attributes object
      • gym_id integer Required

        Id of the gym in database

      • city string Required

        City where gym is located

      • street string Required

        Street where gym is located

      • building string Required

        Building number

      • description string Required

        Gym's description

  • 400 application/json

    Validation error of given input.

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

    User is not unauthorized or permissions are missing.

    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
POST /gym
curl \
 -X POST http://63.141.232.244:25540/v0/gym \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"city":"Казань","street":"Хади Такташа","building":"24","description":"Фитнес-клуб премиум-класса, расположенный в самом сердце Казани."}'
Request examples
{
  "city": "Казань",
  "street": "Хади Такташа",
  "building": "24",
  "description": "Фитнес-клуб премиум-класса, расположенный в самом сердце Казани."
}
Response examples (200)
{
  "success": true,
  "gym": {
    "city": "Казань",
    "gym_id": 1,
    "street": "Хади Такташа",
    "building": "24",
    "description": "Фитнес-клуб премиум-класса, расположенный в самом сердце Казани."
  }
}
Response examples (400)
{
  "success": false,
  "error": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": [
        "client_id"
      ],
      "message": "Required"
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}