Collections¶
List public collections or retrieve one collection. Account-specific creation, editing and deletion are documented under Users.
Examples¶
<?php
$url = 'https://galleryapi.dabbble.app/v1/collections?pageSize=20';
$headers = "Accept: application/json\r\n";
$context = stream_context_create(['http' => [
'timeout' => 20, 'header' => $headers
]]);
$body = @file_get_contents($url, false, $context);
if ($body === false) { exit('API request failed.'); }
$data = json_decode($body, true);
if (!is_array($data)) { exit('Invalid JSON response.'); }
echo '<pre>' . htmlspecialchars(json_encode($data, JSON_PRETTY_PRINT),
ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</pre>';
?>
// Save as example.mjs and run: node example.mjs
async function main() {
const response = await fetch('https://galleryapi.dabbble.app/v1/collections?pageSize=20', {
headers: { Accept: 'application/json' },
signal: AbortSignal.timeout(20000)
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
}
main().catch(error => { console.error(error.message); process.exitCode = 1; });
<pre id="results">Loading…</pre>
<script type="module">
const output = document.getElementById('results');
try {
const response = await fetch('https://galleryapi.dabbble.app/v1/collections?pageSize=20');
if (!response.ok) throw new Error(`HTTP ${response.status}`);
output.textContent = JSON.stringify(await response.json(), null, 2);
} catch (error) {
output.textContent = 'Unable to load data.';
console.error(error);
}
</script>
import json
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
headers = {'Accept': 'application/json'}
request = Request('https://galleryapi.dabbble.app/v1/collections?pageSize=20', headers=headers)
try:
with urlopen(request, timeout=20) as response:
data = json.load(response)
print(json.dumps(data, indent=2))
except (HTTPError, URLError, TimeoutError, ValueError) as error:
print(f'API request failed: {error}')
using System;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(20) };
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
try
{
using var response = await client.GetAsync("https://galleryapi.dabbble.app/v1/collections?pageSize=20");
response.EnsureSuccessStatusCode();
using var document = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
Console.WriteLine(document.RootElement);
}
catch (Exception error) when (error is HttpRequestException
or TaskCanceledException or JsonException)
{
Console.Error.WriteLine(error.Message);
}
Endpoint Reference¶
asset_collection_url is a string path parameter. The accepted identifier format is not explained by the specification; do not assume it is interchangeable with collectionId or an API endpoint URL.
GET /v1/collections¶
Collection List
Authentication: No security requirement declared.
| Parameter | Location | Type | Required | Details |
|---|---|---|---|---|
pageToken | query | string or null | No | |
pageSize | query | string or null | No |
| Status | Description | Response schema |
|---|---|---|
200 | OK | PagedAssetCollectionSchema |
GET /v1/collections/{asset_collection_url}¶
Collection Show
Authentication: No security requirement declared.
| Parameter | Location | Type | Required | Details |
|---|---|---|---|---|
asset_collection_url | path | string | Yes |
| Status | Description | Response schema |
|---|---|---|
200 | OK | AssetCollectionSchema |
Response Schemas¶
Nested assets use AssetSchema, documented under Assets. Pagination is explained in the overview.
PagedAssetCollectionSchema¶
| Field | Type | Required | Details |
|---|---|---|---|
collections | array of AssetCollectionSchema | Yes | |
totalSize | integer | Yes | |
nextPageToken | string or null | No |
AssetCollectionSchema¶
| Field | Type | Required | Details |
|---|---|---|---|
collectionId | string | Yes | |
name | string | Yes | |
description | string or null | No | |
url | string | Yes | |
createTime | string (date-time) | Yes | |
updateTime | string (date-time) or null | Yes | |
visibility | string | Yes | |
imageUrl | string or null | No | |
assets | array of AssetSchema or null | No |