Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Get competition

Marc Orfila Carreras edited this page Aug 6, 2023 · 1 revision

Retrieves the details of a specific competition by its ID.

URL

GET /v1/competitions/<competition_id>

Example Request

import requests

url = "http://127.0.0.1/v1/competitions/1"

response = requests.get(url)

print(response.json())

Response Parameters

Name Type Description
status string The status of the API response. Supported values: success or fail. This field indicates whether the API request was successful or encountered an error.
data object An object containing the data returned by the API. This field encapsulates the main payload of the response.
message string A descriptive message providing information about any encountered errors. This field is populated only when the API response status is fail, and it helps identify the specific issue that occurred during the request processing.

Example Response

Code 200
{
  "data": {
    "id": 1,
    "last_update": "2023-08-05",
    "name": "A1 Padel Global",
    "url": "https://www.a1padelglobal.com/"
  },
  "status": "success"
}
Code 206
{
  "data": {
      "message": "The requested competition was not found"
  },
  "status": "fail"
}
Clone this wiki locally