Skip to content

Participants

Alykhan Kanji edited this page Oct 27, 2019 · 7 revisions
  1. Get participant
  2. Get participant statistics
  3. Create participant
  4. Edit participant
  5. Delete participant

Get participant

GET /participants/:fbid

Response

Status: 200 OK
{
  "id": 1,
  "fbid": "p1",
  "registered": false
  "team_id": 1,
  "source_id": 1,
  "cause_id": 1,
  "event_id": 1,
  "team": {
    "id": 1,
    "name": "t1",
    "participants": [
      {
        "id": 1,
        "fbid": "p1"
      }
    ],
    "achievements": [
      {
        "id": 1,
        "name": "a1",
        "distance": 1
      }
    ]
  },
  "cause": {
    "id": 1,
    "name": "c1"
  },
  "event": {
    "id": 1,
    "name": "e1",
    "description": "E1.",
    "start_date": "2017-02-01T00:00:00.000Z",
    "end_date": "2017-12-31T00:00:00.000Z",
    "team_limit": 1,
    "team_building_start": "2017-01-01T00:00:00.000Z",
    "team_building_end": "2017-01-31T00:00:00.000Z",
    "locality_id": 1,
    "cause_id": 1
  },
  "records": [
    {
      "id": 1,
      "date": "2017-02-01T00:00:00.000Z",
      "distance": 1,
      "participant_id": 1,
      "source_id": 1
    }
  ],
  "source": {
    "id": 1,
    "name": "s1"
  }
}

Get participant statistics

GET /participants/:fbid/stats

Response

Status: 200 OK
{
  "distance": 1
}

Create participant

POST /participants

Parameters

Name Type Description
fbid string Required. The Facebook ID of the participant.
registered boolean The registration status of the participant with AKF. Defaults to false.

Response

Status: 201 Created
{
    "id": 1,
    "fbid": "p1"
    "registered": false
}

Edit participant

PATCH /participants/:fbid

Parameters

Name Type Description
fbid string The Facebook ID of the participant.
registered boolean The registration status of the participant with AKF.
team_id integer The team of the participant.
event_id integer The event of the participant.
source_id integer The source of the participant.
cause_id integer The cause of the participant.

Response

Status: 200 OK
[1]

Delete participant

DELETE /participants/:fbid

Response

Status: 204 No Content
Clone this wiki locally