Response Schema

The API is only accessible via HTTPS and all data is sent and received as JSON (unless otherwise specified by specific resource endpoints). For example:

curl -i -H "X-Api-Key: <key>"

HTTP/1.0 200 OK
Content-Type: application/json
Vary: Cookie
x-content-type-options: nosniff
X-Frame-Options: SAMEORIGIN
X-RateLimit-Interval: 6.0
X-RateLimit-Limit: 1800
X-RateLimit-Remaining: 1799
X-RateLimit-Reset: 1485715956
Connection: close
Server: Cloudsmith MCP
Date: Sun, 29 Jan 2017 17:52:35 GMT

  "authenticated": true,
  "slug": "example",
  "slug_perm": "A8mbAfka2fGG",
  "name": "Example User",
  "email": "[email protected]"

Other things to note:

  • Blank fields are included as "null" instead of being omitted.
  • Timestamps are always UTC and in the ECMA-262 format: YYYY-MM-DDTHH:MM:SS.SSSZ
  • You can specify pretty=true in the querystring to get formatted (indent=2) JSON.

Summary Resource Representations

When GET requests return a list of resources, or the resource is in the context of another resource (i.e. a sub-resource), the data for those resources only includes a subset of all the available attributes, i.e. a summary representation. This is due to performance reasons in which certain attributes are expensive to compute. In order to see the fully detailed representation of a resource, fetch it individually, where required.

Detailed Resource Representations

When requests for a specific resource are issued the fully detailed representation for that resource will be returned, which will include all attributes that are exposed by the API for that resource type. Note that this is subject to authentication, where certain resources will vary the amount of attributes returned depending on the authorisation of the authenticated user. Please refer to the documentation for specific resource endpoints for details.