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://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "odio-ex-quis",
            "name": "Miss",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Consequatur inventore perspiciatis ducimus suscipit assumenda. Doloribus doloribus voluptatibus fugit hic libero harum. Modi officia facilis aut impedit molestiae.",
            "user": {
                "username": "emmerich.taya",
                "uuid": "334a6222-6054-11ee-8c15-000d3a9285ca",
                "name": "Edwin Weimann",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        {
            "meshes": {
                "d4": "https://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "quod-nihil",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Quia sit atque nemo quo pariatur provident natus porro. Dolore incidunt ut doloremque. Deleniti vero quo recusandae ipsa odio assumenda. Excepturi et harum voluptas amet molestias velit cumque. Qui eaque beatae tempora repellat quam dolorem est ut.",
            "user": {
                "username": "janie23",
                "uuid": "334bc5c9-6054-11ee-8c15-000d3a9285ca",
                "name": "Antonina Predovic IV",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        }
    ]
}
                 

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

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

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

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

Example response (201):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://cdn.dddice.com/mesh/d04.fbx",
            "d6": "https://cdn.dddice.com/mesh/d06.fbx",
            "d8": "https://cdn.dddice.com/mesh/d08.fbx",
            "d10": "https://cdn.dddice.com/mesh/d10.fbx",
            "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
            "d12": "https://cdn.dddice.com/mesh/d12.fbx",
            "d20": "https://cdn.dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "qui-modi",
        "name": "Dr.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Non sint nulla velit sunt impedit sit. Sit consequuntur natus quod facere iste repellat. Error minus et atque quas blanditiis.",
        "user": {
            "username": "tianna.borer",
            "uuid": "33530ba6-6054-11ee-8c15-000d3a9285ca",
            "name": "Emmy Crooks II",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "created_at": "2023-10-01T12:15:24.000000Z",
        "updated_at": "2023-10-01T12:15:24.000000Z"
    }
}
                 

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: optio

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: ut

description   string   

Theme description no-example Example: Quo pariatur ab maiores odit.

id   string   

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

label   labelObject   

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

background_color   string   

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

color   string   

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

name   string   

Name of the theme no-example Example: accusamus

version   string   

Semver 2.0.0 version number no-example Example: voluptatum

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: voluptate

notation   string  optional  

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

type   string  optional  

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

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: dolores

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: hic

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: ut

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: est

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: quo

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: fugiat

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://cdn.dddice.com/mesh/d04.fbx",
            "d6": "https://cdn.dddice.com/mesh/d06.fbx",
            "d8": "https://cdn.dddice.com/mesh/d08.fbx",
            "d10": "https://cdn.dddice.com/mesh/d10.fbx",
            "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
            "d12": "https://cdn.dddice.com/mesh/d12.fbx",
            "d20": "https://cdn.dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "quidem-et-quo",
        "name": "Dr.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Iusto ut doloribus est in culpa laborum voluptate officia. Quia quia minus sed similique placeat perspiciatis. Nostrum itaque veritatis voluptate aut. Deserunt repudiandae autem magnam corporis consequatur inventore. Et aut neque a est modi.",
        "user": {
            "username": "alisa24",
            "uuid": "33561b63-6054-11ee-8c15-000d3a9285ca",
            "name": "Magnolia Schinner",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "created_at": "2023-10-01T12:15:24.000000Z",
        "updated_at": "2023-10-01T12:15:24.000000Z"
    }
}
                 

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://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "sunt-libero-libero",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Deserunt in sit minima dolorem harum aut rem. Consequatur porro maiores perspiciatis iste. Qui repellendus eos placeat ratione itaque porro quia.",
            "user": {
                "username": "lane.hermiston",
                "uuid": "335a009b-6054-11ee-8c15-000d3a9285ca",
                "name": "Kristy Will",
                "created_at": "2023-10-01T12:15:25.000000Z",
                "updated_at": "2023-10-01T12:15:25.000000Z"
            },
            "created_at": "2023-10-01T12:15:25.000000Z",
            "updated_at": "2023-10-01T12:15:25.000000Z"
        },
        {
            "meshes": {
                "d4": "https://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "eius-officiis",
            "name": "Miss",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Consequatur voluptatem sit quo qui veritatis. Culpa et veritatis rerum iste. Ut similique cum eum debitis.",
            "user": {
                "username": "beau25",
                "uuid": "335b6674-6054-11ee-8c15-000d3a9285ca",
                "name": "Karlee Cremin",
                "created_at": "2023-10-01T12:15:25.000000Z",
                "updated_at": "2023-10-01T12:15:25.000000Z"
            },
            "created_at": "2023-10-01T12:15:25.000000Z",
            "updated_at": "2023-10-01T12:15:25.000000Z"
        }
    ]
}
                 

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://cdn.dddice.com/mesh/d04.fbx",
            "d6": "https://cdn.dddice.com/mesh/d06.fbx",
            "d8": "https://cdn.dddice.com/mesh/d08.fbx",
            "d10": "https://cdn.dddice.com/mesh/d10.fbx",
            "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
            "d12": "https://cdn.dddice.com/mesh/d12.fbx",
            "d20": "https://cdn.dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "minima-non-iure",
        "name": "Prof.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Non fugiat nesciunt quidem qui et ducimus est. Amet voluptas dolorem beatae temporibus voluptatem voluptas voluptatem. Id ipsa itaque ea debitis non maxime blanditiis occaecati. Excepturi omnis minus qui aut quaerat nihil fugit.",
        "user": {
            "username": "melyna05",
            "uuid": "335ed64a-6054-11ee-8c15-000d3a9285ca",
            "name": "Mr. Griffin Lang Sr.",
            "created_at": "2023-10-01T12:15:25.000000Z",
            "updated_at": "2023-10-01T12:15:25.000000Z"
        },
        "created_at": "2023-10-01T12:15:25.000000Z",
        "updated_at": "2023-10-01T12:15:25.000000Z"
    }
}
                 

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/perferendis" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard/version/perferendis"
);

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

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

Example response (204):

                    [Empty response]
                 

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: perferendis

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": "oxESC0q",
            "passcode": "at",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "dee.little",
                "uuid": "32d3ce04-6054-11ee-8c15-000d3a9285ca",
                "name": "Mrs. Yvonne Kub",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "participants": [
                {
                    "id": 2,
                    "username": "voluptatum_optio",
                    "color": "#d9f3d4",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "era69",
                        "uuid": "32d445de-6054-11ee-8c15-000d3a9285ca",
                        "name": "Derick Watsica V",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                },
                {
                    "id": 3,
                    "username": "beatae_et",
                    "color": "#e15f1b",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "gerhold.jaylan",
                        "uuid": "32d4cd1e-6054-11ee-8c15-000d3a9285ca",
                        "name": "Prof. Madilyn Collier",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "Yqnjb9b",
            "passcode": "voluptatem",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "armstrong.clara",
                "uuid": "32d6d9d9-6054-11ee-8c15-000d3a9285ca",
                "name": "Hillard Gerlach",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "participants": [
                {
                    "id": 4,
                    "username": "quod_qui",
                    "color": "#5a985a",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "titus.lesch",
                        "uuid": "32d7326a-6054-11ee-8c15-000d3a9285ca",
                        "name": "Vance Walter",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                },
                {
                    "id": 5,
                    "username": "id_cupiditate",
                    "color": "#1eef10",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "metz.marcelino",
                        "uuid": "32d79857-6054-11ee-8c15-000d3a9285ca",
                        "name": "Imelda Schumm",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                }
            ]
        }
    ]
}
                 

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\": \"et\",
    \"passcode\": \"autem\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room"
);

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

let body = {
    "is_public": false,
    "name": "et",
    "passcode": "autem"
};

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

Example response (201):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "A4Rj5QR",
        "passcode": "vel",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "ulangworth",
            "uuid": "32dca992-6054-11ee-8c15-000d3a9285ca",
            "name": "Veronica Hintz",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "participants": []
    }
}
                 

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: et

passcode   string  optional  

Passcode required for private rooms Example: autem

Get a Room

requires authentication

Get information about a room and active participants.

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "UELaLdu",
        "passcode": "temporibus",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "qwisoky",
            "uuid": "32dfca82-6054-11ee-8c15-000d3a9285ca",
            "name": "Naomie Feeney",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "participants": []
    }
}
                 

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: esse

Query Parameters

passcode   string  optional  

Passcode required for private room Example: ut

Update a Room

requires authentication

Update the name of a room

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "bBrwOG5",
        "passcode": "necessitatibus",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "alverta35",
            "uuid": "32e485d8-6054-11ee-8c15-000d3a9285ca",
            "name": "Jayda Harris",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "participants": []
    }
}
                 

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: ut

Body Parameters

is_public   boolean  optional  

Public or private Example: true

name   string  optional  

Name Example: omnis

passcode   boolean  optional  

Passcode required for private rooms Example: false

background   file  optional  

Must be a file. Example: /tmp/php9ypG2B

custom_slug   string  optional  

Must not be greater than 32 characters. Example: euleimulhauj

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/voluptatem" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room/voluptatem"
);

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

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

Example response (204):

                    [Empty response]
                 

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: voluptatem

Update Room Rolls

requires authentication

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

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

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

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

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

Example response (200):

                                        
                    {
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "pouros.cade",
                "uuid": "32e9d129-6054-11ee-8c15-000d3a9285ca",
                "name": "Prof. Imogene Renner I",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "soluta",
                "slug": "ub_ZMN6",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 9,
                        "username": "pariatur_voluptas",
                        "color": "#43b5da",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "shields.jess",
                            "uuid": "32eae2a4-6054-11ee-8c15-000d3a9285ca",
                            "name": "Colin Hills",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "32ec1dc2-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": true,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d8",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 2,
            "equation": "1d8",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "kathleen.gottlieb",
                "uuid": "32edc198-6054-11ee-8c15-000d3a9285ca",
                "name": "Aliyah Gaylord",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "voluptatem",
                "slug": "Pt5Fmdp",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 10,
                        "username": "et_et",
                        "color": "#cdea1f",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "laury.walsh",
                            "uuid": "32eead45-6054-11ee-8c15-000d3a9285ca",
                            "name": "Hildegard Kozey",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "32ef9e7e-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": true,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 3,
                    "value_to_display": "3",
                    "type": "d10",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 3,
            "equation": "1d10",
            "external_id": null,
            "participants": []
        }
    ]
}
                 

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/aliquam/participant" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"passcode\": \"doloribus\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/aliquam/participant"
);

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "3tU7hKw",
        "passcode": "ipsa",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "junius00",
            "uuid": "32f437b5-6054-11ee-8c15-000d3a9285ca",
            "name": "Jakob Treutel III",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "participants": []
    }
}
                 

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: aliquam

Body Parameters

passcode   string  optional  

Passcode required for private room Example: doloribus

Update a Participant

requires authentication

Update the username or color of the room participant.

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

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

let body = {
    "passcode": "itaque",
    "username": "consequatur",
    "color": "#FF0000"
};

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "6T3e-po",
        "passcode": "quod",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "friesen.elizabeth",
            "uuid": "32f92851-6054-11ee-8c15-000d3a9285ca",
            "name": "Madalyn Roob",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "participants": []
    }
}
                 

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: ducimus

id   string   

Participant ID Example: harum

Body Parameters

passcode   string  optional  

Passcode required for private room Example: itaque

username   string  optional  

Update a participant's username Example: consequatur

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/quia/participant/eaque" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/room/quia/participant/eaque"
);

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

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

Example response (204):

                    [Empty response]
                 

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: quia

id   string   

The ID of the participant. Example: eaque

Roll

API for creating and managing dice rolls.

Create a Roll

requires authentication

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

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

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

Example request:
curl --request POST \
    "https://dddice.com/api/1.0/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dice\": [
        {
            \"type\": \"d20\",
            \"theme\": \"dddice-red\"
        },
        {
            \"type\": \"d20\",
            \"theme\": \"dddice-red\"
        }
    ],
    \"external_id\": \"hykthiskapzbugryoiurci\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"p\": \"non\",
        \"rr\": \"animi\",
        \"ro\": \"autem\",
        \"ra\": \"voluptatem\",
        \"e\": \"natus\",
        \"mi\": 5.1641717,
        \"ma\": 64.035304
    },
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        603.014354
    ],
    \"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

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

let body = {
    "dice": [
        {
            "type": "d20",
            "theme": "dddice-red"
        },
        {
            "type": "d20",
            "theme": "dddice-red"
        }
    ],
    "external_id": "hykthiskapzbugryoiurci",
    "operator": {
        "k": "\"h2\"",
        "p": "non",
        "rr": "animi",
        "ro": "autem",
        "ra": "voluptatem",
        "e": "natus",
        "mi": 5.1641717,
        "ma": 64.035304
    },
    "room": "HvvOlTl",
    "whisper": [
        603.014354
    ],
    "label": "\"Longbow damage with Hunter's Mark\""
};

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

Example response (201):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "cjones",
            "uuid": "330609f6-6054-11ee-8c15-000d3a9285ca",
            "name": "Tomas Quigley II",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "corporis",
            "slug": "AeQE_Ce",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 13,
                    "username": "odit_quis",
                    "color": "#2d08a3",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "lori21",
                        "uuid": "33077b6f-6054-11ee-8c15-000d3a9285ca",
                        "name": "Dr. Donny Mann IV",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "33085d19-6054-11ee-8c15-000d3a9285ca",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": false,
                "is_cleared": false,
                "is_dropped": false,
                "value": 3,
                "value_to_display": "3",
                "type": "d8",
                "label": null,
                "meta": null,
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            }
        ],
        "total_value": 3,
        "equation": "1d8",
        "external_id": null,
        "participants": []
    }
}
                 

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: false

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: enim

theme   string   

Theme ID Example: fugit

label   string  optional  

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

value   number  optional  

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

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: qui

meta   object  optional  

Optional data that is not critical to the functionality of a die roll but could be useful to store for display or informational purposes.

external_id   string  optional  

Must not be greater than 256 characters. Example: hykthiskapzbugryoiurci

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: non

rr   string  optional  

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

ro   string  optional  

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

ra   string  optional  

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

e   string  optional  

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

mi   number  optional  

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

ma   number  optional  

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

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

List rolls

requires authentication

Fetch rolls from a given room

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

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

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

Example response (200):

                                        
                    {
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "pedro.schimmel",
                "uuid": "330b87e7-6054-11ee-8c15-000d3a9285ca",
                "name": "Tre Cruickshank",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "excepturi",
                "slug": "3XlTdBr",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 14,
                        "username": "quaerat_facere",
                        "color": "#5d3174",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "chaya70",
                            "uuid": "330c9bdb-6054-11ee-8c15-000d3a9285ca",
                            "name": "Mr. Stephon Morar",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "330da839-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": false,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d4",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 2,
            "equation": "1d4",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "mayert.bernice",
                "uuid": "330f3a5f-6054-11ee-8c15-000d3a9285ca",
                "name": "Catalina Klocko",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "libero",
                "slug": "nSoAFEV",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 15,
                        "username": "occaecati_voluptatem",
                        "color": "#1df72c",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "camron83",
                            "uuid": "33102bfc-6054-11ee-8c15-000d3a9285ca",
                            "name": "Miss Lelia Herman Jr.",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "33110d1e-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 12,
                    "value_to_display": "12",
                    "type": "d12",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 12,
            "equation": "1d12",
            "external_id": null,
            "participants": []
        }
    ]
}
                 

Request      

GET api/1.0/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

Room Slug Example: modi

Get a Roll

requires authentication

Fetch roll information including the user and optional room information

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "cwalker",
            "uuid": "33150ca9-6054-11ee-8c15-000d3a9285ca",
            "name": "Vince Streich",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "molestias",
            "slug": "xEvtpSF",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 16,
                    "username": "in_excepturi",
                    "color": "#210c2b",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "kuvalis.chelsey",
                        "uuid": "331619a8-6054-11ee-8c15-000d3a9285ca",
                        "name": "Amaya Wolff",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "3317039c-6054-11ee-8c15-000d3a9285ca",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": false,
                "is_cleared": true,
                "is_dropped": false,
                "value": 11,
                "value_to_display": "11",
                "type": "d12",
                "label": null,
                "meta": null,
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            }
        ],
        "total_value": 11,
        "equation": "1d12",
        "external_id": null,
        "participants": []
    }
}
                 

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: ex

Update a Roll

requires authentication

Pickup dice from the board or unhide dice to players

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "dach.christian",
            "uuid": "331b1b10-6054-11ee-8c15-000d3a9285ca",
            "name": "Madeline Mosciski",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "pariatur",
            "slug": "olHEQ57",
            "custom_slug": null,
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 17,
                    "username": "et_illum",
                    "color": "#02530c",
                    "position": 0,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "baumbach.telly",
                        "uuid": "331c2d79-6054-11ee-8c15-000d3a9285ca",
                        "name": "Prof. Edna Cassin",
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "331d172b-6054-11ee-8c15-000d3a9285ca",
                "is_hidden": false,
                "is_user_value": true,
                "is_visible": false,
                "is_cleared": false,
                "is_dropped": false,
                "value": 4,
                "value_to_display": "4",
                "type": "d4",
                "label": null,
                "meta": null,
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            }
        ],
        "total_value": 4,
        "equation": "1d4",
        "external_id": null,
        "participants": []
    }
}
                 

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: non

Body Parameters

room   string  optional  

Example: perspiciatis

dice   object[]   

List of partial dice rolls.

uuid   string  optional  

Example: 69bdb9e5-578f-30f1-a04c-044a70432d08

is_visible   boolean  optional  

Roll value hidden Example: true

is_cleared   boolean  optional  

Roll value cleared Example: false

is_dropped   boolean  optional  

Example: true

is_hidden   boolean  optional  

Example: true

meta   object  optional  

Optional data that is not critical to the functionality of a die roll but could be useful to store for display or informational purposes.

Response

Response Fields

uuid   string   

The ID of the roll

direction   number   

The angle the roll was thrown (in degrees)

velocity   number   

How hard the roll was thrown

user   object   

User Object

room   object   

Room Object

values   object[]   

Roll Value Objects

total_value   number   

Sum of all roll value totals

created_at   string   

Created timestamp

updated_at   string   

Updated timestamp

Bulk Update Rolls

requires authentication

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

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

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"rolls\": [
        {
            \"dice\": [
                {
                    \"uuid\": \"6ac91def-14eb-3693-816a-31be08994829\",
                    \"is_visible\": true,
                    \"is_cleared\": false,
                    \"is_dropped\": false,
                    \"is_hidden\": true
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

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

let body = {
    "rolls": [
        {
            "dice": [
                {
                    "uuid": "6ac91def-14eb-3693-816a-31be08994829",
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "is_hidden": true
                }
            ]
        }
    ]
};

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

Example response (200):

                                        
                    {
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "madisyn22",
                "uuid": "3321a2e7-6054-11ee-8c15-000d3a9285ca",
                "name": "Meta Ferry",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sed",
                "slug": "BNwkMUG",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 18,
                        "username": "eos_praesentium",
                        "color": "#229825",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "gus42",
                            "uuid": "3322ba65-6054-11ee-8c15-000d3a9285ca",
                            "name": "Cristina Feeney",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "33239d77-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 1,
                    "value_to_display": "1",
                    "type": "d10",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 1,
            "equation": "1d10",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "sipes.mac",
                "uuid": "33253708-6054-11ee-8c15-000d3a9285ca",
                "name": "Moshe Lehner",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "iste",
                "slug": "V_InOWI",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 19,
                        "username": "saepe_facilis",
                        "color": "#71df02",
                        "position": 0,
                        "created_at": "2023-10-01T12:15:24.000000Z",
                        "updated_at": "2023-10-01T12:15:24.000000Z",
                        "deleted_at": null,
                        "user": {
                            "username": "pbruen",
                            "uuid": "33262718-6054-11ee-8c15-000d3a9285ca",
                            "name": "Saul Hand",
                            "created_at": "2023-10-01T12:15:24.000000Z",
                            "updated_at": "2023-10-01T12:15:24.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "3327113f-6054-11ee-8c15-000d3a9285ca",
                    "is_hidden": true,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 3,
                    "value_to_display": "3",
                    "type": "d12",
                    "label": null,
                    "meta": null,
                    "created_at": "2023-10-01T12:15:24.000000Z",
                    "updated_at": "2023-10-01T12:15:24.000000Z"
                }
            ],
            "total_value": 3,
            "equation": "1d12",
            "external_id": null,
            "participants": []
        }
    ]
}
                 

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: 0caa6cff-ab8b-3cca-81e8-47e0b5e33db3

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: a

Delete rolls

requires authentication

Delete rolls from a given room

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

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

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

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

Room Slug Example: eligendi

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-10-01T12:15:24.000000Z",
            "uuid": "a6d4294d-fde9-3013-8543-921592c8b179",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "waylon32",
                "uuid": "332cc2b5-6054-11ee-8c15-000d3a9285ca",
                "name": "Maxie Davis",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "theme": {
                "slug": "et-est-aliquam",
                "is_available": true,
                "is_extendable": true,
                "is_discoverable": true,
                "name": "Mr.",
                "description": "Sit doloremque cum ea eos non omnis qui. Dolores corrupti consequuntur mollitia tenetur ut laboriosam id. Laboriosam nihil tempore illum reprehenderit qui.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            }
        },
        {
            "limit": 5,
            "expires_at": "2023-10-01T12:15:24.000000Z",
            "uuid": "463fbc0b-a6b2-392f-a064-80e5ed395d4e",
            "updated_at": "2023-10-01T12:15:24.000000Z",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "user": {
                "username": "sheldon74",
                "uuid": "332e5882-6054-11ee-8c15-000d3a9285ca",
                "name": "Citlalli Hoeger III",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "theme": {
                "slug": "exercitationem-vero",
                "is_available": true,
                "is_extendable": true,
                "is_discoverable": true,
                "name": "Prof.",
                "description": "Ipsam ad et et eaque odit provident corporis. Molestiae voluptatem asperiores delectus excepturi fugit rerum. Et asperiores possimus ut et delectus. Sunt praesentium eum corrupti cumque enim qui est et.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.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\": 13,
    \"expires_at\": \"ex\"
}"
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": 13,
    "expires_at": "ex"
};

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' => 13,
            'expires_at' => 'ex',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2023-10-01T12:15:24.000000Z",
        "uuid": "0040e74a-987d-3191-9a57-a639c50d6f8d",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "moen.sydnee",
            "uuid": "33314e38-6054-11ee-8c15-000d3a9285ca",
            "name": "Trever Reilly",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "theme": {
            "slug": "quam-eos-et",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Dr.",
            "description": "Velit voluptas ab nobis nobis qui. Id commodi est a soluta. Cupiditate reprehenderit enim vero natus est. Iste ab qui porro perspiciatis dicta enim corporis.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.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: 13

expires_at   string  optional  

Expiration date or datetime Example: ex

Get Share Request

requires authentication

Get information about a share request.

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

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/ipsa',
    [
        '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-10-01T12:15:24.000000Z",
        "uuid": "fdb5fdc3-7271-3859-8242-9bd1fe2e7880",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "howell.skye",
            "uuid": "3333c219-6054-11ee-8c15-000d3a9285ca",
            "name": "Mrs. Dariana McCullough MD",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "theme": {
            "slug": "suscipit-et-et",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Dr.",
            "description": "Ex sed laboriosam id pariatur quos cumque. Sit vel maiores dolorem sed. Omnis molestias aperiam tenetur est nihil porro. Autem eius fugiat recusandae distinctio numquam.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.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: ipsa

Update Share Request

requires authentication

Update information about a share request.

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

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/nihil',
    [
        '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-10-01T12:15:24.000000Z",
        "uuid": "05812913-d875-32ac-956e-3a1e81de91ef",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "axel.ullrich",
            "uuid": "333623b3-6054-11ee-8c15-000d3a9285ca",
            "name": "Nyah Schowalter",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "theme": {
            "slug": "omnis-magnam",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Prof.",
            "description": "Ipsa delectus laudantium autem maiores provident est non. Nihil excepturi impedit mollitia ut aut tempora dicta. Vel atque ab ratione minus in aut recusandae quaerat.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.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: nihil

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/cum" \
    --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/cum"
);

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/cum',
    [
        '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: cum

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/illum" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/share/illum"
);

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

Example response (200):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2023-10-01T12:15:24.000000Z",
        "uuid": "1fe33954-1106-3eb1-8a6d-37cfd5874311",
        "updated_at": "2023-10-01T12:15:24.000000Z",
        "created_at": "2023-10-01T12:15:24.000000Z",
        "user": {
            "username": "sigmund94",
            "uuid": "3339fe1c-6054-11ee-8c15-000d3a9285ca",
            "name": "Patricia Bergstrom",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "theme": {
            "slug": "vero-dolore-atque",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Dr.",
            "description": "Qui ducimus sequi fugiat quia et alias rerum velit. Aspernatur vero quis id repudiandae molestias harum earum. Est nostrum repudiandae animi ab aspernatur eum. Expedita nihil commodi nihil quas aut doloremque.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.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: illum

User

API for managing users.

Get Authenticated User

requires authentication

Get the current authenticated user.

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

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

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

Example response (200):

                                        
                    {
    "type": "user",
    "data": {
        "name": "Aubrey Ward",
        "username": "hudson.herbert",
        "updated_at": "2023-10-01T12:15:25.000000Z",
        "created_at": "2023-10-01T12:15:25.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "non",
                "slug": "Rs4SKyY",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:25.000000Z",
                "updated_at": "2023-10-01T12:15:25.000000Z",
                "deleted_at": null
            }
        ]
    }
}
                 

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": "Mrs. Jakayla Emard",
        "username": "rosanna.barton",
        "updated_at": "2023-10-01T12:15:25.000000Z",
        "created_at": "2023-10-01T12:15:25.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sunt",
                "slug": "Q2SeDal",
                "custom_slug": null,
                "settings": {
                    "chat": {
                        "backgroundColor": 0,
                        "deleteAfter": 30,
                        "fadeAfter": 10,
                        "isDiceExpanded": false,
                        "isDiceSorted": false,
                        "isUsernameVisible": true,
                        "isVisible": true,
                        "textColor": 16777215,
                        "textSize": "sm"
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightColor": 16777215,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "roll": {
                        "allowPlayerRollUpdates": false,
                        "allowPlayerMoveDice": false,
                        "autoClear": 10,
                        "defaultClickBehavior": "reroll",
                        "diceSize": 1,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "disableShakingSound": false,
                        "pickUp": 1
                    }
                },
                "created_at": "2023-10-01T12:15:25.000000Z",
                "updated_at": "2023-10-01T12:15:25.000000Z",
                "deleted_at": null
            }
        ]
    }
}
                 

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\": \"corrupti\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/user/token"
);

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

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

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

Example response (201):

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

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: corrupti

Delete API Key

requires authentication

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

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

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

Example response (204):

                    [Empty response]
                 

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: similique

Dice Box

API for managing themes in your Digital Dice Box.

List Dice Box Collection

requires authentication

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

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

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

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

let body = {
    "limit": 16.459013781,
    "filter": "non"
};

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

Example response (200):

                                        
                    {
    "type": "theme[]",
    "data": [
        {
            "meshes": {
                "d4": "https://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "est-eaque",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Cumque aut ullam omnis ipsum cum nesciunt illum. Qui officia illo itaque quaerat possimus molestiae enim.",
            "user": {
                "username": "gbayer",
                "uuid": "333d81c6-6054-11ee-8c15-000d3a9285ca",
                "name": "Joaquin Ward",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        {
            "meshes": {
                "d4": "https://cdn.dddice.com/mesh/d04.fbx",
                "d6": "https://cdn.dddice.com/mesh/d06.fbx",
                "d8": "https://cdn.dddice.com/mesh/d08.fbx",
                "d10": "https://cdn.dddice.com/mesh/d10.fbx",
                "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
                "d12": "https://cdn.dddice.com/mesh/d12.fbx",
                "d20": "https://cdn.dddice.com/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "molestiae-incidunt-et",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Illo eaque cumque modi amet sunt atque sed. Eos occaecati maiores odio harum consequatur culpa. Aut aliquid autem adipisci quis.",
            "user": {
                "username": "klein.cordell",
                "uuid": "333f3b21-6054-11ee-8c15-000d3a9285ca",
                "name": "Mr. Marcos Okuneva",
                "created_at": "2023-10-01T12:15:24.000000Z",
                "updated_at": "2023-10-01T12:15:24.000000Z"
            },
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        }
    ]
}
                 

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: doloremque

ids   string  optional  

Comma seperated list of themes IDs to get Example: voluptatem

Body Parameters

limit   number  optional  

Example: 16.459013781

filter   string  optional  

Example: non

Get Dice Box Theme

requires authentication

Get information about a theme in your Digital Dice Box.

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://cdn.dddice.com/mesh/d04.fbx",
            "d6": "https://cdn.dddice.com/mesh/d06.fbx",
            "d8": "https://cdn.dddice.com/mesh/d08.fbx",
            "d10": "https://cdn.dddice.com/mesh/d10.fbx",
            "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
            "d12": "https://cdn.dddice.com/mesh/d12.fbx",
            "d20": "https://cdn.dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "magnam-magnam-minima",
        "name": "Miss",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Impedit vel nisi nihil saepe deleniti. Accusamus nam aut ex assumenda. Ipsa ab unde eveniet sunt natus.",
        "user": {
            "username": "jeromy.howe",
            "uuid": "33429824-6054-11ee-8c15-000d3a9285ca",
            "name": "Mrs. Stacy Ortiz",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "created_at": "2023-10-01T12:15:24.000000Z",
        "updated_at": "2023-10-01T12:15:24.000000Z"
    }
}
                 

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: illum

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/deserunt" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/deserunt"
);

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

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

Example response (200):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "https://cdn.dddice.com/mesh/d04.fbx",
            "d6": "https://cdn.dddice.com/mesh/d06.fbx",
            "d8": "https://cdn.dddice.com/mesh/d08.fbx",
            "d10": "https://cdn.dddice.com/mesh/d10.fbx",
            "d10x": "https://cdn.dddice.com/mesh/d10.fbx",
            "d12": "https://cdn.dddice.com/mesh/d12.fbx",
            "d20": "https://cdn.dddice.com/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "https://cdn.dddice.com/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "https://cdn.dddice.com/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "aut-aspernatur-quisquam",
        "name": "Mr.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Odio ducimus quis enim aut et cupiditate. Cum fugiat veritatis eos ut. Optio non sit laboriosam voluptatem. Et ut sit hic.",
        "user": {
            "username": "thompson.patrick",
            "uuid": "3345105f-6054-11ee-8c15-000d3a9285ca",
            "name": "Shania Graham",
            "created_at": "2023-10-01T12:15:24.000000Z",
            "updated_at": "2023-10-01T12:15:24.000000Z"
        },
        "created_at": "2023-10-01T12:15:24.000000Z",
        "updated_at": "2023-10-01T12:15:24.000000Z"
    }
}
                 

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: deserunt

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/ex" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/ex"
);

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

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

Example response (204):

                    [Empty response]
                 

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: ex

id   string   

The ID of the theme. Example: dddice-standard

Integration Authentication

API for authenticating with third-party applications and integrations

Create activation code

When setting up an integration, it is advised to present a potential user with a "code" and then have the user enter that code on the official dddice website.

This is not only easy for the user to interact with, it also helps prevent odd handshakes and security barriers when trying to authenticate with cookies and/or other mechanisms, especially when trying to authenticate inside an <iframe />.

When a code is returned, ask the user to navigate to https://dddice.com/activate where they will be prompted to enter the code shown on your integrations screen.

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

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

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

Example response (201):

                                        
                    {
    "data": []
}
                 

Request      

POST api/1.0/activate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Read activation code

While waiting for the user to authenticate, this endpoint can be used to retrieve the latest status of the activation code.

If a user is present, an integration can assume the user has successfully authenticated using this code.

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/activate/minus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Authorization: Secret secret-value"
const url = new URL(
    "https://dddice.com/api/1.0/activate/minus"
);

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

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

Example response (200):

                                        
                    {
    "data": []
}
                 

Request      

GET api/1.0/activate/{code}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Authorization: Secret secret-value

URL Parameters

code   string   

Activation code Example: minus

Authenticate activation code

requires authentication

After a user is prompted to enter a code, this (protected) endpoint is used to sync the requesting user and secret/code together in order to activate the integration.

This request is typically not used directly when integrating with dddice.

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

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

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

Example response (200):

                                        
                    {
    "data": []
}
                 

Request      

POST api/1.0/activate/{code}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

code   string   

Activation code Example: ab