Groups

Get all groups

GET /groups

Query string parameters

Response
Status code 200

{
  "data": [
    {
      "id": 1,
      "name": "Group 1",
      "created_at": "2015-05-28 11:42:36",
      "updated_at": "2015-05-28 11:42:36"
    },
    {
      "id": 2,
      "name": "Group 2",
      "created_at": "2015-05-28 11:42:36",
      "updated_at": "2015-05-28 11:42:36"
    }
  ],
  "pagination": {
    "total": 2,
    "page": 1,
    "per_page": 15,
    "urls": {
      "previous": null,
      "next": null
    }
  }
}

Get a group

GET /groups/:group_id

Response
Status code 200

{
  "id": 1,
  "name": "Group 1",
  "teams": [
    {
      "id": 1,
      "name": "Team 1",
      "address_1": "Savannah 123",
      "address_2": "Under the tree on the left",
      "zip_code": "4730",
      "city": "Umzimkulu",
      "state": "KwaZulu-Natal",
      "country": null,
      "phone_number": "031 308 7900",
      "website": "https://easir.com",
      "vat": "1234567890123456",
      "created_at": "2014-01-01 12:45:56",
      "updated_at": "2014-01-02 00:11:22"
    }
  ],
  "created_at": "2015-05-28 11:42:36",
  "updated_at": "2015-05-28 11:42:36"
}

Create a group

POST /groups

Parameters

  • name string
    • Required
    • Maximum 255 characters

Payload

{
  "name": "Lorem ipsum dolor sit amet"
}

Response
Status code 201

{
  "id": 4,
  "name": "Lorem ipsum dolor sit amet",
  "created_at": "2015-05-28 12:05:44",
  "updated_at": "2015-05-28 12:05:44"
}

Update a group

PUT /groups/:group_id

Parameters

  • name string
    • Required
    • Maximum 255 characters

Payload

{
  "name": "Dolor sit amet"
}

Response
Status code 200

{
  "id": 4,
  "name": "Dolor sit amet",
  "created_at": "2015-05-28 12:05:44",
  "updated_at": "2015-05-28 12:06:50"
}

Delete a group

DELETE /groups/:group_id

Response
Status code 204

Attach a team to a group

PUT /groups/:group_id/teams/:team_id

Response
Status code 204

Detach a team from a group

DELETE /groups/:group_id/teams/_team_id

Response
Status code 204