Skip to content
Alykhan Kanji edited this page Nov 21, 2019 · 9 revisions
  1. List teams
  2. Get team statistics
  3. Get team
  4. Create team
  5. Edit team
  6. Delete team

List teams

GET /teams

Response

Status: 200 OK
[
  {
    "id": 1,
    "name": "t1",
    "image": null,
    "creator_id": "p1",
    "hidden": false,
    "participants": [
      {
        "id": 1,
        "fbid": "p1"
      }
    ],
    "achievements": [
      {
        "id": 1,
        "name": "a1",
        "distance": 1
      }
    ]
  }
]

Get team statistics

GET /teams/stats/:event

Response

Status: 200 OK
[
  {
    "id": 1,
    "name": "t1",
    "image": null,
    "hidden": false,
    "distance": 10000,
    "commitment": 100000
  },
  {
    "id": 2,
    "name": "t2",
    "image": null,
    "hidden": false,
    "distance": 20000,
    "commitment": 200000
  }    
]

Get team

GET /teams/:id

Response

Status: 200 OK
{
  "id": 1,
  "name": "t1",
  "image": null,
  "creator_id": "p1",
  "hidden": false,
  "participants": [
    {
      "id": 1,
      "fbid": "p1"
    }
  ],
  "achievements": [
    {
      "id": 1,
      "name": "a1",
      "distance": 1
    }
  ]
}

Create team

POST /teams

Parameters

Name Type Description
name string Required. The name of the team.
image string The URL for the team image.
creator_id string Required. The fbid of the creator.
hidden boolean The visibility status of the team. Defaults to false.

Response

Status: 201 Created
{
  "id": 1,
  "name": "t1",
  "image": null,
  "creator_id": "p1",
  "hidden": false
}

Edit team

PATCH /teams/:id

Parameters

Name Type Description
name string The name of the team.
image string The URL for the team image.
creator_id string The fbid of the creator.
hidden boolean The visibility status of the team.

Response

Status: 200 OK
[1]

Delete team

DELETE /teams/:id

Response

Status: 204 No Content
Clone this wiki locally