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
To authenticate requests, include 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": "quasi-vel",
"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": "Mollitia cupiditate eum tempora error. Ab deleniti accusantium esse libero consequatur eius molestiae.",
"user": {
"username": "dario.kuhlman",
"uuid": "b6493371-fb40-11ed-ba3e-002248ad6607",
"name": "Oleta Hodkiewicz",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "fugit-sint",
"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": "Tempora cumque sed velit et distinctio accusamus. Voluptatem est est quidem voluptatem. Nam dolorem ipsa eius et. Natus voluptates eius ad nostrum fugiat temporibus repellendus.",
"user": {
"username": "zane50",
"uuid": "b64aa43d-fb40-11ed-ba3e-002248ad6607",
"name": "Ms. Jolie Considine",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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=ducimus" \
--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=ut" \
--form "assets[]=@/tmp/phpFfq0MB"
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', 'ducimus');
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', 'ut');
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' => 'ducimus'
],
[
'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' => 'ut'
],
[
'name' => 'assets[]',
'contents' => fopen('/tmp/phpFfq0MB', '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": "tenetur-sunt",
"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": "Consequatur aut ipsam reiciendis dolor fugiat voluptas. Impedit in quia eaque voluptatem cum quia in. Enim distinctio nemo natus magni similique et doloremque.",
"user": {
"username": "ward.arno",
"uuid": "b65131de-fb40-11ed-ba3e-002248ad6607",
"name": "Kenya Von",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "labore-vitae-sed",
"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": "Dolorem facere natus et qui ipsam mollitia. Voluptatibus voluptatum iste hic et voluptatem. A voluptatem sint cumque cupiditate est dolorum commodi quo. Error sint officia id magnam cupiditate rerum.",
"user": {
"username": "trobel",
"uuid": "b653cd9a-fb40-11ed-ba3e-002248ad6607",
"name": "Ms. Cali Davis",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "sunt-in-mollitia",
"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": "Rerum voluptas aut error et. Id eum quo qui repudiandae culpa fugiat. Rerum accusantium dignissimos modi voluptatem.",
"user": {
"username": "joannie.goldner",
"uuid": "b65782df-fb40-11ed-ba3e-002248ad6607",
"name": "Edmond Erdman",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "laudantium-ex-debitis",
"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": "Et commodi rerum qui laborum et explicabo dolorum. Nihil rerum animi qui consequatur quaerat quisquam et. Doloremque repellat eos eos ullam.",
"user": {
"username": "wbalistreri",
"uuid": "b658d390-fb40-11ed-ba3e-002248ad6607",
"name": "Prof. Margaret Gerlach",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "quia-et",
"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": "Minima esse sed dolores. Itaque corrupti soluta at voluptatem error impedit laborum. Explicabo illum quia rem consequatur qui libero voluptates.",
"user": {
"username": "mclaughlin.derrick",
"uuid": "b65c3805-fb40-11ed-ba3e-002248ad6607",
"name": "Wilfrid Mayer",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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/ut" \
--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/ut"
);
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/ut',
[
'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": "iIsuh9G",
"passcode": "molestias",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "reid22",
"uuid": "b5d49664-fb40-11ed-ba3e-002248ad6607",
"name": "Adelia Stroman",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"participants": [
{
"id": 2,
"username": "commodi_quis",
"color": "#74fd49",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "kacey.rolfson",
"uuid": "b5d50f2b-fb40-11ed-ba3e-002248ad6607",
"name": "Nova Rau",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
},
{
"id": 3,
"username": "delectus_sunt",
"color": "#740a12",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "jessyca77",
"uuid": "b5d57f57-fb40-11ed-ba3e-002248ad6607",
"name": "Rebeca Frami",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
}
]
},
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "B6V5mCx",
"passcode": "sunt",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "jarod.brakus",
"uuid": "b5d792a0-fb40-11ed-ba3e-002248ad6607",
"name": "Billie Brekke",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"participants": [
{
"id": 4,
"username": "est_aperiam",
"color": "#5eb361",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "gpadberg",
"uuid": "b5d7e7bb-fb40-11ed-ba3e-002248ad6607",
"name": "Guadalupe Smitham Jr.",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
},
{
"id": 5,
"username": "dolores_quas",
"color": "#7e78d2",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "koch.elza",
"uuid": "b5d8452d-fb40-11ed-ba3e-002248ad6607",
"name": "Houston Schiller III",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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\": false,
\"name\": \"eveniet\",
\"passcode\": \"eos\"
}"
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": false,
"name": "eveniet",
"passcode": "eos"
};
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' => false,
'name' => 'eveniet',
'passcode' => 'eos',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "vV54i_Z",
"passcode": "ex",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "ida.waelchi",
"uuid": "b5dcf2e6-fb40-11ed-ba3e-002248ad6607",
"name": "Prof. Louisa Larson",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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/unde?passcode=autem" \
--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/unde"
);
const params = {
"passcode": "autem",
};
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/unde',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'passcode' => 'autem',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "m1rVtVx",
"passcode": "autem",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "maureen.altenwerth",
"uuid": "b5e0333c-fb40-11ed-ba3e-002248ad6607",
"name": "Kaylee Ryan",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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/aut" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_public=" \
--form "name=ut" \
--form "passcode=1" \
--form "custom_slug=lkqmysrv" \
--form "background=@/tmp/phpCNycNF"
const url = new URL(
"https://dddice.com/api/1.0/room/aut"
);
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', 'ut');
body.append('passcode', '1');
body.append('custom_slug', 'lkqmysrv');
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/aut',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'is_public',
'contents' => ''
],
[
'name' => 'name',
'contents' => 'ut'
],
[
'name' => 'passcode',
'contents' => '1'
],
[
'name' => 'custom_slug',
'contents' => 'lkqmysrv'
],
[
'name' => 'background',
'contents' => fopen('/tmp/phpCNycNF', '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": "nCyJZcD",
"passcode": "alias",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "nikolas50",
"uuid": "b5e4d447-fb40-11ed-ba3e-002248ad6607",
"name": "Jeramie Rempel DVM",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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/animi" \
--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/animi"
);
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/animi',
[
'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\": false,
\"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": false,
"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' => false,
'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-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "umarvin",
"uuid": "b5e943c6-fb40-11ed-ba3e-002248ad6607",
"name": "Johnson Zieme",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "ea",
"slug": "_jGbVMZ",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"deleted_at": null,
"participants": [
{
"id": 9,
"username": "sed_cupiditate",
"color": "#663e8e",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "funk.kitty",
"uuid": "b5ea5407-fb40-11ed-ba3e-002248ad6607",
"name": "Rafael Herzog",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
}
]
},
"values": [
{
"uuid": "b5eb8129-fb40-11ed-ba3e-002248ad6607",
"is_hidden": false,
"is_user_value": true,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 4,
"value_to_display": "4",
"type": "d6",
"label": null,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
],
"total_value": 4,
"equation": "1d6",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "gunnar77",
"uuid": "b5ed2485-fb40-11ed-ba3e-002248ad6607",
"name": "Mortimer Blanda",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "sint",
"slug": "p67okKw",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"deleted_at": null,
"participants": [
{
"id": 10,
"username": "quo_sed",
"color": "#069ffb",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "bchamplin",
"uuid": "b5ee207c-fb40-11ed-ba3e-002248ad6607",
"name": "Albin Bayer I",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
}
]
},
"values": [
{
"uuid": "b5eef864-fb40-11ed-ba3e-002248ad6607",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": true,
"is_dropped": false,
"value": 4,
"value_to_display": "4",
"type": "d8",
"label": null,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
],
"total_value": 4,
"equation": "1d8",
"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/unde/participant" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"perspiciatis\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/unde/participant"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "perspiciatis"
};
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/unde/participant',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'perspiciatis',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "Qm-bQI6",
"passcode": "itaque",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "runolfsdottir.alfredo",
"uuid": "b5f3c780-fb40-11ed-ba3e-002248ad6607",
"name": "Nyah Zieme",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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/consequatur/participant/occaecati" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"vel\",
\"username\": \"labore\",
\"color\": \"#FF0000\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/consequatur/participant/occaecati"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "vel",
"username": "labore",
"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/consequatur/participant/occaecati',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'vel',
'username' => 'labore',
'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": "2hnboqk",
"passcode": "rerum",
"updated_at": "2023-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "marcel.krajcik",
"uuid": "b5f7c428-fb40-11ed-ba3e-002248ad6607",
"name": "Milford Shanahan",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.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/minima/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/minima/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/minima/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\": \"quisquam\",
\"operator\": {
\"k\": \"\\\"h2\\\"\",
\"p\": \"omnis\",
\"rr\": \"possimus\",
\"ro\": \"omnis\",
\"ra\": \"fugiat\",
\"e\": \"voluptates\",
\"mi\": 4512.723,
\"ma\": 152.89973
},
\"room\": \"HvvOlTl\",
\"whisper\": [
113890291.3765418
],
\"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": "quisquam",
"operator": {
"k": "\"h2\"",
"p": "omnis",
"rr": "possimus",
"ro": "omnis",
"ra": "fugiat",
"e": "voluptates",
"mi": 4512.723,
"ma": 152.89973
},
"room": "HvvOlTl",
"whisper": [
113890291.3765418
],
"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' => 'quisquam',
'operator' => [
'k' => '"h2"',
'p' => 'omnis',
'rr' => 'possimus',
'ro' => 'omnis',
'ra' => 'fugiat',
'e' => 'voluptates',
'mi' => 4512.723,
'ma' => 152.89973,
],
'room' => 'HvvOlTl',
'whisper' => [
113890291.3765418,
],
'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-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "welch.hailee",
"uuid": "b602951d-fb40-11ed-ba3e-002248ad6607",
"name": "Prof. Destany Hahn V",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "dolorem",
"slug": "PgjWOGs",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"deleted_at": null,
"participants": [
{
"id": 13,
"username": "delectus_sapiente",
"color": "#a3cb51",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "lyla.reynolds",
"uuid": "b6040344-fb40-11ed-ba3e-002248ad6607",
"name": "Dr. Jonathon Stehr",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
}
]
},
"values": [
{
"uuid": "b604e2e5-fb40-11ed-ba3e-002248ad6607",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 7,
"value_to_display": "7",
"type": "d8",
"label": null,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
],
"total_value": 7,
"equation": "1d8",
"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/nesciunt" \
--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/nesciunt"
);
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/nesciunt',
[
'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-05-25T21:11:26.000000Z",
"created_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "elfrieda.wuckert",
"uuid": "b6089479-fb40-11ed-ba3e-002248ad6607",
"name": "Fleta Rath",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "facere",
"slug": "oU2B_Ga",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"deleted_at": null,
"participants": [
{
"id": 14,
"username": "sint_fugit",
"color": "#db18fc",
"position": 0,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z",
"user": {
"username": "charlotte15",
"uuid": "b6099a3a-fb40-11ed-ba3e-002248ad6607",
"name": "Ryann Pouros",
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
}
]
},
"values": [
{
"uuid": "b619825a-fb40-11ed-ba3e-002248ad6607",
"is_hidden": false,
"is_user_value": true,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 6,
"value_to_display": "6",
"type": "d8",
"label": null,
"created_at": "2023-05-25T21:11:26.000000Z",
"updated_at": "2023-05-25T21:11:26.000000Z"
}
],
"total_value": 6,
"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/voluptatem" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"room\": \"doloribus\",
\"dice\": [
{
\"uuid\": \"1\",
\"is_hidden\": true
}
]
}"
const url = new URL(
"https://dddice.com/api/1.0/roll/voluptatem"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"room": "doloribus",
"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/voluptatem',
[
'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' => 'doloribus',
'dice' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"direction": 180,
"velocity": 1,
"updated_at": "2023-05-25T21:11:27.000000Z",
"created_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "julia74",
"uuid": "b61d7e0f-fb40-11ed-ba3e-002248ad6607",
"name": "Prof. Kellen Bogisich",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "quis",
"slug": "duAdWow",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"deleted_at": null,
"participants": [
{
"id": 15,
"username": "ratione_voluptatum",
"color": "#07c265",
"position": 0,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "hubert.lynch",
"uuid": "b61e9a04-fb40-11ed-ba3e-002248ad6607",
"name": "Gerard Mosciski",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
}
]
},
"values": [
{
"uuid": "b61f73ee-fb40-11ed-ba3e-002248ad6607",
"is_hidden": true,
"is_user_value": false,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 10,
"value_to_display": "10",
"type": "d12",
"label": null,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
],
"total_value": 10,
"equation": "1d12",
"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\": \"1b23850e-d700-35ab-841b-4ca3fbde86e9\",
\"is_visible\": false,
\"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": "1b23850e-d700-35ab-841b-4ca3fbde86e9",
"is_visible": false,
"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' => '1b23850e-d700-35ab-841b-4ca3fbde86e9',
'is_visible' => false,
'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-05-25T21:11:27.000000Z",
"created_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "mueller.evelyn",
"uuid": "b623bc95-fb40-11ed-ba3e-002248ad6607",
"name": "America Jenkins",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "amet",
"slug": "Ucev_ch",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"deleted_at": null,
"participants": [
{
"id": 16,
"username": "aliquid_asperiores",
"color": "#983872",
"position": 0,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "scummerata",
"uuid": "b624ce22-fb40-11ed-ba3e-002248ad6607",
"name": "Alize Dach MD",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
}
]
},
"values": [
{
"uuid": "b625a719-fb40-11ed-ba3e-002248ad6607",
"is_hidden": true,
"is_user_value": true,
"is_visible": true,
"is_cleared": true,
"is_dropped": false,
"value": 2,
"value_to_display": "2",
"type": "d10",
"label": null,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
],
"total_value": 2,
"equation": "1d10",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-05-25T21:11:27.000000Z",
"created_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "vvolkman",
"uuid": "b6273060-fb40-11ed-ba3e-002248ad6607",
"name": "Myah McClure",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "numquam",
"slug": "jGk46RH",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"deleted_at": null,
"participants": [
{
"id": 17,
"username": "ab_occaecati",
"color": "#356e9f",
"position": 0,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z",
"user": {
"username": "ydenesik",
"uuid": "b6280dd1-fb40-11ed-ba3e-002248ad6607",
"name": "Ora Kling",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
}
]
},
"values": [
{
"uuid": "b628ed4d-fb40-11ed-ba3e-002248ad6607",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": true,
"is_dropped": false,
"value": 3,
"value_to_display": "3",
"type": "d4",
"label": null,
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
}
],
"total_value": 3,
"equation": "1d4",
"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": "Daisha Robel",
"username": "ebony.corkery",
"updated_at": "2023-05-25T21:11:27.000000Z",
"created_at": "2023-05-25T21:11:27.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "vel",
"slug": "kqvn8RB",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "Kelsie McGlynn MD",
"username": "blick.keon",
"updated_at": "2023-05-25T21:11:27.000000Z",
"created_at": "2023-05-25T21:11:27.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "laborum",
"slug": "qL51pi3",
"custom_slug": null,
"settings": {
"chat": {
"backgroundColor": 0,
"deleteAfter": 30,
"fadeAfter": 10,
"isDiceExpanded": false,
"isDiceSorted": false,
"isUsernameVisible": true,
"isVisible": true,
"textColor": 16777215,
"textSize": "sm"
},
"lighting": {
"ambientColor": 16777215,
"ambientIntensity": 0.5,
"spotlightColor": 16777215,
"spotlightIntensity": 0.33
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"autoClear": 10,
"diceSize": 1,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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\": \"et\"
}"
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": "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/user/token',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'et',
],
]
);
$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/quis" \
--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/quis"
);
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/quis',
[
'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=officiis&ids=nobis" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 2809781,
\"filter\": \"omnis\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const params = {
"filter": "officiis",
"ids": "nobis",
};
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": 2809781,
"filter": "omnis"
};
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' => 'officiis',
'ids' => 'nobis',
],
'json' => [
'limit' => 2809781.0,
'filter' => 'omnis',
],
]
);
$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": "similique-distinctio-occaecati",
"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": "Et quas harum nostrum. Quia ea consequatur quia earum itaque enim. Consectetur ad quam ad repellendus consequatur quo provident.",
"user": {
"username": "altenwerth.sylvia",
"uuid": "b63c4d10-fb40-11ed-ba3e-002248ad6607",
"name": "Mr. Clifton Yost",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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": "mollitia-vitae",
"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": "Dolorum itaque suscipit qui. Hic rem voluptates aliquid voluptas dolorem. Quaerat labore eius assumenda magnam quia necessitatibus ut fugit.",
"user": {
"username": "mhagenes",
"uuid": "b63de4b6-fb40-11ed-ba3e-002248ad6607",
"name": "Dereck Wolf",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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/fugiat" \
--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/fugiat"
);
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/fugiat',
[
'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": "alias-aliquid",
"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": "Sed rerum eum ullam saepe non tenetur. Facere ex neque eligendi tenetur quod aut.",
"user": {
"username": "sierra06",
"uuid": "b6418269-fb40-11ed-ba3e-002248ad6607",
"name": "Maurine Casper",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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/possimus" \
--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/possimus"
);
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/possimus',
[
'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": "debitis-omnis",
"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": "Explicabo quae ut neque esse porro. Esse eligendi consectetur aliquid tempore. Sit occaecati enim officiis aliquam laborum magni vel. Et voluptatum voluptas ut et. Et voluptates delectus assumenda voluptatem sequi.",
"user": {
"username": "cmertz",
"uuid": "b643f38a-fb40-11ed-ba3e-002248ad6607",
"name": "Leta Predovic III",
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.000000Z"
},
"created_at": "2023-05-25T21:11:27.000000Z",
"updated_at": "2023-05-25T21:11:27.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/quia" \
--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/quia"
);
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/quia',
[
'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: