GET /fighters
List of fighters

Supported Formats

json

Errors

Code Description
404 Not Found
500 Internal Server error

Examples

DEFAULT without tag parameter

Request
{
  per_page: 10,
  page: 1
}

Response
{
  "data": [
    {
      "id": 1,
      "name": "John Doe",
      "nickname": "Doe",
      "bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
      "tag": "fighter",
      "division": "Heavyweight",
      "gender": "Male",
      "featured": false,
      "temporary": false,
      "avatar_url": "https://api.lfa.com/rails/active_storage/representations/avatar.jpg",
      "small_avatar_url": "https://api.lfa.com/rails/active_storage/representations/small_avatar.jpg",
      "statistics": [
          {
              "name": "Wins",
              "value": 10
          },
          {
              "name": "Losses",
              "value": 2
          },
          {
              "name": "Draws",
              "value": 0
          }
      ],
      "social_media": [
          {
              "name": "twitter",
              "user": "username",
              "link": "https://www.twitter.com/username"
          }
      ]
    },
    {
      "id": 2,
      "name": "Jane Doe",
      "nickname": "Doe",
      "bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
      "tag": "hall_of_legacy",
      "division": "Heavyweight",
      "gender": "Female",
      "featured": false,
      "temporary": false,
      "avatar_url": "https://api.lfa.com/rails/active_storage/representations/avatar.jpg",
      "small_avatar_url": "https://api.lfa.com/rails/active_storage/representations/small_avatar.jpg",
      "statistics": [
          {
              "name": "Wins",
              "value": 21
          },
          {
              "name": "Losses",
              "value": 6
          },
          {
              "name": "Draws",
              "value": 0
          }
      ],
      "social_media": [
          {
              "name": "twitter",
              "user": "username",
              "link": "https://www.twitter.com/username"
          }
      ]
    }
  ],
  "pagination": {
      "per_page": 10,
      "page": 1,
      "total_pages": 1,
      "total": 2
  }
}
Request
{
  tag: 'fighters',
  per_page: 10,
  page: 1
}

Response
{
  "data": [
    {
      "id": 1,
      "name": "John Doe",
      "nickname": "Doe",
      "bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
      "tag": "fighter",
      "division": "Heavyweight",
      "gender": "Male",
      "featured": false,
      "temporary": false,
      "avatar_url": "https://api.lfa.com/rails/active_storage/representations/avatar.jpg",
      "small_avatar_url": "https://api.lfa.com/rails/active_storage/representations/small_avatar.jpg",
      "statistics": [
          {
              "name": "Wins",
              "value": 10
          },
          {
              "name": "Losses",
              "value": 2
          },
          {
              "name": "Draws",
              "value": 0
          }
      ],
      "social_media": [
          {
              "name": "twitter",
              "user": "username",
              "link": "https://www.twitter.com/username"
          }
      ]
    },
    {
      "id": 2,
      "name": "Jane Doe",
      "nickname": "Doe",
      "bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
      "tag": "fighter",
      "division": "Heavyweight",
      "gender": "Female",
      "featured": false,
      "temporary": false,
      "avatar_url": "https://api.lfa.com/rails/active_storage/representations/avatar.jpg",
      "small_avatar_url": "https://api.lfa.com/rails/active_storage/representations/small_avatar.jpg",
      "statistics": [
          {
              "name": "Wins",
              "value": 21
          },
          {
              "name": "Losses",
              "value": 6
          },
          {
              "name": "Draws",
              "value": 0
          }
      ],
      "social_media": [
          {
              "name": "twitter",
              "user": "username",
              "link": "https://www.twitter.com/username"
          }
      ]
    }
  ],
  "pagination": {
      "per_page": 10,
      "page": 1,
      "total_pages": 1,
      "total": 2
  }
}

Params

Param name Description
tag
optional

Filter the list by kind of fighter. It can be fighters/champions/hall_of_legacy

Validations:

  • Must be a String

per_page
optional

Number of records per page

Validations:

  • Must be a Integer

page
optional

Page number

Validations:

  • Must be a Integer


GET /fighters/:id
Single fighter

Supported Formats

json

Errors

Code Description
404 Not Found
500 Internal Server error

Examples

Request
{
  id: 3
}

Response
{
  "id": 3,
  "name": "Jane Doe",
  "nickname": "Doe",
  "bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
  "tag": "fighter",
  "division": "Heavyweight",
  "gender": "Female",
  "featured": false,
  "temporary": false,
  "avatar_url": "https://api.lfa.com/rails/active_storage/representations/avatar.jpg",
  "small_avatar_url": "https://api.lfa.com/rails/active_storage/representations/small_avatar.jpg",
  "statistics": [
      {
          "name": "Wins",
          "value": 21
      },
      {
          "name": "Losses",
          "value": 6
      },
      {
          "name": "Draws",
          "value": 0
      }
  ],
  "social_media": [
      {
          "name": "twitter",
          "user": "username",
          "link": "https://www.twitter.com/username"
      }
  ]
}

Params

Param name Description
id
required

ID of the fighter

Validations:

  • Must be a Integer