title | type | order |
---|---|---|
Snippets |
api |
3 |
NOTE -- All parameters are mandatory unless otherwise noted.
GET /snippets
[
{
"object": "snippet",
"id": "snp_Q33jTLFc2ayG9KrF2Vcm4F",
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>",
"created": 5858858124,
"modified": 5938868250
}
]
GET /snippets/(:id)
{
"object": "snippet",
"id": "snp_Q33jTLFc2ayG9KrF2Vcm4F",
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>",
"created": 5858858124,
"modified": 5938868250
}
POST /snippets
- name -- Name of the snippet
- body -- Contents for the snippet
{
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>"
}
{
"success": true,
"status": "OK",
"snippet": {
"object": "snippet",
"id": "snp_Q33jTLFc2ayG9KrF2Vcm4F",
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>",
"created": 5858858124,
"modified": 5938868250
}
}
PUT /snippets/(:id)
- name -- Name of the snippet
- body -- Contents for the snippet
{
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>"
}
{
"success": true,
"status": "OK",
"snippet": {
"object": "snippet",
"id": "snp_Q33jTLFc2ayG9KrF2Vcm4F",
"name": "My First Snippet",
"body": "<h1>Welcome!</h1>",
"created": 5858858124,
"modified": 5938868250
}
}
DELETE /snippets/(:id)
{
"success": true,
"status": "OK"
}