Introduction
This documentation aims to provide all the information you need to work with our API.
SDKs
Software Development Kits (SDKs) allow developers to easily render 3D dice and interact with the API specifications below. We offer SDKs for the following languages:
If you have a particular language you wish to use dddice with, please let us know.
Authenticating requests
This API is authenticated by sending an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting My Account > Developers and clicking Copy API Key.
You must have an account to use the API.
Theme
API for managing themes.
List Themes
requires authentication
Fetch a list of themes. Only the most recent version of each theme is returned where the "most recent" is determined by SemVer 2.0.0
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/theme',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "theme[]",
"data": [
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "consequatur_sapiente",
"name": "Miss",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Blanditiis numquam ea ut incidunt adipisci non et assumenda. Velit consequuntur ut necessitatibus quisquam rem expedita ducimus. Vero quisquam a fuga ullam ratione quo.",
"user": {
"username": "sed_iure",
"uuid": "0f4c9bbf-c7de-11ed-9829-00224849bf5e",
"name": "Arden Bergnaum",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "voluptas_ad",
"name": "Miss",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Ipsa molestias itaque dolorem nostrum qui quidem. Illo vel ipsam et et non sapiente alias. Quia quos saepe sit blanditiis voluptatem et voluptatem. Quis ea eligendi doloribus iste tempore quisquam dolorem.",
"user": {
"username": "culpa_laborum",
"uuid": "0f4dfbf1-c7de-11ed-9829-00224849bf5e",
"name": "Marielle Dare II",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
]
}
Received response:
Request failed with error:
Create a Theme
requires authentication
Create a theme using a theme manifest and save to your dddice.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/theme" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "frag_shader=ratione" \
--form "manifest={"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}" \
--form "vert_shader=expedita" \
--form "assets[]=@/tmp/phpBhwu6s"
const url = new URL(
"https://dddice.com/api/1.0/theme"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('frag_shader', 'ratione');
body.append('manifest', '{"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}');
body.append('vert_shader', 'expedita');
body.append('assets[]', document.querySelector('input[name="assets[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/theme',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'frag_shader',
'contents' => 'ratione'
],
[
'name' => 'manifest',
'contents' => '{"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}'
],
[
'name' => 'vert_shader',
'contents' => 'expedita'
],
[
'name' => 'assets[]',
'contents' => fopen('/tmp/phpBhwu6s', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "unde_rem",
"name": "Ms.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Necessitatibus et voluptate minima voluptatem quam. Enim et dolores eveniet amet rem corrupti. Nisi voluptatem alias et.",
"user": {
"username": "ad_non",
"uuid": "0f54fb3c-c7de-11ed-9829-00224849bf5e",
"name": "Pascale Schmeler",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
}
Received response:
Request failed with error:
Get Theme
requires authentication
Get information about a theme. Returns the latest version.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme/dddice-standard" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/theme/dddice-standard',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "impedit_neque",
"name": "Dr.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Laborum sed enim vel occaecati non ducimus. Eveniet veritatis corrupti ea suscipit ut odio odit molestiae. Omnis a ducimus ab natus quo reiciendis. Ut sed sequi minus quisquam.",
"user": {
"username": "aut_quos",
"uuid": "0f57ba89-c7de-11ed-9829-00224849bf5e",
"name": "Miss Laurine Padberg",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
}
Received response:
Request failed with error:
Delete Theme
requires authentication
Delete all versions of a given theme.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/theme/dddice-standard" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/theme/dddice-standard',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Get All Theme Versions
requires authentication
List all versions of a given theme.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme/dddice-standard/version" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard/version"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/theme/dddice-standard/version',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "theme[]",
"data": [
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "optio_sequi",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Libero occaecati voluptates quae repellendus quod recusandae. Quas explicabo quibusdam nisi nam suscipit. Ad molestiae expedita ut voluptatem in omnis et earum.",
"user": {
"username": "esse_ipsam",
"uuid": "0f5bb0f7-c7de-11ed-9829-00224849bf5e",
"name": "Prof. Margarett Veum",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "officiis_laboriosam",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Vitae sapiente nulla quis optio quia. Necessitatibus perferendis non assumenda eaque rerum. Esse est est quidem. Iure nostrum debitis blanditiis aliquid.",
"user": {
"username": "in_aperiam",
"uuid": "0f5cf8d5-c7de-11ed-9829-00224849bf5e",
"name": "Dedrick Kirlin",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
]
}
Received response:
Request failed with error:
Get a Theme Version
requires authentication
Get a specific version of a given theme.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "soluta_officiis",
"name": "Mrs.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Voluptas itaque illo sed dignissimos quos. Earum quaerat sed beatae iste nulla rerum. Rerum porro voluptatum debitis.",
"user": {
"username": "corporis_necessitatibus",
"uuid": "0f60810a-c7de-11ed-9829-00224849bf5e",
"name": "Prof. Jay Bartoletti MD",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
}
Received response:
Request failed with error:
Delete Theme Version
requires authentication
Delete a specific version of a given theme.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/theme/dddice-standard/version/vel" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard/version/vel"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/theme/dddice-standard/version/vel',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Report Theme
requires authentication
Report a theme for abuse or spam.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/theme/dddice-standard/report" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/theme/dddice-standard/report"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/theme/dddice-standard/report',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Room
API for managing rooms.
List Rooms
requires authentication
List all rooms created or joined by a user
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/room" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/room',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "room[]",
"data": [
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "Jt-Fxbs",
"passcode": "nobis",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "mollitia_magni",
"uuid": "0eeac150-c7de-11ed-9829-00224849bf5e",
"name": "Dr. Leopold Kemmer III",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": [
{
"id": 2,
"username": "tempore_velit",
"color": "#5270d6",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "nam_itaque",
"uuid": "0eeb2ea6-c7de-11ed-9829-00224849bf5e",
"name": "Cydney Mitchell",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
},
{
"id": 3,
"username": "numquam_est",
"color": "#b3c89d",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "facere_esse",
"uuid": "0eeba45f-c7de-11ed-9829-00224849bf5e",
"name": "Miss Kenya Bechtelar Jr.",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "88M3QkB",
"passcode": "sit",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "non_nobis",
"uuid": "0eed9be7-c7de-11ed-9829-00224849bf5e",
"name": "Brad Kautzer",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": [
{
"id": 4,
"username": "dolorem_sapiente",
"color": "#ad2430",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "at_et",
"uuid": "0eedf131-c7de-11ed-9829-00224849bf5e",
"name": "Mikayla Schroeder",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
},
{
"id": 5,
"username": "similique_enim",
"color": "#74a072",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "et_deleniti",
"uuid": "0eee4f70-c7de-11ed-9829-00224849bf5e",
"name": "Catharine Wiegand",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
}
]
}
Received response:
Request failed with error:
Create a Room
requires authentication
Create a room and use the slug to perform actions in that room.
If is_public
is set to false
, the returned passcode
will be required
for future requests to perform actions in this room.
You may optionally pass a valid passcode
to generate your own code.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/room" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"is_public\": true,
\"name\": \"dignissimos\",
\"passcode\": \"et\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"is_public": true,
"name": "dignissimos",
"passcode": "et"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/room',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'is_public' => true,
'name' => 'dignissimos',
'passcode' => 'et',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "qiiK3mb",
"passcode": "aliquid",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "neque_natus",
"uuid": "0ef2e483-c7de-11ed-9829-00224849bf5e",
"name": "Mr. Sofia White III",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Get a Room
requires authentication
Get information about a room and active participants.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/room/nihil?passcode=officia" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room/nihil"
);
const params = {
"passcode": "officia",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/room/nihil',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'passcode' => 'officia',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "FOKLLdw",
"passcode": "consequatur",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "consequatur_consequatur",
"uuid": "0ef5bc62-c7de-11ed-9829-00224849bf5e",
"name": "Heaven Terry",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Update a Room
requires authentication
Update the name of a room
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/room/qui" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_public=" \
--form "name=et" \
--form "passcode=" \
--form "background=@/tmp/phpTJnAFm"
const url = new URL(
"https://dddice.com/api/1.0/room/qui"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('is_public', '');
body.append('name', 'et');
body.append('passcode', '');
body.append('background', document.querySelector('input[name="background"]').files[0]);
fetch(url, {
method: "PATCH",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/room/qui',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'is_public',
'contents' => ''
],
[
'name' => 'name',
'contents' => 'et'
],
[
'name' => 'passcode',
'contents' => ''
],
[
'name' => 'background',
'contents' => fopen('/tmp/phpTJnAFm', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "b61eCQt",
"passcode": "qui",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "omnis_nesciunt",
"uuid": "0ef9cccf-c7de-11ed-9829-00224849bf5e",
"name": "Mireille Collier",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Delete a Room
requires authentication
Delete a room you own.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/room/commodi" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room/commodi"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/room/commodi',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Update Room Rolls
requires authentication
Automatically pickup dice from the board or unhide dice to players for all rolls in a room and for the current player.
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/room/1/roll" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"dice\": {
\"is_hidden\": true,
\"is_visible\": true,
\"is_cleared\": false
}
}"
const url = new URL(
"https://dddice.com/api/1.0/room/1/roll"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"dice": {
"is_hidden": true,
"is_visible": true,
"is_cleared": false
}
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/room/1/roll',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'dice' => [
'is_hidden' => true,
'is_visible' => true,
'is_cleared' => false,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "roll[]",
"data": [
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "magnam_libero",
"uuid": "0efe0494-c7de-11ed-9829-00224849bf5e",
"name": "Mazie Will",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "cumque",
"slug": "hQUQRl6",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 9,
"username": "corporis_omnis",
"color": "#6048ce",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "numquam_quis",
"uuid": "0efee80f-c7de-11ed-9829-00224849bf5e",
"name": "Fiona Hackett",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f000e49-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": true,
"is_visible": true,
"is_cleared": true,
"is_dropped": false,
"value": 7,
"value_to_display": "7",
"type": "d20",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 7,
"equation": "1d20",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "esse_eveniet",
"uuid": "0f01a357-c7de-11ed-9829-00224849bf5e",
"name": "Columbus Jast",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "aut",
"slug": "J1d6kE7",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 10,
"username": "eos_ex",
"color": "#993da4",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "quo_expedita",
"uuid": "0f02798f-c7de-11ed-9829-00224849bf5e",
"name": "Fritz Zboncak",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f035086-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 20,
"value_to_display": "20",
"type": "d20",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 20,
"equation": "1d20",
"external_id": null,
"participants": []
}
]
}
Received response:
Request failed with error:
Join a Room
requires authentication
Join a room as a participant
Example request:
curl --request POST \
"https://dddice.com/api/1.0/room/quibusdam/participant" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"deleniti\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/quibusdam/participant"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "deleniti"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/room/quibusdam/participant',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'deleniti',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "fvZ_EcP",
"passcode": "et",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "voluptas_ex",
"uuid": "0f07c025-c7de-11ed-9829-00224849bf5e",
"name": "Crystel Johns",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Update a Participant
requires authentication
Update the username or color of the room participant.
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/room/ab/participant/repellendus" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"sapiente\",
\"username\": \"nemo\",
\"color\": \"#FF0000\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/ab/participant/repellendus"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "sapiente",
"username": "nemo",
"color": "#FF0000"
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/room/ab/participant/repellendus',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'sapiente',
'username' => 'nemo',
'color' => '#FF0000',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "5xxpGak",
"passcode": "cum",
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "deserunt_facilis",
"uuid": "0f0b6b2f-c7de-11ed-9829-00224849bf5e",
"name": "Delta Schaden II",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Leave a Room
requires authentication
Remove a participant from a room. Participants can choose to leave a room using this endpoint. Room owners have permission to remove any participant.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/room/reprehenderit/participant/distinctio" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room/reprehenderit/participant/distinctio"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/room/reprehenderit/participant/distinctio',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Roll
API for creating and managing dice rolls.
Create a Roll
requires authentication
Perform a dice roll and optionally send the result to a public or private room.
Dice roll values are calculated using the API but can optionally receive a
value
and/or value_to_display
attribute to pass a predetermined value (i.e. when integrating with VTTs).
Operators Operators allow one to manipulate the outcome of the dice roll. The syntax of operators is based on Avrae which implements d20 dice syntax.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/roll" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"dice\": [
{
\"type\": \"D20\",
\"theme\": \"dddice-red\"
},
{
\"type\": \"D20\",
\"theme\": \"dddice-red\"
}
],
\"external_id\": \"perferendis\",
\"operator\": {
\"k\": \"\\\"h2\\\"\",
\"p\": \"occaecati\",
\"rr\": \"cumque\",
\"ro\": \"ipsa\",
\"ra\": \"aut\",
\"e\": \"quia\",
\"mi\": 1,
\"ma\": 8151725.2072
},
\"room\": \"HvvOlTl\",
\"whisper\": [
124309.615
],
\"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\"
}"
const url = new URL(
"https://dddice.com/api/1.0/roll"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"dice": [
{
"type": "D20",
"theme": "dddice-red"
},
{
"type": "D20",
"theme": "dddice-red"
}
],
"external_id": "perferendis",
"operator": {
"k": "\"h2\"",
"p": "occaecati",
"rr": "cumque",
"ro": "ipsa",
"ra": "aut",
"e": "quia",
"mi": 1,
"ma": 8151725.2072
},
"room": "HvvOlTl",
"whisper": [
124309.615
],
"label": "\"Longbow damage with Hunter's Mark\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/roll',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
clone $p['stdClass'],
],
null,
[
'stdClass' => [
'type' => [
'D20',
'D20',
],
'theme' => [
'dddice-red',
'dddice-red',
],
],
],
[
'dice' => [
$o[0],
$o[1],
],
'external_id' => 'perferendis',
'operator' => [
'k' => '"h2"',
'p' => 'occaecati',
'rr' => 'cumque',
'ro' => 'ipsa',
'ra' => 'aut',
'e' => 'quia',
'mi' => 1.0,
'ma' => 8151725.2072,
],
'room' => 'HvvOlTl',
'whisper' => [
124309.615,
],
'label' => '"Longbow damage with Hunter\'s Mark"',
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "necessitatibus_illum",
"uuid": "0f15cfbf-c7de-11ed-9829-00224849bf5e",
"name": "Zachariah Rath IV",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "sint",
"slug": "oaIg6xJ",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 13,
"username": "fugiat_ut",
"color": "#fe0a0e",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "cupiditate_beatae",
"uuid": "0f17270b-c7de-11ed-9829-00224849bf5e",
"name": "Augusta Ruecker",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f1803da-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": true,
"is_dropped": false,
"value": 6,
"value_to_display": "6",
"type": "d10",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 6,
"equation": "1d10",
"external_id": null,
"participants": []
}
}
Received response:
Request failed with error:
Response
Response Fields
uuid
string
The ID of the roll
direction
number
The angle the roll was thrown (in degrees)
velocity
number
How hard the roll was thrown
user
object
User Object
room
object
Room Object
values
object[]
Roll Value Objects
operator
object
Roll Operators (if any were used)
total_value
number
Sum of all roll value totals
created_at
string
Created timestamp
updated_at
string
Updated timestamp
Get a Roll
requires authentication
Fetch roll information including the user and optional room information
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/roll/et" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/roll/et"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/roll/et',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "est_praesentium",
"uuid": "0f1bb704-c7de-11ed-9829-00224849bf5e",
"name": "Miss Vilma Maggio DVM",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "occaecati",
"slug": "DuPFa2a",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 14,
"username": "sed_rerum",
"color": "#fd8845",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "earum_officiis",
"uuid": "0f1ca040-c7de-11ed-9829-00224849bf5e",
"name": "Miss Norene Brakus IV",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f1d7963-c7de-11ed-9829-00224849bf5e",
"is_hidden": true,
"is_user_value": true,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 2,
"value_to_display": "2",
"type": "d8",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 2,
"equation": "1d8",
"external_id": null,
"participants": []
}
}
Received response:
Request failed with error:
Update a Roll
requires authentication
Pickup dice from the board or unhide dice to players
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/roll/doloribus" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"room\": \"quisquam\",
\"dice\": [
{
\"uuid\": \"1\",
\"is_hidden\": true
}
]
}"
const url = new URL(
"https://dddice.com/api/1.0/roll/doloribus"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"room": "quisquam",
"dice": [
{
"uuid": "1",
"is_hidden": true
}
]
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/roll/doloribus',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
],
null,
[
'stdClass' => [
'uuid' => [
'1',
],
'is_hidden' => [
true,
],
],
],
[
'room' => 'quisquam',
'dice' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "ut_eos",
"uuid": "0f2147c1-c7de-11ed-9829-00224849bf5e",
"name": "Cleta Cummings",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "tempora",
"slug": "kefO5b4",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 15,
"username": "quisquam_voluptatem",
"color": "#79f36e",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "delectus_tempora",
"uuid": "0f2233d2-c7de-11ed-9829-00224849bf5e",
"name": "Deja Orn V",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f230fe7-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": false,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 6,
"value_to_display": "6",
"type": "d20",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 6,
"equation": "1d20",
"external_id": null,
"participants": []
}
}
Received response:
Request failed with error:
Response
Response Fields
uuid
string
The ID of the roll
direction
number
The angle the roll was thrown (in degrees)
velocity
number
How hard the roll was thrown
user
object
User Object
room
object
Room Object
values
object[]
Roll Value Objects
total_value
number
Sum of all roll value totals
created_at
string
Created timestamp
updated_at
string
Updated timestamp
Bulk Update Rolls
requires authentication
Pickup dice from the board or unhide dice to players for multiple rolls.
Accepts an array of objects with the the same parameters as PATCH /api/1.0/roll/{id}
.
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/roll" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"rolls\": [
{
\"dice\": [
{
\"uuid\": \"b0e45a0a-9bee-30a6-9f36-84b15fec92d9\",
\"is_visible\": true,
\"is_cleared\": true
}
]
}
]
}"
const url = new URL(
"https://dddice.com/api/1.0/roll"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"rolls": [
{
"dice": [
{
"uuid": "b0e45a0a-9bee-30a6-9f36-84b15fec92d9",
"is_visible": true,
"is_cleared": true
}
]
}
]
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/roll',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'rolls' => [
[
'dice' => [
[
'uuid' => 'b0e45a0a-9bee-30a6-9f36-84b15fec92d9',
'is_visible' => true,
'is_cleared' => true,
],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "roll[]",
"data": [
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "magni_aut",
"uuid": "0f273c97-c7de-11ed-9829-00224849bf5e",
"name": "Prof. Dayna Grimes PhD",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "cum",
"slug": "ymKIYbx",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 16,
"username": "qui_et",
"color": "#419fc2",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "numquam_eum",
"uuid": "0f2821cd-c7de-11ed-9829-00224849bf5e",
"name": "Anya Bartoletti",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f28fa87-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": true,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 6,
"value_to_display": "6",
"type": "d10",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 6,
"equation": "1d10",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-03-21T11:46:46.000000Z",
"created_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "provident_quia",
"uuid": "0f2a8253-c7de-11ed-9829-00224849bf5e",
"name": "Winston Kovacek",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "rerum",
"slug": "nHpzf9u",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"deleted_at": null,
"participants": [
{
"id": 17,
"username": "aut_adipisci",
"color": "#58342e",
"position": 0,
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z",
"user": {
"username": "sed_amet",
"uuid": "0f2b5fba-c7de-11ed-9829-00224849bf5e",
"name": "Theodore Lowe",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
}
]
},
"values": [
{
"uuid": "0f2c3752-c7de-11ed-9829-00224849bf5e",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 20,
"value_to_display": "20",
"type": "d20",
"created_at": "2023-03-21T11:46:46.000000Z",
"updated_at": "2023-03-21T11:46:46.000000Z"
}
],
"total_value": 20,
"equation": "1d20",
"external_id": null,
"participants": []
}
]
}
Received response:
Request failed with error:
Share Dice
API for managing share requests.
List Share Requests
requires authentication
Fetch a list of active and inactive share requests.
Create Share Request
requires authentication
Create a share request for a given theme.
Get Share Request
requires authentication
Get information about a share request.
Update Share Request
requires authentication
Update information about a share request.
Delete Share Request
requires authentication
Delete a share request which will invalidate any shared URLs
Accept Share Request
requires authentication
Accept a user's share request which will add the specified theme to your Digital Dice Box.
You can retrieve and modify this theme from your Digitial Dice Box by using the DiceBox endpoints.
User
API for managing users.
Get Authenticated User
requires authentication
Get the current authenticated user.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/user"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/user',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "user",
"data": {
"name": "Cyril Mayert",
"username": "dolorem_neque",
"updated_at": "2023-03-21T11:46:47.000000Z",
"created_at": "2023-03-21T11:46:47.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "autem",
"slug": "XgLtBwR",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z",
"deleted_at": null
}
]
}
}
Received response:
Request failed with error:
Create Guest User
Create a guest user to communicate with other API endpoints. Returns a token that can be used to fetch a user.
This route is rate-limited to 1 account/24-hour.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/user" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/user"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/user',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"type": "user",
"data": {
"name": "Miss Rosalind Skiles",
"username": "sapiente_cupiditate",
"updated_at": "2023-03-21T11:46:47.000000Z",
"created_at": "2023-03-21T11:46:47.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "est",
"slug": "uo1PuNX",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z",
"deleted_at": null
}
]
}
}
Received response:
Request failed with error:
Create API Token
requires authentication
Returns a new API token for the authenticated user.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/user/token" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"non\"
}"
const url = new URL(
"https://dddice.com/api/1.0/user/token"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "non"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/user/token',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'non',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"type": "token",
"data": "<your-new-api-token>"
}
Received response:
Request failed with error:
Delete API Key
requires authentication
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/user/token/iure" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/user/token/iure"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/user/token/iure',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
Dice Box
API for managing themes in your Digital Dice Box.
List Dice Box Collection
requires authentication
Fetch a list of all dice in your Digital Dice Box.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/dice-box?filter=similique&ids=vel" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 2011286.0096872,
\"filter\": \"est\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const params = {
"filter": "similique",
"ids": "vel",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"limit": 2011286.0096872,
"filter": "est"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/dice-box',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'filter' => 'similique',
'ids' => 'vel',
],
'json' => [
'limit' => 2011286.0096872,
'filter' => 'est',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "theme[]",
"data": [
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "vel_consequatur",
"name": "Mrs.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Eos sequi esse optio tempora sit ad. Voluptate labore quia dolores molestias quas. Quis sequi maiores quo expedita saepe dicta.",
"user": {
"username": "quidem_nesciunt",
"uuid": "0f3eddba-c7de-11ed-9829-00224849bf5e",
"name": "Jillian Monahan",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
{
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "aut_placeat",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Aut ipsam odit eos rerum fugit veniam. Quis dolorem vel sit et et aut rem exercitationem. Voluptatem sit dolor sit voluptas ut molestiae.",
"user": {
"username": "consequuntur_quia",
"uuid": "0f40510c-c7de-11ed-9829-00224849bf5e",
"name": "Deanna Pfeffer",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
]
}
Received response:
Request failed with error:
Get Dice Box Theme
requires authentication
Get information about a theme in your Digital Dice Box.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/dice-box/impedit" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/dice-box/impedit"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/dice-box/impedit',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "ex_omnis",
"name": "Ms.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Quia odio enim et quis. Expedita recusandae aperiam non et est. Eum fugit dolorum qui minima perferendis dolor in a. Non non iste voluptatem sed provident voluptatem.",
"user": {
"username": "aspernatur_sint",
"uuid": "0f448e03-c7de-11ed-9829-00224849bf5e",
"name": "Dr. Claire Kub I",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
}
Received response:
Request failed with error:
Update Dice Box Theme
requires authentication
Upgrade theme version in your Digital Dice Box.
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/dice-box/necessitatibus" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/dice-box/necessitatibus"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
'https://dddice.com/api/1.0/dice-box/necessitatibus',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"meshes": {
"d4": "https://dddice.com/mesh/d04.fbx",
"d6": "https://dddice.com/mesh/d06.fbx",
"d8": "https://dddice.com/mesh/d08.fbx",
"d10": "https://dddice.com/mesh/d10.fbx",
"d10x": "https://dddice.com/mesh/d10.fbx",
"d12": "https://dddice.com/mesh/d12.fbx",
"d20": "https://dddice.com/mesh/d20.fbx"
},
"available_dice": [
"d4",
"d6",
"d8",
"d10",
"d10x",
"d12",
"d20"
],
"physics": {
"inertia": {
"d4": 5,
"d6": 12,
"d8": 10,
"d10": 9,
"d10x": 9,
"d12": 8,
"d20": 6
},
"weight": {
"d4": 300,
"d6": 300,
"d8": 340,
"d10": 350,
"d10x": 350,
"d12": 350,
"d20": 400
}
},
"sizes": {
"d4": 1,
"d6": 1,
"d8": 1,
"d10": 1,
"d10x": 1,
"d12": 1,
"d20": 1
},
"sounds": [
{
"src": "https://dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://dddice.com/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "beatae_saepe",
"name": "Ms.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Qui natus id aut numquam. Quis in et rerum molestiae. Ex voluptas repudiandae dolorum quia aliquam aut. Harum laboriosam occaecati corrupti.",
"user": {
"username": "corrupti_exercitationem",
"uuid": "0f4730ef-c7de-11ed-9829-00224849bf5e",
"name": "Prof. Yesenia Powlowski",
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
},
"created_at": "2023-03-21T11:46:47.000000Z",
"updated_at": "2023-03-21T11:46:47.000000Z"
}
}
Received response:
Request failed with error:
Delete Dice Box Theme
requires authentication
Delete a share request which will invalidate any shared URLs
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/dice-box/amet" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/dice-box/amet"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/dice-box/amet',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error: