Projects API

list

GET /api/2/organizations/:organization_id/projects/

Example Response

HTTP Status: 200 OK
[
  {
    "id": 2,
    "name": "Better Project",
    "graphs":
    [
      {
        "id": 2,
        "project_id": 3,
        "created_at": "2016-01-29T19:45:22.506Z",
        "updated_at": "2016-01-29T19:45:22.506Z",
        "title": "Metrics Received",
        "position": 1,
        "units": "y units",
        "stacked": false,
        "continuous": false,
        "metrics": ["collector.metrics_received"],
        "group_id": null
      }
    ]
  },
  {
    "id": 3,
    "name": "Best Project",
    "graphs":
    [
      {
        "id": 1,
        "project_id": 2,
        "created_at": "2016-01-29T19:43:49.513Z",
        "updated_at": "2016-01-29T19:43:49.513Z",
        "title": "Metrics Received",
        "position": 1,
        "units": "y units",
        "stacked": false,
        "continuous": false,
        "metrics": ["collector.metrics_received"],
        "group_id": null
      }
    ]
  }
]

show

GET /api/2/organizations/:organization_id/projects/:project_id

Example Response

HTTP Status: 200 OK
{
  "id":  2,
  "name": "Best Project",
  "graphs":
  [
    {
      "id": 1,
      "project_id": 2,
      "created_at": "2016-01-29T19:43:49.513Z",
      "updated_at": "2016-01-29T19:43:49.513Z",
      "title": "Metrics Received",
      "position": 1,
      "units": "y units",
      "stacked": false,
      "continuous": false,
      "metrics": ["collector.metrics_received"],
      "group_id": null
    }
  ]
}

create

POST /api/2/organizations/:organization_id/projects/

Example Post Body

{
  "name": "New Project"
}

Example Response

HTTP Status: 201 OK
{
  "name": "New Project",
  "graphs": [],
  "id": 6
}

update

PATCH /api/2/organizations/:organization_id/projects/:project_id

Example Post Body

{
  "name": "Different Project"
}

Example Response

HTTP Status: 204 NO CONTENT
{
  "id": 2,
  "name": "Different Project",
  "graphs":
  [
    {
      "id": 1,
      "project_id": 2,
      "created_at": "2016-01-29T19:43:49.513Z",
      "updated_at": "2016-01-29T19:48:29.200Z",
      "title": "Metrics Received",
      "position": 1,
      "units": "y units",
      "stacked": false,
      "continuous": false,
      "metrics": ["collector.metrics_received"],
      "group_id": null
    }
  ]
}

destroy

DELETE /api/2/organizations/:organization_id/projects/:project_id

Example Response

HTTP Status: 200 OK