MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

SDKs

Software Development Kits (SDKs) allow developers to easily render 3D dice and interact with the API specifications below. We offer SDKs for the following languages:

If you have a particular language you wish to use dddice with, please let us know.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting My Account > Developers and clicking Copy API Key.

You must have an account to use the API.

Theme

API for managing themes.

List Themes

requires authentication

Fetch a list of themes. Only the most recent version of each theme is returned where the "most recent" is determined by SemVer 2.0.0

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/theme" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/theme',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "theme[]",
    "data": [
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "quasi-vel",
            "name": "Miss",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Mollitia cupiditate eum tempora error. Ab deleniti accusantium esse libero consequatur eius molestiae.",
            "user": {
                "username": "dario.kuhlman",
                "uuid": "b6493371-fb40-11ed-ba3e-002248ad6607",
                "name": "Oleta Hodkiewicz",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "fugit-sint",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Tempora cumque sed velit et distinctio accusamus. Voluptatem est est quidem voluptatem. Nam dolorem ipsa eius et. Natus voluptates eius ad nostrum fugiat temporibus repellendus.",
            "user": {
                "username": "zane50",
                "uuid": "b64aa43d-fb40-11ed-ba3e-002248ad6607",
                "name": "Ms. Jolie Considine",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    ]
}
                 

Request      

GET api/1.0/theme

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a Theme

requires authentication

Create a theme using a theme manifest and save to your dddice.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/theme" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "frag_shader=ducimus" \
    --form "manifest={"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}" \
    --form "vert_shader=ut" \
    --form "assets[]=@/tmp/phpFfq0MB" 
const url = new URL(
    "https://dddice.com/api/1.0/theme"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('frag_shader', 'ducimus');
body.append('manifest', '{"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}');
body.append('vert_shader', 'ut');
body.append('assets[]', document.querySelector('input[name="assets[]"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/theme',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'frag_shader',
                'contents' => 'ducimus'
            ],
            [
                'name' => 'manifest',
                'contents' => '{"meshes":{"d4":"/mesh/d04.fbx","d6":"/mesh/d06.fbx","d8":"/mesh/d08.fbx","d10":"/mesh/d10.fbx","d10x":"/mesh/d10.fbx","d12":"/mesh/d12.fbx","d20":"/mesh/d20.fbx"},"available_dice":["d4","d6","d8","d10","d10x","d12","d20"],"physics":{"inertia":{"d4":5,"d6":12,"d8":10,"d10":9,"d10x":9,"d12":8,"d20":6},"weight":{"d4":300,"d6":300,"d8":340,"d10":350,"d10x":350,"d12":350,"d20":400}},"sizes":{"d4":1,"d6":1,"d8":1,"d10":1,"d10x":1,"d12":1,"d20":1},"sounds":[{"src":"/sounds/roll-1.mp3","on":"die.collide"},{"src":"/sounds/roll-2.mp3","on":"die.collide"},{"src":"/sounds/roll-3.mp3","on":"die.collide"}],"uniforms":{"diffuse":{"type":"color","value":{"r":1,"g":0.929,"b":0}},"number":{"type":"color","value":{"r":0.463,"g":0.424,"b":0}}},"values":{"d4":[1,2,3,4],"d6":[1,2,3,4,5,6],"d8":[1,2,3,4,5,6,7,8],"d10":[1,2,3,4,5,6,7,8,9,10],"d12":[1,2,3,4,5,6,7,8,9,10,11,12],"d20":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"d10x":[10,20,30,40,50,60,70,80,90,0]},"id":"delectus_perferendis","version":"1.0.0","api_version":"1.0","name":"Miss","description":"Distinctio esse est dolores sit praesentium laboriosam officiis. Iure qui voluptatibus quidem atque nobis est consectetur enim. Eveniet harum quod quae optio repellat.","label":{"color":"#000000","background_color":"#e3d12d"},"textures":[{"binding":"u_numberMap","src":{"d4":"u_numberMap.png","d6":"u_numberMap.png","d8":"u_numberMap.png","d10":"u_numberMap.png","d12":"u_numberMap.png","d20":"u_numberMap.png","d10x":"u_numberMap_d10x.png"}}],"user":{"username":"ea_est","uuid":"c5de15e0-4337-11ed-abda-0242ac120003","name":"Ms. Demetris Mraz II","created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"},"created_at":"2022-10-03T16:23:55.000000Z","updated_at":"2022-10-03T16:23:55.000000Z"}'
            ],
            [
                'name' => 'vert_shader',
                'contents' => 'ut'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/phpFfq0MB', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://dddice.com/mesh/d04.fbx",
            "d6": "https://dddice.com/mesh/d06.fbx",
            "d8": "https://dddice.com/mesh/d08.fbx",
            "d10": "https://dddice.com/mesh/d10.fbx",
            "d10x": "https://dddice.com/mesh/d10.fbx",
            "d12": "https://dddice.com/mesh/d12.fbx",
            "d20": "https://dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "tenetur-sunt",
        "name": "Dr.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Consequatur aut ipsam reiciendis dolor fugiat voluptas. Impedit in quia eaque voluptatem cum quia in. Enim distinctio nemo natus magni similique et doloremque.",
        "user": {
            "username": "ward.arno",
            "uuid": "b65131de-fb40-11ed-ba3e-002248ad6607",
            "name": "Kenya Von",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "created_at": "2023-05-25T21:11:27.000000Z",
        "updated_at": "2023-05-25T21:11:27.000000Z"
    }
}
                 

Request      

POST api/1.0/theme

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

frag_shader   string  optional  

Custom fragment shader Example: ducimus

manifest   string   

Theme manifest configuration Example: {"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"}

api_version   string   

API compatibility version, always 1.0 for now no-example Example: assumenda

description   string   

Theme description no-example Example: Odio nobis architecto provident eius porro.

id   string   

A unique machine readable id in slug format no-example Example: non

label   labelObject   

The label used in the interface using the manifest.name no-example Example: autem

background_color   string   

Color hex string for label's background color no-example Example: ducimus

color   string   

Color hex string for the label's text no-example Example: dicta

name   string   

Name of the theme no-example Example: impedit

version   string   

Semver 2.0.0 version number no-example Example: explicabo

available_dice   (string|object)[]  optional  

List of dice types available in this theme, if not supplied a standard set of d4, d6, d8, d10, d10x, d12, d20 is assumed, if an array of strings, the string is used for id, type and notation. ex. ["d4", "d6", "d8", "d10", "d10x", "d12", "d20"] or [{"id":"d3", "type":"d6", "notation":"d3"},{"id":"fudge", "type":"d6", "notation":"dF"}] no-example

id   string  optional  

ID used to refer to this die in the rest of the manifest no-example Example: omnis

notation   string  optional  

The abbreviated notation for this dice to display in die equations. ex. d6, dF, d%, d20 no-example Example: et

type   string  optional  

The physical shape of the dice. ex. d4, d6, d8, d10, d10x, d12, d20 no-example Example: et

extend   string  optional  

The id of a theme to use as a base for this theme. Any optional parameters not supplied will inherit their values from this theme Example: ullam

meshes   object  optional  

The file names of the fbx files that describe the meshes; keyed by available_dice ids

sizes   object  optional  

Sizes of each die, 1 is the default size; keyed by available_dice ids

sounds   soundObject[]  optional  

Sounds that play no-example

<something>   any  optional  

Whatever other parameters the roll event supports. ex. value for event die.value. Will play that sound only when that value is rolled.

on   string  optional  

Dice roll event to play the sound on ex. die.collide, die.value no-example Example: et

src   string|object  optional  

Filename of the sound file, or a src object. The src object is keyed by available_dice ids and contains one sound file name per die. Supported types are wav and mp3 no-example Example: debitis

textures   textureObject[]  optional  

Array of textures to be used in the shader no-example

binding   string  optional  

Name of the texture uniform used by the shader. ex. map, bumpMap, u_numberMap no-example Example: sunt

src   string|object  optional  

The file name of the texture, or a src object. The src object is keyed by available_dice ids and contains one texture file name per die no-example Example: officiis

uniforms   object  optional  

Non-texture uniforms to pass to the shader; keyed by the uniform's name

<uniform-name>   object  optional  
max   number  optional  

Max value for float aka "f" uniforms, specifying a min & max value will add a slider to the dice editor for this uniform that slides between min and max, defaulting to value

min   number  optional  

Min value for float aka "f" uniforms, specifying a min & max value will add a slider to the dice editor for this uniform that slides between min and max, defaulting to value

type   string  optional  

The uniforms type. A color can be specified as a hex color string, or as a vector in linear color space. If the type is "color" it will be added to the dice editor for editing. If the color is specified as vec3 or vec4 it will be hidden from the editor. ex. 'f' for float, 'color' for a color, vec3, vec4

value   number|string|object|array  optional  

The value of the uniform. ex. 1.0, "#FF00FF", [0.5,0.3,0.6], {"r":1, "g":0, "b":1}, {"x":0.3, "y":0.2, "z": 0.3}

values   object  optional  

Numerical, textual or image values of the faces of the dice to be shown in roll results; keyed by available_dice ids

<id>   (number|string|object)[]  optional  

The array of dice values, in order, by face number. ex. 1, "crit", {"src":"success.svg"}

vert_shader   string  optional  

Custom vertex shader Example: ut

assets   File[]  optional  

Associated theme assets, filenames must match manifest.json references

Get Theme

requires authentication

Get information about a theme. Returns the latest version.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/theme/dddice-standard" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/theme/dddice-standard',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://dddice.com/mesh/d04.fbx",
            "d6": "https://dddice.com/mesh/d06.fbx",
            "d8": "https://dddice.com/mesh/d08.fbx",
            "d10": "https://dddice.com/mesh/d10.fbx",
            "d10x": "https://dddice.com/mesh/d10.fbx",
            "d12": "https://dddice.com/mesh/d12.fbx",
            "d20": "https://dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "labore-vitae-sed",
        "name": "Prof.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Dolorem facere natus et qui ipsam mollitia. Voluptatibus voluptatum iste hic et voluptatem. A voluptatem sint cumque cupiditate est dolorum commodi quo. Error sint officia id magnam cupiditate rerum.",
        "user": {
            "username": "trobel",
            "uuid": "b653cd9a-fb40-11ed-ba3e-002248ad6607",
            "name": "Ms. Cali Davis",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "created_at": "2023-05-25T21:11:27.000000Z",
        "updated_at": "2023-05-25T21:11:27.000000Z"
    }
}
                 

Request      

GET api/1.0/theme/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

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]
                 

Request      

DELETE api/1.0/theme/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

Get All Theme Versions

requires authentication

List all versions of a given theme.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/theme/dddice-standard/version" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard/version"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/theme/dddice-standard/version',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "theme[]",
    "data": [
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "sunt-in-mollitia",
            "name": "Ms.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Rerum voluptas aut error et. Id eum quo qui repudiandae culpa fugiat. Rerum accusantium dignissimos modi voluptatem.",
            "user": {
                "username": "joannie.goldner",
                "uuid": "b65782df-fb40-11ed-ba3e-002248ad6607",
                "name": "Edmond Erdman",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "laudantium-ex-debitis",
            "name": "Ms.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Et commodi rerum qui laborum et explicabo dolorum. Nihil rerum animi qui consequatur quaerat quisquam et. Doloremque repellat eos eos ullam.",
            "user": {
                "username": "wbalistreri",
                "uuid": "b658d390-fb40-11ed-ba3e-002248ad6607",
                "name": "Prof. Margaret Gerlach",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    ]
}
                 

Request      

GET api/1.0/theme/{id}/version

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

Get a Theme Version

requires authentication

Get a specific version of a given theme.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/theme/dddice-standard/version/1.0.0',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://dddice.com/mesh/d04.fbx",
            "d6": "https://dddice.com/mesh/d06.fbx",
            "d8": "https://dddice.com/mesh/d08.fbx",
            "d10": "https://dddice.com/mesh/d10.fbx",
            "d10x": "https://dddice.com/mesh/d10.fbx",
            "d12": "https://dddice.com/mesh/d12.fbx",
            "d20": "https://dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "quia-et",
        "name": "Mrs.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Minima esse sed dolores. Itaque corrupti soluta at voluptatem error impedit laborum. Explicabo illum quia rem consequatur qui libero voluptates.",
        "user": {
            "username": "mclaughlin.derrick",
            "uuid": "b65c3805-fb40-11ed-ba3e-002248ad6607",
            "name": "Wilfrid Mayer",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "created_at": "2023-05-25T21:11:27.000000Z",
        "updated_at": "2023-05-25T21:11:27.000000Z"
    }
}
                 

Request      

GET api/1.0/theme/{id}/version/{version}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

version   string   

Theme Version. Example: 1.0.0

Delete Theme Version

requires authentication

Delete a specific version of a given theme.

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/theme/dddice-standard/version/ut" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard/version/ut"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/theme/dddice-standard/version/ut',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/theme/{id}/version/{version}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

version   string   

The version. Example: ut

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]
                 

Request      

POST api/1.0/theme/{id}/report

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the theme. Example: dddice-standard

Room

API for managing rooms.

List Rooms

requires authentication

List all rooms created or joined by a user

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/room" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/room',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "room[]",
    "data": [
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "iIsuh9G",
            "passcode": "molestias",
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "user": {
                "username": "reid22",
                "uuid": "b5d49664-fb40-11ed-ba3e-002248ad6607",
                "name": "Adelia Stroman",
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            },
            "participants": [
                {
                    "id": 2,
                    "username": "commodi_quis",
                    "color": "#74fd49",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "kacey.rolfson",
                        "uuid": "b5d50f2b-fb40-11ed-ba3e-002248ad6607",
                        "name": "Nova Rau",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                },
                {
                    "id": 3,
                    "username": "delectus_sunt",
                    "color": "#740a12",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "jessyca77",
                        "uuid": "b5d57f57-fb40-11ed-ba3e-002248ad6607",
                        "name": "Rebeca Frami",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "B6V5mCx",
            "passcode": "sunt",
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "user": {
                "username": "jarod.brakus",
                "uuid": "b5d792a0-fb40-11ed-ba3e-002248ad6607",
                "name": "Billie Brekke",
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            },
            "participants": [
                {
                    "id": 4,
                    "username": "est_aperiam",
                    "color": "#5eb361",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "gpadberg",
                        "uuid": "b5d7e7bb-fb40-11ed-ba3e-002248ad6607",
                        "name": "Guadalupe Smitham Jr.",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                },
                {
                    "id": 5,
                    "username": "dolores_quas",
                    "color": "#7e78d2",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "koch.elza",
                        "uuid": "b5d8452d-fb40-11ed-ba3e-002248ad6607",
                        "name": "Houston Schiller III",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                }
            ]
        }
    ]
}
                 

Request      

GET api/1.0/room

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create a Room

requires authentication

Create a room and use the slug to perform actions in that room.

If is_public is set to false, the returned passcode will be required for future requests to perform actions in this room.

You may optionally pass a valid passcode to generate your own code.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/room" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"is_public\": false,
    \"name\": \"eveniet\",
    \"passcode\": \"eos\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "is_public": false,
    "name": "eveniet",
    "passcode": "eos"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/room',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'is_public' => false,
            'name' => 'eveniet',
            'passcode' => 'eos',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "vV54i_Z",
        "passcode": "ex",
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "ida.waelchi",
            "uuid": "b5dcf2e6-fb40-11ed-ba3e-002248ad6607",
            "name": "Prof. Louisa Larson",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "participants": []
    }
}
                 

Request      

POST api/1.0/room

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

is_public   boolean  optional  

Public or private Example: false

name   string  optional  

Name Example: eveniet

passcode   string  optional  

Passcode required for private rooms Example: eos

Get a Room

requires authentication

Get information about a room and active participants.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/room/unde?passcode=autem" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room/unde"
);

const params = {
    "passcode": "autem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/room/unde',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'passcode' => 'autem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "m1rVtVx",
        "passcode": "autem",
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "maureen.altenwerth",
            "uuid": "b5e0333c-fb40-11ed-ba3e-002248ad6607",
            "name": "Kaylee Ryan",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "participants": []
    }
}
                 

Request      

GET api/1.0/room/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: unde

Query Parameters

passcode   string  optional  

Passcode required for private room Example: autem

Update a Room

requires authentication

Update the name of a room

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/room/aut" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "is_public=" \
    --form "name=ut" \
    --form "passcode=1" \
    --form "custom_slug=lkqmysrv" \
    --form "background=@/tmp/phpCNycNF" 
const url = new URL(
    "https://dddice.com/api/1.0/room/aut"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('is_public', '');
body.append('name', 'ut');
body.append('passcode', '1');
body.append('custom_slug', 'lkqmysrv');
body.append('background', document.querySelector('input[name="background"]').files[0]);

fetch(url, {
    method: "PATCH",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/room/aut',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'is_public',
                'contents' => ''
            ],
            [
                'name' => 'name',
                'contents' => 'ut'
            ],
            [
                'name' => 'passcode',
                'contents' => '1'
            ],
            [
                'name' => 'custom_slug',
                'contents' => 'lkqmysrv'
            ],
            [
                'name' => 'background',
                'contents' => fopen('/tmp/phpCNycNF', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "nCyJZcD",
        "passcode": "alias",
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "nikolas50",
            "uuid": "b5e4d447-fb40-11ed-ba3e-002248ad6607",
            "name": "Jeramie Rempel DVM",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "participants": []
    }
}
                 

Request      

PATCH api/1.0/room/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: aut

Body Parameters

is_public   boolean  optional  

Public or private Example: false

name   string  optional  

Name Example: ut

passcode   boolean  optional  

Passcode required for private rooms Example: true

background   file  optional  

Must be a file. Example: /tmp/phpCNycNF

custom_slug   string  optional  

Must not be greater than 32 characters. Example: lkqmysrv

settings   string  optional  

Delete a Room

requires authentication

Delete a room you own.

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/room/animi" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room/animi"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/room/animi',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/room/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: animi

Update Room Rolls

requires authentication

Automatically pickup dice from the board or unhide dice to players for all rolls in a room and for the current player.

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/room/1/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dice\": {
        \"is_hidden\": true,
        \"is_visible\": false,
        \"is_cleared\": false
    }
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/1/roll"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "dice": {
        "is_hidden": true,
        "is_visible": false,
        "is_cleared": false
    }
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/room/1/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'dice' => [
                'is_hidden' => true,
                'is_visible' => false,
                'is_cleared' => false,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "user": {
                "username": "umarvin",
                "uuid": "b5e943c6-fb40-11ed-ba3e-002248ad6607",
                "name": "Johnson Zieme",
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "ea",
                "slug": "_jGbVMZ",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 9,
                        "username": "sed_cupiditate",
                        "color": "#663e8e",
                        "position": 0,
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z",
                        "user": {
                            "username": "funk.kitty",
                            "uuid": "b5ea5407-fb40-11ed-ba3e-002248ad6607",
                            "name": "Rafael Herzog",
                            "created_at": "2023-05-25T21:11:26.000000Z",
                            "updated_at": "2023-05-25T21:11:26.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "b5eb8129-fb40-11ed-ba3e-002248ad6607",
                    "is_hidden": false,
                    "is_user_value": true,
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 4,
                    "value_to_display": "4",
                    "type": "d6",
                    "label": null,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z"
                }
            ],
            "total_value": 4,
            "equation": "1d6",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "user": {
                "username": "gunnar77",
                "uuid": "b5ed2485-fb40-11ed-ba3e-002248ad6607",
                "name": "Mortimer Blanda",
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sint",
                "slug": "p67okKw",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 10,
                        "username": "quo_sed",
                        "color": "#069ffb",
                        "position": 0,
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z",
                        "user": {
                            "username": "bchamplin",
                            "uuid": "b5ee207c-fb40-11ed-ba3e-002248ad6607",
                            "name": "Albin Bayer I",
                            "created_at": "2023-05-25T21:11:26.000000Z",
                            "updated_at": "2023-05-25T21:11:26.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "b5eef864-fb40-11ed-ba3e-002248ad6607",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 4,
                    "value_to_display": "4",
                    "type": "d8",
                    "label": null,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z"
                }
            ],
            "total_value": 4,
            "equation": "1d8",
            "external_id": null,
            "participants": []
        }
    ]
}
                 

Request      

PATCH api/1.0/room/{slug}/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   integer   

The slug of the room. Example: 1

Body Parameters

dice   object   

Partial dice roll.

is_visible   boolean  optional  

Roll value hidden Example: false

is_cleared   boolean  optional  

Roll value cleared Example: false

Join a Room

requires authentication

Join a room as a participant

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/room/unde/participant" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"passcode\": \"perspiciatis\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/unde/participant"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "passcode": "perspiciatis"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/room/unde/participant',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'passcode' => 'perspiciatis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "Qm-bQI6",
        "passcode": "itaque",
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "runolfsdottir.alfredo",
            "uuid": "b5f3c780-fb40-11ed-ba3e-002248ad6607",
            "name": "Nyah Zieme",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "participants": []
    }
}
                 

Request      

POST api/1.0/room/{slug}/participant

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: unde

Body Parameters

passcode   string  optional  

Passcode required for private room Example: perspiciatis

Update a Participant

requires authentication

Update the username or color of the room participant.

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/room/consequatur/participant/occaecati" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"passcode\": \"vel\",
    \"username\": \"labore\",
    \"color\": \"#FF0000\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/consequatur/participant/occaecati"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "passcode": "vel",
    "username": "labore",
    "color": "#FF0000"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/room/consequatur/participant/occaecati',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'passcode' => 'vel',
            'username' => 'labore',
            'color' => '#FF0000',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "2hnboqk",
        "passcode": "rerum",
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "marcel.krajcik",
            "uuid": "b5f7c428-fb40-11ed-ba3e-002248ad6607",
            "name": "Milford Shanahan",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "participants": []
    }
}
                 

Request      

PATCH api/1.0/room/{slug}/participant/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: consequatur

id   string   

Participant ID Example: occaecati

Body Parameters

passcode   string  optional  

Passcode required for private room Example: vel

username   string  optional  

Update a participant's username Example: labore

color   string  optional  

Update a participant's color. Example: #FF0000

Leave a Room

requires authentication

Remove a participant from a room. Participants can choose to leave a room using this endpoint. Room owners have permission to remove any participant.

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/room/minima/participant/distinctio" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room/minima/participant/distinctio"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/room/minima/participant/distinctio',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/room/{slug}/participant/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the room. Example: minima

id   string   

The ID of the participant. Example: distinctio

Roll

API for creating and managing dice rolls.

Create a Roll

requires authentication

Perform a dice roll and optionally send the result to a public or private room.

Dice roll values are calculated using the API but can optionally receive a value and/or value_to_display attribute to pass a predetermined value (i.e. when integrating with VTTs).

Operators Operators allow one to manipulate the outcome of the dice roll. The syntax of operators is based on Avrae which implements d20 dice syntax.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dice\": [
        {
            \"type\": \"d20\",
            \"theme\": \"dddice-red\"
        },
        {
            \"type\": \"d20\",
            \"theme\": \"dddice-red\"
        }
    ],
    \"external_id\": \"quisquam\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"p\": \"omnis\",
        \"rr\": \"possimus\",
        \"ro\": \"omnis\",
        \"ra\": \"fugiat\",
        \"e\": \"voluptates\",
        \"mi\": 4512.723,
        \"ma\": 152.89973
    },
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        113890291.3765418
    ],
    \"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "dice": [
        {
            "type": "d20",
            "theme": "dddice-red"
        },
        {
            "type": "d20",
            "theme": "dddice-red"
        }
    ],
    "external_id": "quisquam",
    "operator": {
        "k": "\"h2\"",
        "p": "omnis",
        "rr": "possimus",
        "ro": "omnis",
        "ra": "fugiat",
        "e": "voluptates",
        "mi": 4512.723,
        "ma": 152.89973
    },
    "room": "HvvOlTl",
    "whisper": [
        113890291.3765418
    ],
    "label": "\"Longbow damage with Hunter's Mark\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
                clone $p['stdClass'],
            ],
            null,
            [
                'stdClass' => [
                    'type' => [
                        'd20',
                        'd20',
                    ],
                    'theme' => [
                        'dddice-red',
                        'dddice-red',
                    ],
                ],
            ],
            [
                'dice' => [
                    $o[0],
                    $o[1],
                ],
                'external_id' => 'quisquam',
                'operator' => [
                    'k' => '"h2"',
                    'p' => 'omnis',
                    'rr' => 'possimus',
                    'ro' => 'omnis',
                    'ra' => 'fugiat',
                    'e' => 'voluptates',
                    'mi' => 4512.723,
                    'ma' => 152.89973,
                ],
                'room' => 'HvvOlTl',
                'whisper' => [
                    113890291.3765418,
                ],
                'label' => '"Longbow damage with Hunter\'s Mark"',
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "welch.hailee",
            "uuid": "b602951d-fb40-11ed-ba3e-002248ad6607",
            "name": "Prof. Destany Hahn V",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "dolorem",
            "slug": "PgjWOGs",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "autoClear": 10,
                    "diceSize": 1,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 13,
                    "username": "delectus_sapiente",
                    "color": "#a3cb51",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "lyla.reynolds",
                        "uuid": "b6040344-fb40-11ed-ba3e-002248ad6607",
                        "name": "Dr. Jonathon Stehr",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "b604e2e5-fb40-11ed-ba3e-002248ad6607",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": false,
                "is_cleared": false,
                "is_dropped": false,
                "value": 7,
                "value_to_display": "7",
                "type": "d8",
                "label": null,
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            }
        ],
        "total_value": 7,
        "equation": "1d8",
        "external_id": null,
        "participants": []
    }
}
                 

Request      

POST api/1.0/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

dice   object[]   

List of dice rolls.

is_hidden   boolean  optional  

Example: true

theme   string   

Theme ID Example: atque

type   string   

Type of dice. Standard types are d20, d12, d10, d10x, d8, d6, and d4. Some themes have custom types and should be looked up in the available_themes Example: velit

label   string  optional  

A human-readable string to label this dice of the roll with some meaning (ex fire damage vs slashing damage) Example: similique

value   number  optional  

Dice value. If no value is provided, dddice will generate a value using our balanced random number generator. Example: 265369.27829513

value_to_display   string|object  optional  

This can be used to replace the numeric value. This is useful in cases where a d20 might contain letters instead of numbers or if a player is speaking in tongues or hieroglyphs. Example: et

external_id   string  optional  

An ID for this roll generated by an external system. Example: quisquam

operator   object  optional  

Optional operators to manipulate the final value of the dice

k   string  optional  

Keep all matched values. Example: "h2"

p   string  optional  

Drop all matched values (Not yet implemented) Example: omnis

rr   string  optional  

Reroll all matched values until none match (Not yet implemented) Example: possimus

ro   string  optional  

Reroll all matched values once (Not yet implemented) Example: omnis

ra   string  optional  

Reroll up to one matched value once, keeping the original roll (Not yet implemented) Example: fugiat

e   string  optional  

Explode, rolls another die for each matched value (Not yet implemented) Example: voluptates

mi   number  optional  

Set a minimum value for each die (Not yet implemented) Example: 4512.723

ma   number  optional  

Set a maximum value for each die (Not yet implemented) Example: 152.89973

room   string  optional  

Room slug. Example: HvvOlTl

whisper   number[]  optional  

Participant IDs to whisper this roll to. Only participants specified will see this roll.

label   string  optional  

Optional label for this roll. Example: "Longbow damage with Hunter's Mark"

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)

equation   string   

d20 dice syntax equation

total_value   number   

Sum of all roll value totals

created_at   string   

Created timestamp

updated_at   string   

Updated timestamp

Get a Roll

requires authentication

Fetch roll information including the user and optional room information

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/roll/nesciunt" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/roll/nesciunt"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/roll/nesciunt',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-05-25T21:11:26.000000Z",
        "created_at": "2023-05-25T21:11:26.000000Z",
        "user": {
            "username": "elfrieda.wuckert",
            "uuid": "b6089479-fb40-11ed-ba3e-002248ad6607",
            "name": "Fleta Rath",
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "facere",
            "slug": "oU2B_Ga",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "autoClear": 10,
                    "diceSize": 1,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-05-25T21:11:26.000000Z",
            "updated_at": "2023-05-25T21:11:26.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 14,
                    "username": "sint_fugit",
                    "color": "#db18fc",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:26.000000Z",
                    "updated_at": "2023-05-25T21:11:26.000000Z",
                    "user": {
                        "username": "charlotte15",
                        "uuid": "b6099a3a-fb40-11ed-ba3e-002248ad6607",
                        "name": "Ryann Pouros",
                        "created_at": "2023-05-25T21:11:26.000000Z",
                        "updated_at": "2023-05-25T21:11:26.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "b619825a-fb40-11ed-ba3e-002248ad6607",
                "is_hidden": false,
                "is_user_value": true,
                "is_visible": false,
                "is_cleared": false,
                "is_dropped": false,
                "value": 6,
                "value_to_display": "6",
                "type": "d8",
                "label": null,
                "created_at": "2023-05-25T21:11:26.000000Z",
                "updated_at": "2023-05-25T21:11:26.000000Z"
            }
        ],
        "total_value": 6,
        "equation": "1d8",
        "external_id": null,
        "participants": []
    }
}
                 

Request      

GET api/1.0/roll/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

Roll ID Example: nesciunt

Update a Roll

requires authentication

Pickup dice from the board or unhide dice to players

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/roll/voluptatem" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"room\": \"doloribus\",
    \"dice\": [
        {
            \"uuid\": \"1\",
            \"is_hidden\": true
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll/voluptatem"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "room": "doloribus",
    "dice": [
        {
            "uuid": "1",
            "is_hidden": true
        }
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/roll/voluptatem',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'uuid' => [
                        '1',
                    ],
                    'is_hidden' => [
                        true,
                    ],
                ],
            ],
            [
                'room' => 'doloribus',
                'dice' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "user": {
            "username": "julia74",
            "uuid": "b61d7e0f-fb40-11ed-ba3e-002248ad6607",
            "name": "Prof. Kellen Bogisich",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "quis",
            "slug": "duAdWow",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "autoClear": 10,
                    "diceSize": 1,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 15,
                    "username": "ratione_voluptatum",
                    "color": "#07c265",
                    "position": 0,
                    "created_at": "2023-05-25T21:11:27.000000Z",
                    "updated_at": "2023-05-25T21:11:27.000000Z",
                    "user": {
                        "username": "hubert.lynch",
                        "uuid": "b61e9a04-fb40-11ed-ba3e-002248ad6607",
                        "name": "Gerard Mosciski",
                        "created_at": "2023-05-25T21:11:27.000000Z",
                        "updated_at": "2023-05-25T21:11:27.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "b61f73ee-fb40-11ed-ba3e-002248ad6607",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 10,
                "value_to_display": "10",
                "type": "d12",
                "label": null,
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            }
        ],
        "total_value": 10,
        "equation": "1d12",
        "external_id": null,
        "participants": []
    }
}
                 

Request      

PATCH api/1.0/roll/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

Roll ID Example: voluptatem

Body Parameters

room   string  optional  

Example: doloribus

dice   object[]   

List of partial dice rolls.

uuid   string  optional  

Example: d0a121fe-522a-36f0-831f-2a516d99998a

is_visible   boolean  optional  

Roll value hidden Example: false

is_cleared   boolean  optional  

Roll value cleared Example: false

Response

Response Fields

uuid   string   

The ID of the roll

direction   number   

The angle the roll was thrown (in degrees)

velocity   number   

How hard the roll was thrown

user   object   

User Object

room   object   

Room Object

values   object[]   

Roll Value Objects

total_value   number   

Sum of all roll value totals

created_at   string   

Created timestamp

updated_at   string   

Updated timestamp

Bulk Update Rolls

requires authentication

Pickup dice from the board or unhide dice to players for multiple rolls.

Accepts an array of objects with the the same parameters as PATCH /api/1.0/roll/{id}.

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"rolls\": [
        {
            \"dice\": [
                {
                    \"uuid\": \"1b23850e-d700-35ab-841b-4ca3fbde86e9\",
                    \"is_visible\": false,
                    \"is_cleared\": true
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "rolls": [
        {
            "dice": [
                {
                    "uuid": "1b23850e-d700-35ab-841b-4ca3fbde86e9",
                    "is_visible": false,
                    "is_cleared": true
                }
            ]
        }
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'rolls' => [
                [
                    'dice' => [
                        [
                            'uuid' => '1b23850e-d700-35ab-841b-4ca3fbde86e9',
                            'is_visible' => false,
                            'is_cleared' => true,
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-05-25T21:11:27.000000Z",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "user": {
                "username": "mueller.evelyn",
                "uuid": "b623bc95-fb40-11ed-ba3e-002248ad6607",
                "name": "America Jenkins",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "amet",
                "slug": "Ucev_ch",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 16,
                        "username": "aliquid_asperiores",
                        "color": "#983872",
                        "position": 0,
                        "created_at": "2023-05-25T21:11:27.000000Z",
                        "updated_at": "2023-05-25T21:11:27.000000Z",
                        "user": {
                            "username": "scummerata",
                            "uuid": "b624ce22-fb40-11ed-ba3e-002248ad6607",
                            "name": "Alize Dach MD",
                            "created_at": "2023-05-25T21:11:27.000000Z",
                            "updated_at": "2023-05-25T21:11:27.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "b625a719-fb40-11ed-ba3e-002248ad6607",
                    "is_hidden": true,
                    "is_user_value": true,
                    "is_visible": true,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d10",
                    "label": null,
                    "created_at": "2023-05-25T21:11:27.000000Z",
                    "updated_at": "2023-05-25T21:11:27.000000Z"
                }
            ],
            "total_value": 2,
            "equation": "1d10",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-05-25T21:11:27.000000Z",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "user": {
                "username": "vvolkman",
                "uuid": "b6273060-fb40-11ed-ba3e-002248ad6607",
                "name": "Myah McClure",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "numquam",
                "slug": "jGk46RH",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 17,
                        "username": "ab_occaecati",
                        "color": "#356e9f",
                        "position": 0,
                        "created_at": "2023-05-25T21:11:27.000000Z",
                        "updated_at": "2023-05-25T21:11:27.000000Z",
                        "user": {
                            "username": "ydenesik",
                            "uuid": "b6280dd1-fb40-11ed-ba3e-002248ad6607",
                            "name": "Ora Kling",
                            "created_at": "2023-05-25T21:11:27.000000Z",
                            "updated_at": "2023-05-25T21:11:27.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "b628ed4d-fb40-11ed-ba3e-002248ad6607",
                    "is_hidden": true,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 3,
                    "value_to_display": "3",
                    "type": "d4",
                    "label": null,
                    "created_at": "2023-05-25T21:11:27.000000Z",
                    "updated_at": "2023-05-25T21:11:27.000000Z"
                }
            ],
            "total_value": 3,
            "equation": "1d4",
            "external_id": null,
            "participants": []
        }
    ]
}
                 

Request      

PATCH api/1.0/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

rolls   object[]   

List of rolls.

uuid   required  optional  

Roll ID Example: c6ccb373-f22f-341d-b177-33b139b155ad

dice   object[]   

List of partial dice rolls.

is_visible   boolean  optional  

Roll value hidden Example: true

is_cleared   boolean  optional  

Roll value cleared Example: false

room   string  optional  

Example: unde

Share Dice

API for managing share requests.

List Share Requests

requires authentication

Fetch a list of active and inactive share requests.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/share" \
    --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/share"
);

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/share',
    [
        '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": "share[]",
    "data": [
        {
            "limit": 5,
            "expires_at": "2023-05-25T21:11:27.000000Z",
            "uuid": "c35d7df7-4f8b-37dc-89ac-dd0a3e3c7aaf",
            "updated_at": "2023-05-25T21:11:27.000000Z",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "user": {
                "username": "xokuneva",
                "uuid": "b62d0958-fb40-11ed-ba3e-002248ad6607",
                "name": "Marina Spencer",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "theme": {
                "slug": "tempore-esse-cumque",
                "is_available": true,
                "is_banned": false,
                "is_extendable": true,
                "is_discoverable": true,
                "name": "Mr.",
                "description": "Ea laboriosam magnam reiciendis minima facere dolorem amet. Accusantium et maxime ut asperiores perferendis sunt sit. Ex ab reprehenderit recusandae dolores reiciendis. Exercitationem quas ab fugiat autem neque.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            }
        },
        {
            "limit": 5,
            "expires_at": "2023-05-25T21:11:27.000000Z",
            "uuid": "5da82233-f51f-3328-9b2a-082313141175",
            "updated_at": "2023-05-25T21:11:27.000000Z",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "user": {
                "username": "zjenkins",
                "uuid": "b62e95be-fb40-11ed-ba3e-002248ad6607",
                "name": "Edgardo Ebert",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "theme": {
                "slug": "ut-iusto",
                "is_available": true,
                "is_banned": false,
                "is_extendable": true,
                "is_discoverable": true,
                "name": "Ms.",
                "description": "Aut ut eum esse tenetur. Eos ipsa accusantium incidunt officiis repellat fuga earum. Quia odit nemo quis iste praesentium. Atque culpa eum pariatur architecto. A possimus est sint sit.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            }
        }
    ]
}
                 

Request      

GET api/1.0/share

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create Share Request

requires authentication

Create a share request for a given theme.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/share" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"dddice-standard\",
    \"limit\": 20,
    \"expires_at\": \"non\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/share"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "dddice-standard",
    "limit": 20,
    "expires_at": "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/share',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'slug' => 'dddice-standard',
            'limit' => 20,
            'expires_at' => 'non',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2023-05-25T21:11:27.000000Z",
        "uuid": "02b69cdf-44b6-338e-a1a2-ad6c6cf6d65c",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "user": {
            "username": "warren.murray",
            "uuid": "b6317402-fb40-11ed-ba3e-002248ad6607",
            "name": "Zelma Kunze",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "theme": {
            "slug": "molestias-reiciendis",
            "is_available": true,
            "is_banned": false,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Mr.",
            "description": "Veritatis beatae exercitationem neque dolores nesciunt qui libero provident. Non sit at sunt non. Libero officia labore non aperiam ab quibusdam beatae et.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    }
}
                 

Request      

POST api/1.0/share

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

slug   string   

Theme slug. Example: dddice-standard

limit   integer  optional  

Number of times this share request can be accepted Example: 20

expires_at   string  optional  

Expiration date or datetime Example: non

Get Share Request

requires authentication

Get information about a share request.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/share/voluptatem" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/share/voluptatem"
);

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/share/voluptatem',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2023-05-25T21:11:27.000000Z",
        "uuid": "2ec30b8a-6648-3344-a789-5494323a4f7f",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "user": {
            "username": "vsenger",
            "uuid": "b633c5c8-fb40-11ed-ba3e-002248ad6607",
            "name": "Austen Becker",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "theme": {
            "slug": "saepe-est-est",
            "is_available": true,
            "is_banned": false,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Prof.",
            "description": "Nostrum qui voluptas quae sint. Voluptas doloremque et asperiores quasi est et. Sapiente in est ut fugiat earum officia.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    }
}
                 

Request      

GET api/1.0/share/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the share request Example: voluptatem

Update Share Request

requires authentication

Update information about a share request.

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/share/nobis" \
    --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/share/nobis"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/share/nobis',
    [
        '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": {
        "limit": 5,
        "expires_at": "2023-05-25T21:11:27.000000Z",
        "uuid": "575dd592-6772-346b-ab37-20060eb57737",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "user": {
            "username": "tgrant",
            "uuid": "b6360fb2-fb40-11ed-ba3e-002248ad6607",
            "name": "Torey Boehm",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "theme": {
            "slug": "quae-velit-fugiat",
            "is_available": true,
            "is_banned": false,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Prof.",
            "description": "Nulla qui repudiandae ratione qui tempore neque. Modi architecto dolores est minus autem soluta ab eligendi. Eveniet corporis laborum aperiam dolore suscipit aspernatur quae.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    }
}
                 

Request      

PATCH api/1.0/share/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the share request Example: nobis

Delete Share Request

requires authentication

Delete a share request which will invalidate any shared URLs

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/share/rerum" \
    --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/share/rerum"
);

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/share/rerum',
    [
        '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]
                 

Request      

DELETE api/1.0/share/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the share request Example: rerum

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.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/share/at" \
    --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/share/at"
);

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/share/at',
    [
        '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": {
        "limit": 5,
        "expires_at": "2023-05-25T21:11:27.000000Z",
        "uuid": "5e2fae0b-4a43-3a47-b30e-0851b5d03162",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "user": {
            "username": "langosh.marlen",
            "uuid": "b6392e5b-fb40-11ed-ba3e-002248ad6607",
            "name": "Ms. Lydia Nolan",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "theme": {
            "slug": "autem-laboriosam",
            "is_available": true,
            "is_banned": false,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Dr.",
            "description": "Consectetur aliquid deleniti quibusdam. Maxime saepe magnam officia maxime eum cumque. Veniam et quia similique itaque minus.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    }
}
                 

Request      

POST api/1.0/share/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the share request Example: at

User

API for managing users.

Get Authenticated User

requires authentication

Get the current authenticated user.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/user" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/user"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/user',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "user",
    "data": {
        "name": "Daisha Robel",
        "username": "ebony.corkery",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "vel",
                "slug": "kqvn8RB",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z",
                "deleted_at": null
            }
        ]
    }
}
                 

Request      

GET api/1.0/user

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Create Guest User

Create a guest user to communicate with other API endpoints. Returns a token that can be used to fetch a user.

This route is rate-limited to 1 account/24-hour.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/user',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "type": "user",
    "data": {
        "name": "Kelsie McGlynn MD",
        "username": "blick.keon",
        "updated_at": "2023-05-25T21:11:27.000000Z",
        "created_at": "2023-05-25T21:11:27.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "laborum",
                "slug": "qL51pi3",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "autoClear": 10,
                        "diceSize": 1,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z",
                "deleted_at": null
            }
        ]
    }
}
                 

Request      

POST api/1.0/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Create API Token

requires authentication

Returns a new API token for the authenticated user.

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/user/token" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"et\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/user/token"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "et"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/user/token',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'et',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "type": "token",
    "data": "<your-new-api-token>"
}
                 

Request      

POST api/1.0/user/token

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string  optional  

Example: et

Delete API Key

requires authentication

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/user/token/quis" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/user/token/quis"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/user/token/quis',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/user/token/{token}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

token   string   

Token Example: quis

Dice Box

API for managing themes in your Digital Dice Box.

List Dice Box Collection

requires authentication

Fetch a list of all dice in your Digital Dice Box.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/dice-box?filter=officiis&ids=nobis" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"limit\": 2809781,
    \"filter\": \"omnis\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box"
);

const params = {
    "filter": "officiis",
    "ids": "nobis",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "limit": 2809781,
    "filter": "omnis"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/dice-box',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter' => 'officiis',
            'ids' => 'nobis',
        ],
        'json' => [
            'limit' => 2809781.0,
            'filter' => 'omnis',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "theme[]",
    "data": [
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "similique-distinctio-occaecati",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Et quas harum nostrum. Quia ea consequatur quia earum itaque enim. Consectetur ad quam ad repellendus consequatur quo provident.",
            "user": {
                "username": "altenwerth.sylvia",
                "uuid": "b63c4d10-fb40-11ed-ba3e-002248ad6607",
                "name": "Mr. Clifton Yost",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        {
            "meshes": {
                "d4": "https://dddice.com/mesh/d04.fbx",
                "d6": "https://dddice.com/mesh/d06.fbx",
                "d8": "https://dddice.com/mesh/d08.fbx",
                "d10": "https://dddice.com/mesh/d10.fbx",
                "d10x": "https://dddice.com/mesh/d10.fbx",
                "d12": "https://dddice.com/mesh/d12.fbx",
                "d20": "https://dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "mollitia-vitae",
            "name": "Miss",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Dolorum itaque suscipit qui. Hic rem voluptates aliquid voluptas dolorem. Quaerat labore eius assumenda magnam quia necessitatibus ut fugit.",
            "user": {
                "username": "mhagenes",
                "uuid": "b63de4b6-fb40-11ed-ba3e-002248ad6607",
                "name": "Dereck Wolf",
                "created_at": "2023-05-25T21:11:27.000000Z",
                "updated_at": "2023-05-25T21:11:27.000000Z"
            },
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        }
    ]
}
                 

Request      

GET api/1.0/dice-box

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

filter   string  optional  

Filter themes by name Example: officiis

ids   string  optional  

Comma seperated list of themes IDs to get Example: nobis

Body Parameters

limit   number  optional  

Example: 2809781

filter   string  optional  

Example: omnis

Get Dice Box Theme

requires authentication

Get information about a theme in your Digital Dice Box.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/dice-box/fugiat" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/fugiat"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/dice-box/fugiat',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://dddice.com/mesh/d04.fbx",
            "d6": "https://dddice.com/mesh/d06.fbx",
            "d8": "https://dddice.com/mesh/d08.fbx",
            "d10": "https://dddice.com/mesh/d10.fbx",
            "d10x": "https://dddice.com/mesh/d10.fbx",
            "d12": "https://dddice.com/mesh/d12.fbx",
            "d20": "https://dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "alias-aliquid",
        "name": "Prof.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Sed rerum eum ullam saepe non tenetur. Facere ex neque eligendi tenetur quod aut.",
        "user": {
            "username": "sierra06",
            "uuid": "b6418269-fb40-11ed-ba3e-002248ad6607",
            "name": "Maurine Casper",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "created_at": "2023-05-25T21:11:27.000000Z",
        "updated_at": "2023-05-25T21:11:27.000000Z"
    }
}
                 

Request      

GET api/1.0/dice-box/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the dice box. Example: fugiat

id   string   

The ID of the theme. Example: dddice-standard

Update Dice Box Theme

requires authentication

Upgrade theme version in your Digital Dice Box.

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/dice-box/possimus" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/possimus"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/dice-box/possimus',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://dddice.com/mesh/d04.fbx",
            "d6": "https://dddice.com/mesh/d06.fbx",
            "d8": "https://dddice.com/mesh/d08.fbx",
            "d10": "https://dddice.com/mesh/d10.fbx",
            "d10x": "https://dddice.com/mesh/d10.fbx",
            "d12": "https://dddice.com/mesh/d12.fbx",
            "d20": "https://dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "debitis-omnis",
        "name": "Dr.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Explicabo quae ut neque esse porro. Esse eligendi consectetur aliquid tempore. Sit occaecati enim officiis aliquam laborum magni vel. Et voluptatum voluptas ut et. Et voluptates delectus assumenda voluptatem sequi.",
        "user": {
            "username": "cmertz",
            "uuid": "b643f38a-fb40-11ed-ba3e-002248ad6607",
            "name": "Leta Predovic III",
            "created_at": "2023-05-25T21:11:27.000000Z",
            "updated_at": "2023-05-25T21:11:27.000000Z"
        },
        "created_at": "2023-05-25T21:11:27.000000Z",
        "updated_at": "2023-05-25T21:11:27.000000Z"
    }
}
                 

Request      

PATCH api/1.0/dice-box/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the dice box. Example: possimus

id   string   

The ID of the theme. Example: dddice-standard

Delete Dice Box Theme

requires authentication

Delete a share request which will invalidate any shared URLs

Example request:
curl --request DELETE \
    "https://dddice.com/api/1.0/dice-box/quia" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/quia"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/dice-box/quia',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/dice-box/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the dice box. Example: quia

id   string   

The ID of the theme. Example: dddice-standard