Authorization

Authorization should be sent in the header.

curl -1 <url> -H 'Authorization: apikey <user>:<api_key>'

Format

GET <url>
Query Parameters:
 
  • format -- One of 'json', 'xml' (default json). Utilization API also supports 'csv'.

Example request:

Filtering

When performing GET on lists, filters can be sent as a part of the query string. Spaces and special characters must be url encoded.

Example request:

curl -1 https://platform.swiftstack.com/api/v1/clusters?name=StagingCluster -H 'Authorization: apikey <user>:<api_key>'

Example response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "meta": {
    "limit": 2,
    "next": null,
    "offset": 2,
    "previous": "https://platform.swiftstack.com/api/v1/clusters?limit=2",
    "total_count": 4
  },
  "objects": [
    {
      "name": "StagingCluster",
      "resource_uri": "/api/v1/clusters/1/",
      "uuid": "e2e88667-e609-401e-8df6-3ae7c1e9835b"
    },
  ]
}

When a list can be filtered on the value of another object that also supports filters, you can concatenate the filters separated by '__'.

Example request:

In this example, users can be filtered by cluster which can be filtered by name.

curl -1 https://platform.swiftstack.com/api/v1/users?cluster__name=StagingCluster -H 'Authorization: apikey <user>:<api_key>'