curl --request GET \
--url 'https://snippets.glot.io/snippets'
curl --request GET \
--url 'https://snippets.glot.io/snippets?page=5&per_page=3'
curl --request GET \
--url 'https://snippets.glot.io/snippets?owner=anonymous'
curl --request GET \
--url 'https://snippets.glot.io/snippets?language=erlang'
curl --request GET \
--url 'https://snippets.glot.io/snippets?owner=anonymous&language=erlang'
curl --request GET \
--header 'Authorization: Token 0123456-789a-bcde-f012-3456789abcde' \
--url 'https://snippets.glot.io/snippets'
curl --request GET \
--header 'Authorization: Token 0123456-789a-bcde-f012-3456789abcde' \
--url 'https://snippets.glot.io/snippets?page=5&per_page=3'
curl --request GET \
--header 'Authorization: Token 0123456-789a-bcde-f012-3456789abcde' \
--url 'https://snippets.glot.io/snippets?language=erlang'
[
{
"url": "https://snippets.glot.io/snippets/e2txam1f3x",
"id": "e2txam1f3x",
"created": "2015-04-23T22:04:09Z",
"modified": "2015-04-23T22:04:09Z",
"language": "php",
"title": "Hello world",
"public": true,
"owner": "anonymous",
"files_hash": "7d87ee5fa673a6260abc705d56ac7b35b457f566"
},
{
"url": "https://snippets.glot.io/snippets/e2txa5itxb",
"id": "e2txa5itxb",
"created": "2015-04-23T22:03:41Z",
"modified": "2015-04-23T22:03:41Z",
"language": "perl",
"title": "Hello world",
"public": true,
"owner": "anonymous",
"files_hash": "20f74f4277cafb12cd46e68008574dc92c5be35e"
}
]
Information about pagination is provided by the Link header in the response.
Pagination is controlled by the page
and per_page
query parameters. page
must be >= 1, and per_page
must
be <= 100. If the per_page
parameter is not given it defaults to 100.
link: <https://snippets.glot.io/snippets?page=16&per_page=2>; rel="next",
<https://snippets.glot.io/snippets?page=18&per_page=2>; rel="last",
<https://snippets.glot.io/snippets?page=14&per_page=2>; rel="prev",
<https://snippets.glot.io/snippets?page=1&per_page=2>; rel="first"