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": "consectetur-perspiciatis-debitis",
"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": "Sit unde expedita aliquid omnis. Sequi ut optio aliquid est doloribus ut fuga. Quo nesciunt veniam sed laudantium praesentium. Natus expedita quibusdam ex similique esse ex sint sit.",
"user": {
"username": "granville61",
"uuid": "21465fb4-f790-37fd-ab10-6d60de6b8ef4",
"name": "Shirley Murray",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "velit-quae",
"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": "Architecto deleniti eum nam veniam hic. Est rem praesentium et placeat quo eius aliquid. Omnis sunt et molestiae quaerat quos ipsum. Hic quia ut quas delectus culpa saepe aperiam.",
"user": {
"username": "jason70",
"uuid": "ceaf8b14-e186-309c-9bd3-1f6b8788c477",
"name": "Mr. Dawson Braun",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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=laudantium" \
--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=commodi" \
--form "assets[]=@/tmp/phpRr1xbu"
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', 'laudantium');
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', 'commodi');
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' => 'laudantium'
],
[
'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' => 'commodi'
],
[
'name' => 'assets[]',
'contents' => fopen('/tmp/phpRr1xbu', '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": "quaerat-qui-beatae",
"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": "Amet harum enim veniam omnis et. Excepturi et nemo sunt sunt ratione vero sed vero. Delectus eum rerum sed ea porro cumque. Aspernatur aliquid odit sequi aut non eaque adipisci.",
"user": {
"username": "lehner.tyree",
"uuid": "a07abbdf-9a1b-36c9-824c-e6cfbb006fa8",
"name": "Brigitte Barton",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "voluptatem-ullam",
"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": "Harum sit magni natus voluptas voluptatum. Unde ipsum sed non officiis temporibus. Dolore quis harum omnis. Repellendus in earum adipisci veniam ex corporis.",
"user": {
"username": "bergstrom.noah",
"uuid": "9d8b2cb3-5fdb-30bf-927d-11c49f889d59",
"name": "Leslie Murazik",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "accusamus-asperiores-magnam",
"name": "Prof.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Et ratione qui et iste autem. Cupiditate soluta veniam vitae aut quia. Dolor aut sed provident illum earum doloremque. Ab accusantium voluptatem labore doloribus ipsam.",
"user": {
"username": "iwilkinson",
"uuid": "855cb255-23a6-362e-82c8-a104c1494bd9",
"name": "Dr. Grayson Pfannerstill",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "esse-impedit",
"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": "Quo libero consequuntur sit possimus quisquam et. Quis ipsam cupiditate voluptas rerum enim voluptates. Praesentium aspernatur in itaque ipsa quia natus.",
"user": {
"username": "hoeger.kylee",
"uuid": "90b85b43-8963-3b06-9d05-23a0341c4180",
"name": "Hertha Leuschke",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "vitae-molestiae-beatae",
"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": "Quibusdam non similique iure animi eaque non. Ratione voluptas eum odit. Id amet et omnis reprehenderit quis quam porro eius.",
"user": {
"username": "moore.jamar",
"uuid": "44f58289-073c-3181-a09f-b75a98d31185",
"name": "Alessandro Hane Jr.",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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/enim" \
--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/enim"
);
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/enim',
[
'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=et" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room"
);
const params = {
"created": "et",
};
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' => 'et',
],
]
);
$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-6.webp",
"slug": "OYOmZj9",
"passcode": "et",
"custom_slug": "vvvXWir",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "rkeebler",
"uuid": "032e0912-91de-3dfd-a0bc-add6763762fd",
"name": "Camron Volkman I",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": [
{
"id": 2,
"username": "quibusdam_enim",
"color": "#54d627",
"position": 0,
"settings": null,
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z",
"deleted_at": null,
"user": {
"username": "retta.howell",
"uuid": "12f5ae4b-85ac-36d6-9932-504b5e63cd61",
"name": "Clarissa Kunze",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
}
},
{
"id": 3,
"username": "culpa_sit",
"color": "#9aac21",
"position": 0,
"settings": null,
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z",
"deleted_at": null,
"user": {
"username": "koch.donny",
"uuid": "5a00c5d9-541e-3380-b703-7ecb59f5a85d",
"name": "Kailyn Klocko",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
}
}
]
},
{
"name": "Untitled Room",
"is_public": true,
"bg_file_path": "//images/environment/bg-2.webp",
"slug": "hshqyO2",
"passcode": "totam",
"custom_slug": "7bX9Hh4",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "hhauck",
"uuid": "7394cd30-574f-342e-b6c0-832d2440789e",
"name": "Bailey Keebler",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": [
{
"id": 4,
"username": "et_dolorum",
"color": "#17c613",
"position": 0,
"settings": null,
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z",
"deleted_at": null,
"user": {
"username": "lubowitz.chadd",
"uuid": "e11855b7-45e5-3adc-bf07-5524b40134b7",
"name": "Mrs. Carlotta Rath MD",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
}
},
{
"id": 5,
"username": "id_est",
"color": "#a5cbf3",
"position": 0,
"settings": null,
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z",
"deleted_at": null,
"user": {
"username": "wgoldner",
"uuid": "658e1be1-cf5d-3344-a4f2-0947b66d049b",
"name": "Mr. Donavon Sporer",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
}
}
]
}
]
}
Received response:
Request failed with error:
Create a Room
requires authentication
Create a room and use the slug to perform actions in that room.
If is_public
is set to false
, the returned passcode
will be required
for future requests to perform actions in this room.
You may optionally pass a valid passcode
to generate your own code.
Example request:
curl --request POST \
"https://dddice.com/api/1.0/room" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"is_public\": false,
\"name\": \"nesciunt\",
\"passcode\": \"non\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"is_public": false,
"name": "nesciunt",
"passcode": "non"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/room',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'is_public' => false,
'name' => 'nesciunt',
'passcode' => 'non',
],
]
);
$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-6.webp",
"slug": "wzW1wEi",
"passcode": "eligendi",
"custom_slug": "RzEqc7U",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "taufderhar",
"uuid": "c505c30a-0669-388d-bf67-c1ef7691e959",
"name": "Mrs. Vena Ernser",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Get a Room
requires authentication
Get information about a room and active participants.
Example request:
curl --request GET \
--get "https://dddice.com/api/1.0/room/1?passcode=in" \
--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": "in",
};
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' => 'in',
],
]
);
$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-2.webp",
"slug": "5RqDbRX",
"passcode": "praesentium",
"custom_slug": "lLeR75O",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "lesly66",
"uuid": "6fcca2b1-70f3-3f64-867a-de1c87519012",
"name": "Verlie Kris",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Update a Room
requires authentication
Update the name of a room
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/room/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "is_public=" \
--form "name=libero" \
--form "passcode=" \
--form "custom_slug=cngrfxdxnlunwebthwjv" \
--form "bg_file_path=@/tmp/phph41fJt"
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', 'libero');
body.append('passcode', '');
body.append('custom_slug', 'cngrfxdxnlunwebthwjv');
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' => 'libero'
],
[
'name' => 'passcode',
'contents' => ''
],
[
'name' => 'custom_slug',
'contents' => 'cngrfxdxnlunwebthwjv'
],
[
'name' => 'bg_file_path',
'contents' => fopen('/tmp/phph41fJt', '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-1.webp",
"slug": "wpSlaGz",
"passcode": "autem",
"custom_slug": "1nZY9WC",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "liana.kunze",
"uuid": "689443b2-6a6b-319f-b9fe-7ab9c0beedeb",
"name": "Dr. Veronica Lakin",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Delete a Room
requires authentication
Delete a room you own.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/room/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\": true,
\"is_cleared\": true
}
}"
const url = new URL(
"https://dddice.com/api/1.0/room/1/roll"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"dice": {
"is_hidden": true,
"is_visible": true,
"is_cleared": 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/room/1/roll',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'dice' => [
'is_hidden' => true,
'is_visible' => true,
'is_cleared' => true,
],
],
]
);
$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\": \"omnis\"
}"
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": "omnis"
};
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' => 'omnis',
],
]
);
$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": "eriH-36",
"passcode": "consequatur",
"custom_slug": "9SWH22_",
"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-04-24T10:57:51.000000Z",
"created_at": "2024-04-24T10:57:51.000000Z",
"user": {
"username": "kub.elizabeth",
"uuid": "c5076d5d-652e-38ee-84b7-e806e862a712",
"name": "Miss Leanne Yundt Jr.",
"created_at": "2024-04-24T10:57:51.000000Z",
"updated_at": "2024-04-24T10:57:51.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Update a Participant
requires authentication
Update the username or color of the room participant.
Example request:
curl --request PATCH \
"https://dddice.com/api/1.0/room/1/participant/ratione" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"perspiciatis\",
\"color\": \"#FF0000\",
\"passcode\": \"ex\"
}"
const url = new URL(
"https://dddice.com/api/1.0/room/1/participant/ratione"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "perspiciatis",
"color": "#FF0000",
"passcode": "ex"
};
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/ratione',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'perspiciatis',
'color' => '#FF0000',
'passcode' => 'ex',
],
]
);
$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-4.webp",
"slug": "2s3EZt3",
"passcode": "enim",
"custom_slug": "EtCHm_C",
"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-04-24T10:57:52.000000Z",
"created_at": "2024-04-24T10:57:52.000000Z",
"user": {
"username": "rodriguez.della",
"uuid": "03d6755e-5dfa-3893-b0bf-3b56a4b89030",
"name": "Sallie Nitzsche",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z"
},
"participants": []
}
}
Received response:
Request failed with error:
Leave a Room
requires authentication
Remove a participant from a room. Participants can choose to leave a room using this endpoint. Room owners have permission to remove any participant.
Example request:
curl --request DELETE \
"https://dddice.com/api/1.0/room/1/participant/perferendis" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://dddice.com/api/1.0/room/1/participant/perferendis"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://dddice.com/api/1.0/room/1/participant/perferendis',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (204):
[Empty response]
Received response:
Request failed with error:
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\": \"lfbkjbtgpxrxj\",
\"operator\": {
\"k\": \"\\\"h2\\\"\",
\"d\": \"\\\"l1\\\"\",
\"*\": 15,
\"\\/\": 3
},
\"room\": \"HvvOlTl\",
\"whisper\": [
346605793.2925
],
\"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": "lfbkjbtgpxrxj",
"operator": {
"k": "\"h2\"",
"d": "\"l1\"",
"*": 15,
"\/": 3
},
"room": "HvvOlTl",
"whisper": [
346605793.2925
],
"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' => 'lfbkjbtgpxrxj',
'operator' => [
'k' => '"h2"',
'd' => '"l1"',
'*' => 15,
'/' => 3,
],
'room' => 'HvvOlTl',
'whisper' => [
346605793.2925,
],
'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/enim" \
--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/enim"
);
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/enim',
[
'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/quibusdam" \
--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/quibusdam"
);
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/quibusdam',
[
'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\": \"db7f9feb-a374-3ee4-b386-9b0cc6135955\",
\"is_cleared\": false,
\"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": "db7f9feb-a374-3ee4-b386-9b0cc6135955",
"is_cleared": false,
"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' => 'db7f9feb-a374-3ee4-b386-9b0cc6135955',
'is_cleared' => false,
'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": "Dr. Marlen Reichel",
"username": "else.hyatt",
"uuid": "3dc9bb88-206c-3765-b1d7-0ff9526707be",
"updated_at": "2024-04-24T10:57:52.000000Z",
"created_at": "2024-04-24T10:57:52.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": "/images/environment/bg-3.webp",
"passcode": "et",
"slug": "XKVLhWA",
"custom_slug": "DYfk_8h",
"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-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "Reymundo Barton",
"username": "kschultz",
"uuid": "30c12792-7c6a-3754-986d-b4adf1bac2fe",
"updated_at": "2024-04-24T10:57:52.000000Z",
"created_at": "2024-04-24T10:57:52.000000Z",
"rooms": [
{
"is_public": true,
"name": "Untitled Room",
"bg_file_path": "/images/environment/bg-2.webp",
"passcode": "impedit",
"slug": "itAW3X7",
"custom_slug": "kLXhQ4L",
"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-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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\": \"culpa\"
}"
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": "culpa"
};
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' => 'culpa',
],
]
);
$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/maxime" \
--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/maxime"
);
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/maxime',
[
'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=ea&ids=non" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"limit\": 3029157.9,
\"filter\": \"deserunt\"
}"
const url = new URL(
"https://dddice.com/api/1.0/dice-box"
);
const params = {
"filter": "ea",
"ids": "non",
};
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": 3029157.9,
"filter": "deserunt"
};
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' => 'ea',
'ids' => 'non',
],
'json' => [
'limit' => 3029157.9,
'filter' => 'deserunt',
],
]
);
$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": "velit-eveniet",
"name": "Mr.",
"label": {
"color": "#000000",
"background_color": "#e3d12d"
},
"version": "1.0.0",
"textures": [
{
"src": {
"d4": "u_numberMap.png",
"d6": "u_numberMap.png",
"d8": "u_numberMap.png",
"d10": "u_numberMap.png",
"d12": "u_numberMap.png",
"d20": "u_numberMap.png",
"d10x": "u_numberMap_d10x.png"
},
"binding": "u_numberMap"
}
],
"api_version": "1.0",
"description": "Qui accusantium minima magni excepturi fuga commodi. Velit omnis totam possimus et at. Et alias aut quia. Facere ab in quam consectetur laudantium vel at.",
"user": {
"username": "mae.botsford",
"uuid": "6e3ff67d-b787-3bc4-8fb1-bc813b181b8f",
"name": "Jimmy Kiehn",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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": "accusamus-eligendi-in",
"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": "Nulla molestiae at voluptas nihil. Tempora vitae nostrum nihil vel. Architecto ut est non nihil neque. Voluptas maiores soluta totam est autem.",
"user": {
"username": "okrajcik",
"uuid": "a937123d-b922-3720-bb3b-fe96964bf4cf",
"name": "Mario Wyman",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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\": \"et\"
}"
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": "et"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://dddice.com/api/1.0/dice-box',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 'et',
],
]
);
$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": "voluptate-earum-nisi",
"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": "Labore repudiandae sapiente molestiae. Pariatur recusandae officiis autem rerum deleniti.",
"user": {
"username": "abdullah.rice",
"uuid": "5778b1f4-259f-3554-8490-6c9a874ef8a4",
"name": "Bradford Okuneva Jr.",
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.000000Z",
"subscription": false,
"is_merchant": false
},
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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/odit" \
--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/odit"
);
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/odit',
[
'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": "Mrs. Maureen Terry V",
"description": "Et id architecto corrupti aliquam qui. Repellat odit iusto voluptatem officiis distinctio.",
"sku": "DDD-0842",
"is_on_sale": false,
"updated_at": "2024-04-24T10:57:52.000000Z",
"created_at": "2024-04-24T10:57:52.000000Z",
"id": 11,
"merchant": {
"id": 11,
"name": "Mr. Ottis Gutmann",
"description": "Rem sint saepe quas voluptatem. Minima quo odio eum rerum iusto adipisci. Modi ad dignissimos ipsam sed et. Voluptas molestiae modi omnis velit id natus. Suscipit pariatur et veritatis est assumenda.",
"merchant_commission": 85,
"logo_path": null,
"is_contracts_complete": 0,
"is_tax_documents_complete": 0,
"sku_prefix": "ucc",
"contact_email": "vandervort.margot@hotmail.com",
"paypal_email": "anderson.betty@gmail.com",
"website_url": null,
"applicant_type": null,
"is_us_citizen": null,
"applicant_name": null,
"created_at": "2024-04-24T10:57:52.000000Z",
"updated_at": "2024-04-24T10:57:52.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/est" \
--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/est"
);
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/est',
[
'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/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/wishlist/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/wishlist/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 (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/7" \
--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/7"
);
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/7',
[
'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/11" \
--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/11"
);
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/11',
[
'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: