FORMAT: 1A
Gist Fox API is a pastes service similar to GitHub's Gist.
Currently the Gist Fox API does not provide authenticated access.
Where applicable this API uses the HAL+JSON media-type to represent resources states and affordances.
Requests with a message-body are using plain JSON to set or update resource states.
The common HTTP Response Status Codes are used.
Gist Fox API entry point.
This resource does not have any attributes. Instead it offers the initial API affordances in the form of the HTTP Link header and HAL links.
- Response 200 (application/hal+json)
-
Headers
Link: <http:/api.gistfox.com/>;rel="self",<http:/api.gistfox.com/gists>;rel="gists"
-
Body
{ "_links": { "self": { "href": "/" }, "gists": { "href": "/gists?{since}", "templated": true } } }
-
Gist-related resources of Gist Fox API.
A single Gist object. The Gist resource is the central resource in the Gist Fox API. It represents one paste - a single text note.
The Gist resource has the following attributes:
- id
- created_at
- description
- content
The states id and created_at are assigned by the Gist Fox API at the moment of creation.
-
Parameters
- id (string) - ID of the Gist in the form of a hash.
-
Model (application/hal+json)
HAL+JSON representation of Gist Resource. In addition to representing its state in the JSON form it offers affordances in the form of the HTTP Link header and HAL links.
-
Headers
Link: <http:/api.gistfox.com/gists/42>;rel="self", <http:/api.gistfox.com/gists/42/star>;rel="star"
-
Body
{ "_links": { "self": { "href": "/gists/42" }, "star": { "href": "/gists/42/star" } }, "id": "42", "created_at": "2014-04-14T02:15:15Z", "description": "Description of Gist", "content": "String contents" }
-
-
Response 200
[Gist][]
To update a Gist send a JSON with updated value for one or more of the Gist resource attributes. All attributes values (states) from the previous version of this Gist are carried over by default if not included in the hash.
-
Request (application/json)
{ "content": "Updated file contents" }
-
Response 200
[Gist][]
- Response 204
Collection of all Gists.
The Gist Collection resource has the following attribute:
- total
In addition it embeds Gist Resources in the Gist Fox API.
-
Model (application/hal+json)
HAL+JSON representation of Gist Collection Resource. The Gist resources in collections are embedded. Note the embedded Gists resource are incomplete representations of the Gist in question. Use the respective Gist link to retrieve its full representation.
-
Headers
Link: <http:/api.gistfox.com/gists>;rel="self"
-
Body
{ "_links": { "self": { "href": "/gists" } }, "_embedded": { "gists": [ { "_links" : { "self": { "href": "/gists/42" } }, "id": "42", "created_at": "2014-04-14T02:15:15Z", "description": "Description of Gist" } ] }, "total": 1 }
-
-
Parameters
- since (string, optional) - Timestamp in ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZ
Only gists updated at or after this time are returned.
- since (string, optional) - Timestamp in ISO 8601 format:
-
Response 200
[Gists Collection][]
To create a new Gist simply provide a JSON hash of the description and content attributes for the new Gist.
-
Request (application/json)
{ "description": "Description of Gist", "content": "String content" }
-
Response 201
[Gist][]
Star resource represents a Gist starred status.
The Star resource has the following attribute:
-
starred
-
Parameters
- id (string) - ID of the gist in the form of a hash
-
Model (application/hal+json)
HAL+JSON representation of Star Resource.
-
Headers
Link: <http:/api.gistfox.com/gists/42/star>;rel="self"
-
Body
{ "_links": { "self": { "href": "/gists/42/star" } }, "starred": true }
-
- Response 204
- Response 204
-
Response 200
[Star][]