Docs
Notes...
Currently snippets are set to expire after 604800 seconds (1 week).
Please treat the id's as opaque, they can change.
API
Endpoints
- POST /api
- PUT /api/:snippet_id
- GET /api/:snippet_id
- GET /api/:snippet_id/raw
- GET /api/:snippet_id/versions/:version_id
- GET /api/:snippet_id/versions/:version_id/raw
POST /api
POST to this endpoint to create a new snippet.
Content-Type must be application/json.
Example response:
{
"url": "https://amnesia.im/b53x36xkv4z6gfugzc2mrxmwswuwbyhc7e4nvgh53mxn2lssd6fa/versions/wwlryoikzf734bqy7wmomzogp3o5m6mcltratpmfnilbqzy5sq4a",
"id": "b53x36xkv4z6gfugzc2mrxmwswuwbyhc7e4nvgh53mxn2lssd6fa",
"content": "The content of my snippet",
"version_id": "wwlryoikzf734bqy7wmomzogp3o5m6mcltratpmfnilbqzy5sq4a",
"version": 1,
"latest_version_id": "wwlryoikzf734bqy7wmomzogp3o5m6mcltratpmfnilbqzy5sq4a",
"extension": "ex",
"content_size": 25,
"ttl": 3600,
"remaining_ttl": 3600,
"versions": [
{
"id": "wwlryoikzf734bqy7wmomzogp3o5m6mcltratpmfnilbqzy5sq4a",
"snippet_id": "b53x36xkv4z6gfugzc2mrxmwswuwbyhc7e4nvgh53mxn2lssd6fa",
"parent_id": null,
"version": 1
}
]
}
PUT /api/:snippet_id
Update a snippet.
Content-Type must be application/json.
The return will be the reflected snippet.
GET /api/:snippet_id
Get the latest version of a snippet by :snippet_id.
GET /api/:snippet_id/raw
Get the raw content of the latest snippet version.
GET /api/:snippet_id/versions/:version_id
Get a version of a snippet by passing :snippet_id and :version_id.
GET /api/:snippet_id/versions/:version_id/raw
Get the raw content of a snippet version.