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": "/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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "quae-illo",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Aut enim provident laborum dolorum sint tenetur incidunt. Ut voluptates amet nisi earum. Ea et beatae aut velit. Voluptates est recusandae commodi voluptas officia magnam.",
"user": {
"username": "crystel.cummings",
"uuid": "2fadf051-3994-3a97-a185-f4c4b265b8b8",
"name": "Quinn Friesen",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z"
},
{
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "ut-animi-possimus",
"name": "Mrs.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Dolorem aliquam commodi dolorem reiciendis quas explicabo enim quod. Et dolores sit itaque deleniti. Et rerum numquam non doloribus nam est.",
"user": {
"username": "smitham.hayley",
"uuid": "9f821171-f348-3fcc-a7ca-dc390dee4516",
"name": "Abbie Ruecker IV",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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=molestiae" \
--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=at" \
--form "assets[]=@/tmp/phpvEowOZ"
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', 'molestiae');
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', 'at');
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' => 'molestiae'
],
[
'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' => 'at'
],
[
'name' => 'assets[]',
'contents' => fopen('/tmp/phpvEowOZ', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "sint-est",
"name": "Ms.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Fuga qui autem assumenda sint atque. Aliquid maxime nemo labore quaerat sint aut ad. Et laudantium omnis excepturi temporibus officia esse.",
"user": {
"username": "icummerata",
"uuid": "4321ea8e-e087-3a7e-b357-3b89e3a13935",
"name": "Brady Miller",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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": "/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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "modi-rerum",
"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": "Incidunt alias nesciunt quia sint. Nisi quia quisquam ut. Debitis iure itaque repellendus dolorem totam expedita. Sit expedita consequatur id minima dicta quia.",
"user": {
"username": "van.borer",
"uuid": "e7d702c2-1247-3826-b8d8-91a6fd19d980",
"name": "Prof. Keith Renner",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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": "/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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "et-eum-suscipit",
"name": "Ms.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Perferendis omnis magni error est ut consectetur itaque. Quisquam repudiandae quas debitis velit quia. Tempora incidunt neque dignissimos incidunt. Eligendi ipsam dolorem rerum non qui.",
"user": {
"username": "agreenfelder",
"uuid": "6a8ff753-138e-3aff-9df7-cecc2fbe524e",
"name": "Elvis Brown",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z"
},
{
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "voluptatem-vero",
"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": "Animi veritatis et illum eveniet aspernatur non. Tempore earum dolores aperiam ullam atque. Soluta explicabo dolores beatae voluptate voluptatem.",
"user": {
"username": "block.kyleigh",
"uuid": "a50fca25-b05d-3383-9696-bcf0cb3e53bc",
"name": "Lorenza Von",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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": "/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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "ullam-tempore",
"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": "Ad beatae deserunt a ipsa. Laudantium sed iste voluptates corrupti nihil magni. Deleniti officiis est ratione ut. Ut sit laborum accusantium vel ut laudantium et.",
"user": {
"username": "fwintheiser",
"uuid": "0190ef8d-c7fc-3272-a793-d467e731f670",
"name": "Maxwell Ziemann II",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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/sapiente" \
--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/sapiente"
);
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/sapiente',
[
'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:
Chart: Frequency of roll values
requires authentication
Get statistical information about a theme.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme/1/statistic/histogram/values" \
--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/1/statistic/histogram/values"
);
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/1/statistic/histogram/values',
[
'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": {
"labels": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
"datasets": [{
"label": "d4",
"data": [12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}, {
"label": "d6",
"data": [5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}, {
"label": "d8",
"data": [8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}, {
"label": "d20",
"data": [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
}],
"processed_at": "2023-10-06T21:36:22.462064Z"
"updated_at": "2023-10-06T21:37:11.221642Z"
}
}
Received response:
Request failed with error:
Chart: Total rolls over time
requires authentication
Get statistical information about a theme.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/theme/1/statistic/timeseries/rolls" \
--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/1/statistic/timeseries/rolls"
);
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/1/statistic/timeseries/rolls',
[
'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": {
"labels": ["2023-01-01", "2023-01-02", "2023-01-03"],
"datasets": [{
"label": "Rolls over time",
"data": [1000, 1100, 1200]
}],
"processed_at": "2023-10-06T21:36:22.462064Z"
"updated_at": "2023-10-06T21:37:11.221642Z"
}
}
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?created=tenetur" \
--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 params = {
"created": "tenetur",
};
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',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'created' => 'tenetur',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "room[]",
"data": [
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-2.webp",
"slug": "-uL6xlQ",
"passcode": "impedit",
"custom_slug": "RZ8f121",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "douglas.horace",
"uuid": "a46bef72-9f7c-3de5-b745-609ad19fe8c5",
"name": "Walker Daniel",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"participants": [
{
"id": 2,
"username": "aut_optio",
"color": "#a68047",
"position": 0,
"settings": null,
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"deleted_at": null,
"user": {
"username": "alana.bailey",
"uuid": "c1701efd-afbd-3757-98fb-5c1a286c2cf4",
"name": "Jude Mayert",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
}
},
{
"id": 3,
"username": "qui_earum",
"color": "#f0c0dd",
"position": 0,
"settings": null,
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"deleted_at": null,
"user": {
"username": "walker.erick",
"uuid": "d52e2e50-a4b3-3377-913f-c0ea5b5568af",
"name": "Prof. Lavina Tremblay DVM",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
}
}
]
},
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-6.webp",
"slug": "BKRljr-",
"passcode": "qui",
"custom_slug": "pBhrXgY",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "ifadel",
"uuid": "632a128d-9e28-3bda-95a1-2c4a3d4e5550",
"name": "Neoma Little IV",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"participants": [
{
"id": 4,
"username": "et_velit",
"color": "#8e794c",
"position": 0,
"settings": null,
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"deleted_at": null,
"user": {
"username": "breitenberg.zena",
"uuid": "8dc596ff-b808-37a9-857e-662555ecc2f5",
"name": "Lavinia Legros",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
}
},
{
"id": 5,
"username": "sapiente_nostrum",
"color": "#815991",
"position": 0,
"settings": null,
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"deleted_at": null,
"user": {
"username": "lacey.schmeler",
"uuid": "257eea83-a220-3bf7-b772-f79b1c996660",
"name": "Gudrun Homenick",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
}
}
]
}
]
}
Received response:
Request failed with error:
Create a Room
requires authentication
Create a room and use the slug to perform actions in that room.
If is_public
is set to false
, the returned passcode
will be required
for future requests to perform actions in this room.
You may optionally pass a valid passcode
to generate your own code.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/room" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"is_public\": true,
\"name\": \"in\",
\"passcode\": \"quidem\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"is_public": true,
"name": "in",
"passcode": "quidem"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/room',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'is_public' => true,
'name' => 'in',
'passcode' => 'quidem',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-1.webp",
"slug": "xPlQT90",
"passcode": "quos",
"custom_slug": "ByAG_wX",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "vdoyle",
"uuid": "bcc07833-54ec-31f4-a10e-26b2fc565494",
"name": "Nels Klein",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"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/1?passcode=quidem" \
--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/1"
);
const params = {
"passcode": "quidem",
};
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/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'passcode' => 'quidem',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-6.webp",
"slug": "cQCKh_3",
"passcode": "quis",
"custom_slug": "r89-4cp",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "sturcotte",
"uuid": "0fa9dacb-e8dc-3537-9903-18483d96c35b",
"name": "Mrs. Briana Jacobi",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"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/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_public=" \
--form "name=sequi" \
--form "passcode=" \
--form "custom_slug=dfihnyqayrzubcxkcgfqte" \
--form "bg_file_path=@/tmp/phpVwmvHP"
const url = new URL(
"https://dddice.com/api/1.0/room/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('is_public', '');
body.append('name', 'sequi');
body.append('passcode', '');
body.append('custom_slug', 'dfihnyqayrzubcxkcgfqte');
body.append('bg_file_path', document.querySelector('input[name="bg_file_path"]').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/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'is_public',
'contents' => ''
],
[
'name' => 'name',
'contents' => 'sequi'
],
[
'name' => 'passcode',
'contents' => ''
],
[
'name' => 'custom_slug',
'contents' => 'dfihnyqayrzubcxkcgfqte'
],
[
'name' => 'bg_file_path',
'contents' => fopen('/tmp/phpVwmvHP', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-6.webp",
"slug": "7uldGK0",
"passcode": "quibusdam",
"custom_slug": "oW_m6j-",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "ena.bosco",
"uuid": "5fccc42a-4c88-319d-8dca-421f95ce411c",
"name": "Eulalia West",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"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/1" \
--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/1"
);
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/1',
[
'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):
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/1/participant" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"passcode\": \"repellendus\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/1/participant"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"passcode": "repellendus"
};
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/1/participant',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'passcode' => 'repellendus',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-5.webp",
"slug": "Qa2ocao",
"passcode": "ad",
"custom_slug": "nAv3ouN",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "garrick.botsford",
"uuid": "2b05fb14-78d4-35a3-bc0c-6a1772d3425a",
"name": "Addie Reinger III",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"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/1/participant/laborum" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"sit\",
\"color\": \"#FF0000\",
\"passcode\": \"numquam\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/1/participant/laborum"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "sit",
"color": "#FF0000",
"passcode": "numquam"
};
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/participant/laborum',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'sit',
'color' => '#FF0000',
'passcode' => 'numquam',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-5.webp",
"slug": "MOcIb4H",
"passcode": "quia",
"custom_slug": "Pvqdb5x",
"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
}
},
"updated_at": "2024-03-13T11:55:29.000000Z",
"created_at": "2024-03-13T11:55:29.000000Z",
"user": {
"username": "mcclure.kariane",
"uuid": "d44529ca-247c-31c6-81ff-1ea82d1bd63e",
"name": "Prof. Liza Haag V",
"created_at": "2024-03-13T11:55:29.000000Z",
"updated_at": "2024-03-13T11:55:29.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"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/1/participant/velit" \
--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/1/participant/velit"
);
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/1/participant/velit',
[
'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\": \"dcyeqxdecvixalz\",
\"operator\": {
\"k\": \"\\\"h2\\\"\",
\"d\": \"\\\"l1\\\"\",
\"*\": 2,
\"\\/\": 18
},
\"room\": \"HvvOlTl\",
\"whisper\": [
3.17
],
\"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": "dcyeqxdecvixalz",
"operator": {
"k": "\"h2\"",
"d": "\"l1\"",
"*": 2,
"\/": 18
},
"room": "HvvOlTl",
"whisper": [
3.17
],
"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' => 'dcyeqxdecvixalz',
'operator' => [
'k' => '"h2"',
'd' => '"l1"',
'*' => 2,
'/' => 18,
],
'room' => 'HvvOlTl',
'whisper' => [
3.17,
],
'label' => '"Longbow damage with Hunter\'s Mark"',
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
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):
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/provident" \
--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/provident"
);
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/provident',
[
'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):
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/id" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"dice\": [
{
\"uuid\": \"1\",
\"is_hidden\": true
}
]
}"
const url = new URL(
"https://dddice.com/api/1.0/roll/id"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"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/id',
[
'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,
],
],
],
[
'dice' => [
$o[0],
],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
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\": \"4dd0a2a1-6083-333f-b2c8-ece11d85a3ac\",
\"is_cleared\": true,
\"is_dropped\": false,
\"is_hidden\": false
}
]
}
]
}"
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": "4dd0a2a1-6083-333f-b2c8-ece11d85a3ac",
"is_cleared": true,
"is_dropped": false,
"is_hidden": 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/roll',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'rolls' => [
[
'dice' => [
[
'uuid' => '4dd0a2a1-6083-333f-b2c8-ece11d85a3ac',
'is_cleared' => true,
'is_dropped' => false,
'is_hidden' => false,
],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
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.
Create Share Request
requires authentication
Create a share request for a given theme.
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": "Miss Florida Kuphal PhD",
"username": "darrel10",
"uuid": "820a69c6-c94a-39da-b152-93a15bcb5789",
"updated_at": "2024-03-13T11:55:30.000000Z",
"created_at": "2024-03-13T11:55:30.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": "/images/environment/bg-3.webp",
"passcode": "ab",
"slug": "oEbFabJ",
"custom_slug": "oneNjWP",
"settings": {
"chat": {
"textSize": "sm",
"fadeAfter": 10,
"isVisible": true,
"textColor": 16777215,
"deleteAfter": 30,
"isDiceSorted": false,
"isDiceExpanded": false,
"backgroundColor": 0,
"isUsernameVisible": true
},
"roll": {
"pickUp": 1,
"diceSize": 1,
"autoClear": 10,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"allowPlayerMoveDice": false,
"disableShakingSound": false,
"defaultClickBehavior": "reroll",
"allowPlayerRollUpdates": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"lighting": {
"ambientColor": 16777215,
"spotlightColor": 16777215,
"ambientIntensity": 0.5,
"spotlightIntensity": 0.33
},
"participant": {
"defaultDiceTrayToGM": false
}
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"deleted_at": null
}
],
"subscription": false,
"is_merchant": false
}
}
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 3 accounts/per minute per IP.
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": "Bradford Watsica",
"username": "hillary28",
"uuid": "ee105a4f-999a-36e4-a913-876e542d7b89",
"updated_at": "2024-03-13T11:55:30.000000Z",
"created_at": "2024-03-13T11:55:30.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": "/images/environment/bg-4.webp",
"passcode": "rerum",
"slug": "UnrRGz_",
"custom_slug": "WZwQQFN",
"settings": {
"chat": {
"textSize": "sm",
"fadeAfter": 10,
"isVisible": true,
"textColor": 16777215,
"deleteAfter": 30,
"isDiceSorted": false,
"isDiceExpanded": false,
"backgroundColor": 0,
"isUsernameVisible": true
},
"roll": {
"pickUp": 1,
"diceSize": 1,
"autoClear": 10,
"diceLimit": 25,
"diceTrayColor": 0,
"disableDiceOutline": false,
"disableDiceShadows": false,
"allowPlayerMoveDice": false,
"disableShakingSound": false,
"defaultClickBehavior": "reroll",
"allowPlayerRollUpdates": false
},
"physics": {
"gravity": 9.82,
"throwSpeed": 30
},
"lighting": {
"ambientColor": 16777215,
"spotlightColor": 16777215,
"ambientIntensity": 0.5,
"spotlightIntensity": 0.33
},
"participant": {
"defaultDiceTrayToGM": false
}
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"deleted_at": null
}
],
"subscription": false,
"is_merchant": false
}
}
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\": \"ea\"
}"
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": "ea"
};
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' => 'ea',
],
]
);
$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/quam" \
--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/quam"
);
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/quam',
[
'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=voluptates&ids=aut" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 1287.772586,
\"filter\": \"nostrum\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const params = {
"filter": "voluptates",
"ids": "aut",
};
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": 1287.772586,
"filter": "nostrum"
};
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' => 'voluptates',
'ids' => 'aut',
],
'json' => [
'limit' => 1287.772586,
'filter' => 'nostrum',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"type": "theme[]",
"data": [
{
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "distinctio-atque-eos",
"name": "Mrs.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Dolorem expedita nam dolores omnis. Perspiciatis tempora fuga nihil beatae. Omnis doloribus ut id temporibus corrupti. Quidem facere qui sint deserunt sit expedita earum.",
"user": {
"username": "neffertz",
"uuid": "1f5f3a52-1434-34d4-8bf8-f780677128a7",
"name": "Marcellus Mohr",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z"
},
{
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/sounds/roll-loading-lg.mp3",
"on": "roll.loading",
"value": ">=3"
}
],
"uniforms": {
"number": {
"type": "color",
"value": {
"b": 0,
"g": 0.424,
"r": 0.463
}
},
"diffuse": {
"type": "color",
"value": {
"b": 0,
"g": 0.929,
"r": 1
}
}
},
"values": {
"d4": [
1,
2,
3,
4
],
"d6": [
1,
2,
3,
4,
5,
6
],
"d8": [
1,
2,
3,
4,
5,
6,
7,
8
],
"d10": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"d12": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12
],
"d20": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"d10x": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
0
]
},
"id": "consequatur-aliquid",
"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": "Ex hic rerum nisi voluptatem consequatur tenetur. In repudiandae dolorem animi in ea eius dolor. Quidem voluptas dolor ipsum et recusandae velit porro. Temporibus doloribus blanditiis omnis ut. Explicabo dolores magni sunt dolores.",
"user": {
"username": "felipa34",
"uuid": "76e2e74a-afa4-3a45-8a59-c59246aa5b55",
"name": "Ila Gutmann",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z"
}
]
}
Received response:
Request failed with error:
Add Theme to Dice Box
requires authentication
Add a theme to your Digital Dice Box.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/dice-box" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": \"error\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": "error"
};
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/dice-box',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 'error',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"data": {
"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"
},
{
"src": "/sounds/roll-loading-sm.mp3",
"on": "roll.loading",
"value": 2
},
{
"src": "/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": "dolores-sunt",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Dolorem dignissimos dignissimos id quis. Modi pariatur voluptatem itaque consequatur aspernatur. Saepe quis maxime harum expedita deleniti aut. Fugit sint amet doloribus dolor sunt.",
"user": {
"username": "agustina42",
"uuid": "de1501c2-deb7-3a15-a500-2542effc451c",
"name": "Dr. Amparo Kertzmann V",
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z",
"stripe_id": null,
"pm_type": null,
"pm_last_four": null,
"trial_ends_at": null
},
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.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/non" \
--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/non"
);
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/non',
[
'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:
Endpoints
Get a product
requires authentication
Get information about a product including digital items (themes) and merchant information.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/product/1" \
--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/product/1"
);
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/product/1',
[
'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": {
"merchant_id": 11,
"name": "Augusta Durgan",
"description": "Maxime fuga repellat ut nobis. Omnis dolores hic rem placeat. Corrupti consequatur mollitia sapiente neque ducimus maxime. Eveniet consequuntur et ducimus reprehenderit voluptas nam.",
"sku": "DDD-9305",
"is_on_sale": true,
"updated_at": "2024-03-13T11:55:30.000000Z",
"created_at": "2024-03-13T11:55:30.000000Z",
"id": 11,
"merchant": {
"id": 11,
"name": "Mr. Bertha Hirthe II",
"description": "Voluptatem omnis omnis fugit dolore et ipsum dolores dolores. Eveniet ut est numquam dolorem.",
"merchant_commission": 51,
"logo_path": null,
"is_contracts_complete": 0,
"is_tax_documents_complete": 0,
"sku_prefix": "vmo",
"contact_email": "georgette29@yahoo.com",
"paypal_email": "okoelpin@yahoo.com",
"website_url": null,
"applicant_type": null,
"is_us_citizen": null,
"applicant_name": null,
"created_at": "2024-03-13T11:55:30.000000Z",
"updated_at": "2024-03-13T11:55:30.000000Z"
},
"themes": [],
"original_price": "0.00",
"price": "0.00",
"is_available_for_purchase": false
}
}
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 />
.
Call this endpoint and receive an activation code in 'code' and an authentication secret in 'secret'.
Display the code to the user and ask them to navigate to https://dddice.com/activate where they will be prompted to login/register (as needed) and then enter the code.
Your integration can poll GET /activate/{code} to be notified when the user completes the activation flow. See that endpoint's documentation for more details.
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):
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. We recommend you poll this endpoint no more frequently than every 5 seconds
One the user has completed the login/registration process and approved the code for activation you will receive an API key in the 'token' field.
This can then be used to authenticate all future requests as that user.
The Secret in the headers is the secret you received along with the code from POST /authenticate
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/activate/consequatur" \
--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/consequatur"
);
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/consequatur',
[
'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):
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/fuga" \
--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/fuga"
);
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/fuga',
[
'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):
Received response:
Request failed with error:
Wishlists
API for managing wishlists.
List Wishlist
requires authentication
List all products in a user's wishlist.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/wishlist" \
--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/wishlist"
);
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/wishlist',
[
'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": "wishlist[]",
"data": [
[],
[]
]
}
Received response:
Request failed with error:
Get from Wishlist
requires authentication
Get a particular product from a user's wishlist.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/wishlist/20" \
--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/wishlist/20"
);
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/wishlist/20',
[
'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:
Add to Wishlist
requires authentication
Add a product to a user's wishlist.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/wishlist/19" \
--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/wishlist/19"
);
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/wishlist/19',
[
'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:
Delete from Wishlist
requires authentication
Remove a product from a user's wishlist.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/wishlist/20" \
--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/wishlist/20"
);
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/wishlist/20',
[
'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: