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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "odio-ex-quis",
"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": "Consequatur inventore perspiciatis ducimus suscipit assumenda. Doloribus doloribus voluptatibus fugit hic libero harum. Modi officia facilis aut impedit molestiae.",
"user": {
"username": "emmerich.taya",
"uuid": "334a6222-6054-11ee-8c15-000d3a9285ca",
"name": "Edwin Weimann",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
{
"meshes": {
"d4": "https://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "quod-nihil",
"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": "Quia sit atque nemo quo pariatur provident natus porro. Dolore incidunt ut doloremque. Deleniti vero quo recusandae ipsa odio assumenda. Excepturi et harum voluptas amet molestias velit cumque. Qui eaque beatae tempora repellat quam dolorem est ut.",
"user": {
"username": "janie23",
"uuid": "334bc5c9-6054-11ee-8c15-000d3a9285ca",
"name": "Antonina Predovic IV",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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=optio" \
--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=fugiat" \
--form "assets[]=@/tmp/phpcckcdx"
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', 'optio');
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', 'fugiat');
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' => 'optio'
],
[
'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' => 'fugiat'
],
[
'name' => 'assets[]',
'contents' => fopen('/tmp/phpcckcdx', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"meshes": {
"d4": "https://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "qui-modi",
"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": "Non sint nulla velit sunt impedit sit. Sit consequuntur natus quod facere iste repellat. Error minus et atque quas blanditiis.",
"user": {
"username": "tianna.borer",
"uuid": "33530ba6-6054-11ee-8c15-000d3a9285ca",
"name": "Emmy Crooks II",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "quidem-et-quo",
"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": "Iusto ut doloribus est in culpa laborum voluptate officia. Quia quia minus sed similique placeat perspiciatis. Nostrum itaque veritatis voluptate aut. Deserunt repudiandae autem magnam corporis consequatur inventore. Et aut neque a est modi.",
"user": {
"username": "alisa24",
"uuid": "33561b63-6054-11ee-8c15-000d3a9285ca",
"name": "Magnolia Schinner",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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-libero-libero",
"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": "Deserunt in sit minima dolorem harum aut rem. Consequatur porro maiores perspiciatis iste. Qui repellendus eos placeat ratione itaque porro quia.",
"user": {
"username": "lane.hermiston",
"uuid": "335a009b-6054-11ee-8c15-000d3a9285ca",
"name": "Kristy Will",
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.000000Z"
},
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.000000Z"
},
{
"meshes": {
"d4": "https://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "eius-officiis",
"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": "Consequatur voluptatem sit quo qui veritatis. Culpa et veritatis rerum iste. Ut similique cum eum debitis.",
"user": {
"username": "beau25",
"uuid": "335b6674-6054-11ee-8c15-000d3a9285ca",
"name": "Karlee Cremin",
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.000000Z"
},
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "minima-non-iure",
"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": "Non fugiat nesciunt quidem qui et ducimus est. Amet voluptas dolorem beatae temporibus voluptatem voluptas voluptatem. Id ipsa itaque ea debitis non maxime blanditiis occaecati. Excepturi omnis minus qui aut quaerat nihil fugit.",
"user": {
"username": "melyna05",
"uuid": "335ed64a-6054-11ee-8c15-000d3a9285ca",
"name": "Mr. Griffin Lang Sr.",
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.000000Z"
},
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.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/perferendis" \
--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/perferendis"
);
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/perferendis',
[
'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": "oxESC0q",
"passcode": "at",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "dee.little",
"uuid": "32d3ce04-6054-11ee-8c15-000d3a9285ca",
"name": "Mrs. Yvonne Kub",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"participants": [
{
"id": 2,
"username": "voluptatum_optio",
"color": "#d9f3d4",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "era69",
"uuid": "32d445de-6054-11ee-8c15-000d3a9285ca",
"name": "Derick Watsica V",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
},
{
"id": 3,
"username": "beatae_et",
"color": "#e15f1b",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "gerhold.jaylan",
"uuid": "32d4cd1e-6054-11ee-8c15-000d3a9285ca",
"name": "Prof. Madilyn Collier",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "Yqnjb9b",
"passcode": "voluptatem",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "armstrong.clara",
"uuid": "32d6d9d9-6054-11ee-8c15-000d3a9285ca",
"name": "Hillard Gerlach",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"participants": [
{
"id": 4,
"username": "quod_qui",
"color": "#5a985a",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "titus.lesch",
"uuid": "32d7326a-6054-11ee-8c15-000d3a9285ca",
"name": "Vance Walter",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
},
{
"id": 5,
"username": "id_cupiditate",
"color": "#1eef10",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "metz.marcelino",
"uuid": "32d79857-6054-11ee-8c15-000d3a9285ca",
"name": "Imelda Schumm",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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\": \"et\",
\"passcode\": \"autem\"
}"
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": "et",
"passcode": "autem"
};
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' => 'et',
'passcode' => 'autem',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "A4Rj5QR",
"passcode": "vel",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "ulangworth",
"uuid": "32dca992-6054-11ee-8c15-000d3a9285ca",
"name": "Veronica Hintz",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/esse?passcode=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/room/esse"
);
const params = {
"passcode": "ut",
};
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/esse',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'passcode' => 'ut',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "UELaLdu",
"passcode": "temporibus",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "qwisoky",
"uuid": "32dfca82-6054-11ee-8c15-000d3a9285ca",
"name": "Naomie Feeney",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/ut" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_public=1" \
--form "name=omnis" \
--form "passcode=" \
--form "custom_slug=euleimulhauj" \
--form "background=@/tmp/php9ypG2B"
const url = new URL(
"https://dddice.com/api/1.0/room/ut"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('is_public', '1');
body.append('name', 'omnis');
body.append('passcode', '');
body.append('custom_slug', 'euleimulhauj');
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/ut',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'is_public',
'contents' => '1'
],
[
'name' => 'name',
'contents' => 'omnis'
],
[
'name' => 'passcode',
'contents' => ''
],
[
'name' => 'custom_slug',
'contents' => 'euleimulhauj'
],
[
'name' => 'background',
'contents' => fopen('/tmp/php9ypG2B', '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": "bBrwOG5",
"passcode": "necessitatibus",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "alverta35",
"uuid": "32e485d8-6054-11ee-8c15-000d3a9285ca",
"name": "Jayda Harris",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/voluptatem" \
--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/voluptatem"
);
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/voluptatem',
[
'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-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "pouros.cade",
"uuid": "32e9d129-6054-11ee-8c15-000d3a9285ca",
"name": "Prof. Imogene Renner I",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "soluta",
"slug": "ub_ZMN6",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 9,
"username": "pariatur_voluptas",
"color": "#43b5da",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "shields.jess",
"uuid": "32eae2a4-6054-11ee-8c15-000d3a9285ca",
"name": "Colin Hills",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "32ec1dc2-6054-11ee-8c15-000d3a9285ca",
"is_hidden": true,
"is_user_value": true,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 2,
"value_to_display": "2",
"type": "d8",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 2,
"equation": "1d8",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "kathleen.gottlieb",
"uuid": "32edc198-6054-11ee-8c15-000d3a9285ca",
"name": "Aliyah Gaylord",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "voluptatem",
"slug": "Pt5Fmdp",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 10,
"username": "et_et",
"color": "#cdea1f",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "laury.walsh",
"uuid": "32eead45-6054-11ee-8c15-000d3a9285ca",
"name": "Hildegard Kozey",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "32ef9e7e-6054-11ee-8c15-000d3a9285ca",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": true,
"is_dropped": false,
"value": 3,
"value_to_display": "3",
"type": "d10",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 3,
"equation": "1d10",
"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/aliquam/participant" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"doloribus\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/aliquam/participant"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "doloribus"
};
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/aliquam/participant',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'doloribus',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": null,
"slug": "3tU7hKw",
"passcode": "ipsa",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "junius00",
"uuid": "32f437b5-6054-11ee-8c15-000d3a9285ca",
"name": "Jakob Treutel III",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/ducimus/participant/harum" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"itaque\",
\"username\": \"consequatur\",
\"color\": \"#FF0000\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/ducimus/participant/harum"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "itaque",
"username": "consequatur",
"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/ducimus/participant/harum',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'itaque',
'username' => 'consequatur',
'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": "6T3e-po",
"passcode": "quod",
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "friesen.elizabeth",
"uuid": "32f92851-6054-11ee-8c15-000d3a9285ca",
"name": "Madalyn Roob",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/quia/participant/eaque" \
--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/quia/participant/eaque"
);
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/quia/participant/eaque',
[
'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\": \"hykthiskapzbugryoiurci\",
\"operator\": {
\"k\": \"\\\"h2\\\"\",
\"p\": \"non\",
\"rr\": \"animi\",
\"ro\": \"autem\",
\"ra\": \"voluptatem\",
\"e\": \"natus\",
\"mi\": 5.1641717,
\"ma\": 64.035304
},
\"room\": \"HvvOlTl\",
\"whisper\": [
603.014354
],
\"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": "hykthiskapzbugryoiurci",
"operator": {
"k": "\"h2\"",
"p": "non",
"rr": "animi",
"ro": "autem",
"ra": "voluptatem",
"e": "natus",
"mi": 5.1641717,
"ma": 64.035304
},
"room": "HvvOlTl",
"whisper": [
603.014354
],
"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' => 'hykthiskapzbugryoiurci',
'operator' => [
'k' => '"h2"',
'p' => 'non',
'rr' => 'animi',
'ro' => 'autem',
'ra' => 'voluptatem',
'e' => 'natus',
'mi' => 5.1641717,
'ma' => 64.035304,
],
'room' => 'HvvOlTl',
'whisper' => [
603.014354,
],
'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-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "cjones",
"uuid": "330609f6-6054-11ee-8c15-000d3a9285ca",
"name": "Tomas Quigley II",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "corporis",
"slug": "AeQE_Ce",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 13,
"username": "odit_quis",
"color": "#2d08a3",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "lori21",
"uuid": "33077b6f-6054-11ee-8c15-000d3a9285ca",
"name": "Dr. Donny Mann IV",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "33085d19-6054-11ee-8c15-000d3a9285ca",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 3,
"value_to_display": "3",
"type": "d8",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 3,
"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
List rolls
requires authentication
Fetch rolls from a given room
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/roll" \
--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"
);
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',
[
'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": "roll[]",
"data": [
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "pedro.schimmel",
"uuid": "330b87e7-6054-11ee-8c15-000d3a9285ca",
"name": "Tre Cruickshank",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "excepturi",
"slug": "3XlTdBr",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 14,
"username": "quaerat_facere",
"color": "#5d3174",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "chaya70",
"uuid": "330c9bdb-6054-11ee-8c15-000d3a9285ca",
"name": "Mr. Stephon Morar",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "330da839-6054-11ee-8c15-000d3a9285ca",
"is_hidden": false,
"is_user_value": true,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 2,
"value_to_display": "2",
"type": "d4",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 2,
"equation": "1d4",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "mayert.bernice",
"uuid": "330f3a5f-6054-11ee-8c15-000d3a9285ca",
"name": "Catalina Klocko",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "libero",
"slug": "nSoAFEV",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 15,
"username": "occaecati_voluptatem",
"color": "#1df72c",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "camron83",
"uuid": "33102bfc-6054-11ee-8c15-000d3a9285ca",
"name": "Miss Lelia Herman Jr.",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "33110d1e-6054-11ee-8c15-000d3a9285ca",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"value": 12,
"value_to_display": "12",
"type": "d12",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 12,
"equation": "1d12",
"external_id": null,
"participants": []
}
]
}
Received response:
Request failed with error:
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/ex" \
--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/ex"
);
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/ex',
[
'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-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "cwalker",
"uuid": "33150ca9-6054-11ee-8c15-000d3a9285ca",
"name": "Vince Streich",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "molestias",
"slug": "xEvtpSF",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 16,
"username": "in_excepturi",
"color": "#210c2b",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "kuvalis.chelsey",
"uuid": "331619a8-6054-11ee-8c15-000d3a9285ca",
"name": "Amaya Wolff",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "3317039c-6054-11ee-8c15-000d3a9285ca",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": true,
"is_dropped": false,
"value": 11,
"value_to_display": "11",
"type": "d12",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 11,
"equation": "1d12",
"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/non" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"room\": \"perspiciatis\",
\"dice\": [
{
\"uuid\": \"1\",
\"is_hidden\": true
}
]
}"
const url = new URL(
"https://dddice.com/api/1.0/roll/non"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"room": "perspiciatis",
"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/non',
[
'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' => 'perspiciatis',
'dice' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "dach.christian",
"uuid": "331b1b10-6054-11ee-8c15-000d3a9285ca",
"name": "Madeline Mosciski",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "pariatur",
"slug": "olHEQ57",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 17,
"username": "et_illum",
"color": "#02530c",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "baumbach.telly",
"uuid": "331c2d79-6054-11ee-8c15-000d3a9285ca",
"name": "Prof. Edna Cassin",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "331d172b-6054-11ee-8c15-000d3a9285ca",
"is_hidden": false,
"is_user_value": true,
"is_visible": false,
"is_cleared": false,
"is_dropped": false,
"value": 4,
"value_to_display": "4",
"type": "d4",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 4,
"equation": "1d4",
"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\": \"6ac91def-14eb-3693-816a-31be08994829\",
\"is_visible\": true,
\"is_cleared\": false,
\"is_dropped\": false,
\"is_hidden\": 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": "6ac91def-14eb-3693-816a-31be08994829",
"is_visible": true,
"is_cleared": false,
"is_dropped": false,
"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',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'rolls' => [
[
'dice' => [
[
'uuid' => '6ac91def-14eb-3693-816a-31be08994829',
'is_visible' => true,
'is_cleared' => false,
'is_dropped' => false,
'is_hidden' => true,
],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "roll[]",
"data": [
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "madisyn22",
"uuid": "3321a2e7-6054-11ee-8c15-000d3a9285ca",
"name": "Meta Ferry",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "sed",
"slug": "BNwkMUG",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 18,
"username": "eos_praesentium",
"color": "#229825",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "gus42",
"uuid": "3322ba65-6054-11ee-8c15-000d3a9285ca",
"name": "Cristina Feeney",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "33239d77-6054-11ee-8c15-000d3a9285ca",
"is_hidden": false,
"is_user_value": false,
"is_visible": true,
"is_cleared": true,
"is_dropped": false,
"value": 1,
"value_to_display": "1",
"type": "d10",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 1,
"equation": "1d10",
"external_id": null,
"participants": []
},
{
"direction": 180,
"velocity": 1,
"updated_at": "2023-10-01T12:15:24.000000Z",
"created_at": "2023-10-01T12:15:24.000000Z",
"user": {
"username": "sipes.mac",
"uuid": "33253708-6054-11ee-8c15-000d3a9285ca",
"name": "Moshe Lehner",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"room": {
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "iste",
"slug": "V_InOWI",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"participants": [
{
"id": 19,
"username": "saepe_facilis",
"color": "#71df02",
"position": 0,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z",
"deleted_at": null,
"user": {
"username": "pbruen",
"uuid": "33262718-6054-11ee-8c15-000d3a9285ca",
"name": "Saul Hand",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
}
]
},
"values": [
{
"uuid": "3327113f-6054-11ee-8c15-000d3a9285ca",
"is_hidden": true,
"is_user_value": false,
"is_visible": false,
"is_cleared": true,
"is_dropped": false,
"value": 3,
"value_to_display": "3",
"type": "d12",
"label": null,
"meta": null,
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
}
],
"total_value": 3,
"equation": "1d12",
"external_id": null,
"participants": []
}
]
}
Received response:
Request failed with error:
Delete rolls
requires authentication
Delete rolls from a given room
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/roll" \
--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"
);
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/roll',
[
'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:
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": "Aubrey Ward",
"username": "hudson.herbert",
"updated_at": "2023-10-01T12:15:25.000000Z",
"created_at": "2023-10-01T12:15:25.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "non",
"slug": "Rs4SKyY",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.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": "Mrs. Jakayla Emard",
"username": "rosanna.barton",
"updated_at": "2023-10-01T12:15:25.000000Z",
"created_at": "2023-10-01T12:15:25.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": null,
"passcode": "sunt",
"slug": "Q2SeDal",
"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
},
"participant": {
"defaultDiceTrayToGM": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"roll": {
"allowPlayerRollUpdates": false,
"allowPlayerMoveDice": false,
"autoClear": 10,
"defaultClickBehavior": "reroll",
"diceSize": 1,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"disableShakingSound": false,
"pickUp": 1
}
},
"created_at": "2023-10-01T12:15:25.000000Z",
"updated_at": "2023-10-01T12:15:25.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\": \"corrupti\"
}"
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": "corrupti"
};
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' => 'corrupti',
],
]
);
$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/similique" \
--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/similique"
);
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/similique',
[
'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=doloremque&ids=voluptatem" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 16.459013781,
\"filter\": \"non\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const params = {
"filter": "doloremque",
"ids": "voluptatem",
};
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": 16.459013781,
"filter": "non"
};
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' => 'doloremque',
'ids' => 'voluptatem',
],
'json' => [
'limit' => 16.459013781,
'filter' => 'non',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "theme[]",
"data": [
{
"meshes": {
"d4": "https://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "est-eaque",
"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": "Cumque aut ullam omnis ipsum cum nesciunt illum. Qui officia illo itaque quaerat possimus molestiae enim.",
"user": {
"username": "gbayer",
"uuid": "333d81c6-6054-11ee-8c15-000d3a9285ca",
"name": "Joaquin Ward",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
{
"meshes": {
"d4": "https://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "molestiae-incidunt-et",
"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": "Illo eaque cumque modi amet sunt atque sed. Eos occaecati maiores odio harum consequatur culpa. Aut aliquid autem adipisci quis.",
"user": {
"username": "klein.cordell",
"uuid": "333f3b21-6054-11ee-8c15-000d3a9285ca",
"name": "Mr. Marcos Okuneva",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/illum" \
--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/illum"
);
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/illum',
[
'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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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": "magnam-magnam-minima",
"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": "Impedit vel nisi nihil saepe deleniti. Accusamus nam aut ex assumenda. Ipsa ab unde eveniet sunt natus.",
"user": {
"username": "jeromy.howe",
"uuid": "33429824-6054-11ee-8c15-000d3a9285ca",
"name": "Mrs. Stacy Ortiz",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/deserunt" \
--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/deserunt"
);
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/deserunt',
[
'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://cdn.dddice.com/mesh/d04.fbx",
"d6": "https://cdn.dddice.com/mesh/d06.fbx",
"d8": "https://cdn.dddice.com/mesh/d08.fbx",
"d10": "https://cdn.dddice.com/mesh/d10.fbx",
"d10x": "https://cdn.dddice.com/mesh/d10.fbx",
"d12": "https://cdn.dddice.com/mesh/d12.fbx",
"d20": "https://cdn.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://cdn.dddice.com/sounds/roll-1.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-2.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-3.mp3",
"on": "die.collide"
},
{
"src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "https://cdn.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-aspernatur-quisquam",
"name": "Mr.",
"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": "Odio ducimus quis enim aut et cupiditate. Cum fugiat veritatis eos ut. Optio non sit laboriosam voluptatem. Et ut sit hic.",
"user": {
"username": "thompson.patrick",
"uuid": "3345105f-6054-11ee-8c15-000d3a9285ca",
"name": "Shania Graham",
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.000000Z"
},
"created_at": "2023-10-01T12:15:24.000000Z",
"updated_at": "2023-10-01T12:15:24.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/ex" \
--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/ex"
);
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/ex',
[
'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:
Integration Authentication
API for authenticating with third-party applications and integrations
Create activation code
When setting up an integration, it is advised to present a potential user with a "code" and then have the user enter that code on the official dddice website.
This is not only easy for the user to interact with, it also helps prevent odd handshakes
and security barriers when trying to authenticate with cookies and/or other mechanisms,
especially when trying to authenticate inside an <iframe />
.
When a code is returned, ask the user to navigate to https://dddice.com/activate where they will be prompted to enter the code shown on your integrations screen.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/activate" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/activate"
);
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/activate',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": []
}
Received response:
Request failed with error:
Read activation code
While waiting for the user to authenticate, this endpoint can be used to retrieve the latest status of the activation code.
If a user is present, an integration can assume the user has successfully authenticated using this code.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/activate/minus" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Authorization: Secret secret-value"
const url = new URL(
"https://dddice.com/api/1.0/activate/minus"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Authorization: Secret secret-value",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://dddice.com/api/1.0/activate/minus',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Authorization: Secret secret-value',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": []
}
Received response:
Request failed with error:
Authenticate activation code
requires authentication
After a user is prompted to enter a code, this (protected) endpoint is used to sync the requesting user and secret/code together in order to activate the integration.
This request is typically not used directly when integrating with dddice.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/activate/ab" \
--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/activate/ab"
);
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/activate/ab',
[
'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": []
}
Received response:
Request failed with error: