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": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "non-eum-praesentium",
            "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": "Nisi magni distinctio ratione asperiores non facere quia. Expedita libero quis ad. Adipisci qui quas quidem nemo. Et aut enim beatae vero ullam.",
            "user": {
                "username": "champlin.zack",
                "uuid": "ad56a91b-1129-37e0-babb-c1542c83e645",
                "name": "Ora Haag",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "assumenda-modi",
            "name": "Prof.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Et in incidunt in sapiente aliquam omnis veniam ducimus. Quia architecto corporis rerum officiis cupiditate. Vel consectetur voluptatum incidunt dolor reiciendis qui.",
            "user": {
                "username": "rmertz",
                "uuid": "634d15bd-ed1a-3392-bf87-94941858f339",
                "name": "Coy Kertzmann",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.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=totam" \
    --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=ratione" \
    --form "assets[]=@/tmp/phpgZi83Y" 
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', 'totam');
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', 'ratione');
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' => 'totam'
            ],
            [
                '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' => 'ratione'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/phpgZi83Y', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "/mesh/d04.fbx",
            "d6": "/mesh/d06.fbx",
            "d8": "/mesh/d08.fbx",
            "d10": "/mesh/d10.fbx",
            "d10x": "/mesh/d10.fbx",
            "d12": "/mesh/d12.fbx",
            "d20": "/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "aut-nesciunt",
        "name": "Ms.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Eligendi doloremque laboriosam illum voluptatem iusto. Nemo minus ipsa qui sit. Aut ea molestias quibusdam autem perspiciatis sint aliquid.",
        "user": {
            "username": "gabriel.braun",
            "uuid": "7602d1b6-cfa1-3a33-9235-01decae5a18f",
            "name": "Gregg Buckridge",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z",
            "subscription": false,
            "is_merchant": false
        },
        "created_at": "2024-04-19T16:28:43.000000Z",
        "updated_at": "2024-04-19T16:28:43.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: totam

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

description   string   

Theme description no-example Example: Quisquam impedit dolor dolores saepe eos unde rerum.

id   string   

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

label   labelObject   

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

background_color   string   

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

color   string   

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

name   string   

Name of the theme no-example Example: aperiam

version   string   

Semver 2.0.0 version number no-example Example: autem

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

notation   string  optional  

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

type   string  optional  

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

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

meshes   object  optional  

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

sizes   object  optional  

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

sounds   soundObject[]  optional  

Sounds that play no-example

<something>   any  optional  

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

on   string  optional  

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

src   string|object  optional  

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

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

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

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

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": "/mesh/d04.fbx",
            "d6": "/mesh/d06.fbx",
            "d8": "/mesh/d08.fbx",
            "d10": "/mesh/d10.fbx",
            "d10x": "/mesh/d10.fbx",
            "d12": "/mesh/d12.fbx",
            "d20": "/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "adipisci-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": "Dolores eaque et dolorem quam praesentium enim. Quasi eligendi dolorem exercitationem. A et et consequatur ipsum aliquid quam quo exercitationem. Quasi consequatur ipsam ducimus ut occaecati reprehenderit exercitationem.",
        "user": {
            "username": "harris.tre",
            "uuid": "d17d2f3f-8dd8-384b-af0b-d0be8fb86591",
            "name": "Monty Kunze",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z",
            "subscription": false,
            "is_merchant": false
        },
        "created_at": "2024-04-19T16:28:43.000000Z",
        "updated_at": "2024-04-19T16:28:43.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": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "quibusdam-voluptate-labore",
            "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": "Ullam ipsa iste nulla minus error temporibus. Ut voluptatem dicta consectetur et deleniti. Tempora id eius consequuntur nesciunt eveniet nam unde. Eaque aut dicta quae aut.",
            "user": {
                "username": "newell.goyette",
                "uuid": "f62a0849-0388-35f5-a1e1-ed5eca6cc561",
                "name": "Ebba Weber",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "eius-et-ut",
            "name": "Mrs.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Et consequatur rerum autem. Quas maxime numquam est nesciunt. Saepe ullam velit libero excepturi ex vero ut.",
            "user": {
                "username": "ashton38",
                "uuid": "3073637e-8cdd-3200-ae72-a34961841f5b",
                "name": "Mr. Luther Doyle DVM",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.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": "/mesh/d04.fbx",
            "d6": "/mesh/d06.fbx",
            "d8": "/mesh/d08.fbx",
            "d10": "/mesh/d10.fbx",
            "d10x": "/mesh/d10.fbx",
            "d12": "/mesh/d12.fbx",
            "d20": "/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "nihil-corporis-numquam",
        "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": "Expedita ex aliquid rerum vitae veniam voluptate. Veritatis adipisci ea perspiciatis provident culpa aut. Dolor vero cumque at culpa. Vitae dolorum voluptatibus sit consectetur adipisci nihil.",
        "user": {
            "username": "fbauch",
            "uuid": "4489c66a-261d-3564-b4d5-b6da2f41b147",
            "name": "Myrna Stoltenberg",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z",
            "subscription": false,
            "is_merchant": false
        },
        "created_at": "2024-04-19T16:28:43.000000Z",
        "updated_at": "2024-04-19T16:28:43.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/iure" \
    --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/iure"
);

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

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

Chart: Frequency of roll values

requires authentication

Get statistical information about a theme.

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

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

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

Example response (200):

                                        
                    {
  "data": {
    "labels": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
    "datasets": [{
      "label": "d4",
      "data": [12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    }, {
      "label": "d6",
      "data": [5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    }, {
      "label": "d8",
      "data": [8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    }, {
      "label": "d20",
      "data": [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
    }],
    "processed_at": "2023-10-06T21:36:22.462064Z"
    "updated_at": "2023-10-06T21:37:11.221642Z"
  }
}
                 

Request      

GET api/1.0/theme/{theme_slug}/statistic/histogram/values

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

theme_slug   integer   

The slug of the theme. Example: 1

Chart: Total rolls over time

requires authentication

Get statistical information about a theme.

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

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

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

Example response (200):

                                        
                    {
  "data": {
    "labels": ["2023-01-01", "2023-01-02", "2023-01-03"],
    "datasets": [{
      "label": "Rolls over time",
      "data": [1000, 1100, 1200]
    }],
    "processed_at": "2023-10-06T21:36:22.462064Z"
    "updated_at": "2023-10-06T21:37:11.221642Z"
  }
}
                 

Request      

GET api/1.0/theme/{theme_slug}/statistic/timeseries/rolls

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

theme_slug   integer   

The slug of the theme. Example: 1

Room

API for managing rooms.

List Rooms

requires authentication

List all rooms created or joined by a user

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

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

Example response (200):

                                        
                    {
    "type": "room[]",
    "data": [
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": "//images/environment/bg-6.webp",
            "slug": "vUD4IfT",
            "passcode": "ut",
            "custom_slug": "4PbxXdx",
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "updated_at": "2024-04-19T16:28:42.000000Z",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "user": {
                "username": "strosin.olaf",
                "uuid": "9a41f378-939d-3d8a-96ab-7022b1242571",
                "name": "Jody Krajcik",
                "created_at": "2024-04-19T16:28:42.000000Z",
                "updated_at": "2024-04-19T16:28:42.000000Z"
            },
            "participants": [
                {
                    "id": 2,
                    "username": "ab_cum",
                    "color": "#1c6662",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-04-19T16:28:42.000000Z",
                    "updated_at": "2024-04-19T16:28:42.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "quigley.shaina",
                        "uuid": "95b0d980-1126-3342-b371-a8a3bf52a4be",
                        "name": "Arianna Little",
                        "created_at": "2024-04-19T16:28:42.000000Z",
                        "updated_at": "2024-04-19T16:28:42.000000Z"
                    }
                },
                {
                    "id": 3,
                    "username": "et_qui",
                    "color": "#28d985",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-04-19T16:28:42.000000Z",
                    "updated_at": "2024-04-19T16:28:42.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "jnitzsche",
                        "uuid": "1b6a6391-671d-3159-9a37-142338a21090",
                        "name": "Bianka Ward",
                        "created_at": "2024-04-19T16:28:42.000000Z",
                        "updated_at": "2024-04-19T16:28:42.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": "//images/environment/bg-1.webp",
            "slug": "-sOcLgO",
            "passcode": "explicabo",
            "custom_slug": "LKwINxk",
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "updated_at": "2024-04-19T16:28:42.000000Z",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "user": {
                "username": "mgulgowski",
                "uuid": "4a74ac77-af32-3589-8b76-b7c6510f8377",
                "name": "Mr. Jefferey Nikolaus",
                "created_at": "2024-04-19T16:28:42.000000Z",
                "updated_at": "2024-04-19T16:28:42.000000Z"
            },
            "participants": [
                {
                    "id": 4,
                    "username": "nulla_enim",
                    "color": "#cf76ab",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-04-19T16:28:42.000000Z",
                    "updated_at": "2024-04-19T16:28:42.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "ngoyette",
                        "uuid": "afb11f85-cb98-3a5f-9791-5396fb19d02c",
                        "name": "Monroe Langosh",
                        "created_at": "2024-04-19T16:28:42.000000Z",
                        "updated_at": "2024-04-19T16:28:42.000000Z"
                    }
                },
                {
                    "id": 5,
                    "username": "voluptate_qui",
                    "color": "#9e248f",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-04-19T16:28:42.000000Z",
                    "updated_at": "2024-04-19T16:28:42.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "jude.beatty",
                        "uuid": "6deb2746-a537-33c0-8886-c12c1f9de2d4",
                        "name": "Eleanora Bogan DDS",
                        "created_at": "2024-04-19T16:28:42.000000Z",
                        "updated_at": "2024-04-19T16:28:42.000000Z"
                    }
                }
            ]
        }
    ]
}
                 

Request      

GET api/1.0/room

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

created   string  optional  

Only return rooms where you are the owner Example: ut

Create a Room

requires authentication

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

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

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

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

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

let body = {
    "is_public": true,
    "name": "voluptas",
    "passcode": "nesciunt"
};

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

Example response (201):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-2.webp",
        "slug": "MN2Nuz0",
        "passcode": "minus",
        "custom_slug": "VKQWjwf",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-04-19T16:28:42.000000Z",
        "created_at": "2024-04-19T16:28:42.000000Z",
        "user": {
            "username": "alexandrine.eichmann",
            "uuid": "af525de2-4f66-3e0a-b751-ccdaa653637e",
            "name": "Kasandra Orn",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "updated_at": "2024-04-19T16:28:42.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: true

name   string  optional  

Name Example: voluptas

passcode   string  optional  

Passcode required for private rooms Example: nesciunt

Get a Room

requires authentication

Get information about a room and active participants.

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-5.webp",
        "slug": "nTToAPw",
        "passcode": "omnis",
        "custom_slug": "KEQdwfQ",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-04-19T16:28:42.000000Z",
        "created_at": "2024-04-19T16:28:42.000000Z",
        "user": {
            "username": "kovacek.jonas",
            "uuid": "3681b7e7-491f-332f-80ee-bf7bbb7a78e2",
            "name": "Lemuel Hoeger",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "updated_at": "2024-04-19T16:28:42.000000Z"
        },
        "participants": []
    }
}
                 

Request      

GET api/1.0/room/{room_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

slug   string   

The slug of the room. Example: temporibus

Query Parameters

passcode   string  optional  

Passcode required for private room Example: beatae

Update a Room

requires authentication

Update the name of a room

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-5.webp",
        "slug": "kwp2AYp",
        "passcode": "nihil",
        "custom_slug": "F8BhswP",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-04-19T16:28:42.000000Z",
        "created_at": "2024-04-19T16:28:42.000000Z",
        "user": {
            "username": "sarah.farrell",
            "uuid": "70b0b56f-656d-3c75-95f8-905acaff1f34",
            "name": "Carson Yundt",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "updated_at": "2024-04-19T16:28:42.000000Z"
        },
        "participants": []
    }
}
                 

Request      

PATCH api/1.0/room/{room_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

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

passcode   boolean  optional  

Passcode required for private rooms Example: true

bg_file_path   file  optional  

Must be a file. Example: /tmp/phpt3Yzsu

custom_slug   string  optional  

Must not be greater than 32 characters. Example: ymxsoldjlmkreanhwexlemi

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

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

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

Example response (204):

                    [Empty response]
                 

Request      

DELETE api/1.0/room/{room_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

slug   string   

The slug of the room. Example: magni

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

                                        
                    
                 

Request      

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

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

Body Parameters

dice   object   

Partial dice roll.

is_visible   boolean  optional  

Example: false

is_cleared   boolean  optional  

Roll value cleared Example: false

is_hidden   boolean  optional  

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

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

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

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-5.webp",
        "slug": "JvzD5xH",
        "passcode": "ipsam",
        "custom_slug": "tA3FXMh",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-04-19T16:28:42.000000Z",
        "created_at": "2024-04-19T16:28:42.000000Z",
        "user": {
            "username": "koss.maya",
            "uuid": "b780d721-ecf6-3760-99f6-ae2a8d681fa5",
            "name": "Baby Beier Sr.",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "updated_at": "2024-04-19T16:28:42.000000Z"
        },
        "participants": []
    }
}
                 

Request      

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

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

slug   string   

The slug of the room. Example: necessitatibus

Body Parameters

passcode   string  optional  

Passcode required for private room Example: quo

Update a Participant

requires authentication

Update the username or color of the room participant.

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

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

let body = {
    "username": "minus",
    "color": "#FF0000",
    "passcode": "dolorem"
};

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

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-6.webp",
        "slug": "35EyqSm",
        "passcode": "est",
        "custom_slug": "8DqcyMv",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-04-19T16:28:42.000000Z",
        "created_at": "2024-04-19T16:28:42.000000Z",
        "user": {
            "username": "shanahan.freddie",
            "uuid": "58a34835-9f28-3b6f-949b-291f6c2812b3",
            "name": "Lauren Leuschke",
            "created_at": "2024-04-19T16:28:42.000000Z",
            "updated_at": "2024-04-19T16:28:42.000000Z"
        },
        "participants": []
    }
}
                 

Request      

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

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

id   string   

Participant ID Example: consectetur

slug   string   

The slug of the room. Example: dolorem

Body Parameters

username   string  optional  

Update a participant's username Example: minus

color   string  optional  

Update a participant's color. Example: #FF0000

settings   string  optional  
dice_tray   object  optional  
passcode   string  optional  

Passcode required for private room Example: dolorem

Leave a Room

requires authentication

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

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/room/1/participant/eligendi',
    [
        '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/{room_id}/participant/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 1

id   string   

The ID of the participant. Example: eligendi

slug   string   

The slug of the room. Example: sed

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\": \"fgixmvemgsnrgqhalhnjzyzz\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"d\": \"\\\"l1\\\"\",
        \"*\": 5,
        \"\\/\": 19
    },
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        24734.629
    ],
    \"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": "fgixmvemgsnrgqhalhnjzyzz",
    "operator": {
        "k": "\"h2\"",
        "d": "\"l1\"",
        "*": 5,
        "\/": 19
    },
    "room": "HvvOlTl",
    "whisper": [
        24734.629
    ],
    "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' => 'fgixmvemgsnrgqhalhnjzyzz',
                'operator' => [
                    'k' => '"h2"',
                    'd' => '"l1"',
                    '*' => 5,
                    '/' => 19,
                ],
                'room' => 'HvvOlTl',
                'whisper' => [
                    24734.629,
                ],
                'label' => '"Longbow damage with Hunter\'s Mark"',
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

                                        
                    
                 

Request      

POST api/1.0/roll

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

dice   object[]   

List of dice rolls.

is_hidden   boolean  optional  

Example: true

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

theme   string   

Theme ID Example: similique

label   string  optional  

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

value   number  optional  

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

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

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

operator   object  optional  

Optional operators to manipulate the final value of the dice

k   string  optional  

Keep all matched values. Example: "h2"

d   string  optional  

Drop all matched values. Example: "l1"

*   integer  optional  

Multiply the result by an integer Example: 5

/   integer  optional  

Divide the result by a integer Example: 19

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

                                        
                    
                 

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

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

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

                                        
                    
                 

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

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/velit" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dice\": [
        {
            \"uuid\": \"1\",
            \"is_hidden\": true
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll/velit"
);

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

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

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

Example response (200):

                                        
                    
                 

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

Body Parameters

dice   object[]   

List of partial dice rolls.

uuid   string  optional  

Example: 4516c2db-b2cc-330f-8f2f-bf2b0578a72a

is_cleared   boolean  optional  

Roll value cleared Example: false

is_dropped   boolean  optional  

Example: false

is_hidden   boolean  optional  

Roll value hidden Example: false

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\": \"f546f578-2e0c-3ec8-ae91-d03e05d688cf\",
                    \"is_cleared\": false,
                    \"is_dropped\": false,
                    \"is_hidden\": false
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

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

let body = {
    "rolls": [
        {
            "dice": [
                {
                    "uuid": "f546f578-2e0c-3ec8-ae91-d03e05d688cf",
                    "is_cleared": false,
                    "is_dropped": false,
                    "is_hidden": false
                }
            ]
        }
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'rolls' => [
                [
                    'dice' => [
                        [
                            'uuid' => 'f546f578-2e0c-3ec8-ae91-d03e05d688cf',
                            'is_cleared' => false,
                            'is_dropped' => false,
                            'is_hidden' => false,
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    
                 

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: 35d78cf5-1746-3d3c-a66d-894ad44554ea

dice   object[]   

List of partial dice rolls.

is_hidden   boolean  optional  

Roll value hidden Example: true

is_cleared   boolean  optional  

Roll value cleared Example: true

room   string  optional  

Example: quae

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

Share Dice

API for managing share requests.

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\": 4,
    \"expires_at\": \"dolores\"
}"
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": 4,
    "expires_at": "dolores"
};

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

Example response (201):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2024-04-19T16:28:43.000000Z",
        "uuid": "eb53f5f6-72ca-3caa-9608-746ae6ec26af",
        "updated_at": "2024-04-19T16:28:43.000000Z",
        "created_at": "2024-04-19T16:28:43.000000Z",
        "user": {
            "username": "nblanda",
            "uuid": "84558f6a-e6d7-3b8f-b12e-c0b3749abaab",
            "name": "Prof. Sigrid Kiehn",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        "theme": {
            "slug": "voluptatem-et",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Ms.",
            "description": "Rerum voluptatem mollitia praesentium officia aut quis dolores. Qui mollitia possimus esse. Nobis autem eligendi est ut sunt quis dolores.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.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: 4

expires_at   string  optional  

Expiration date or datetime Example: dolores

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

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/veniam',
    [
        '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": "2024-04-19T16:28:43.000000Z",
        "uuid": "47aa4994-df9b-3aee-b981-85d2aae9fa1e",
        "updated_at": "2024-04-19T16:28:43.000000Z",
        "created_at": "2024-04-19T16:28:43.000000Z",
        "user": {
            "username": "taurean82",
            "uuid": "0ff5a2eb-d06c-323a-856b-e44748f3298c",
            "name": "Cloyd Mills",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        "theme": {
            "slug": "libero-unde",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Dr.",
            "description": "Eos deleniti corrupti ut in ipsa ut a. Natus quo maiores at saepe qui in praesentium. Veritatis et laboriosam enim et.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.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: veniam

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": "Clifford Schmitt MD",
        "username": "pagac.elmira",
        "uuid": "de45a278-732c-39ea-846f-2a53e210e119",
        "updated_at": "2024-04-19T16:28:43.000000Z",
        "created_at": "2024-04-19T16:28:43.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": "/images/environment/bg-1.webp",
                "passcode": "et",
                "slug": "Ojg08r0",
                "custom_slug": "VUz6Dt-",
                "settings": {
                    "chat": {
                        "textSize": "sm",
                        "fadeAfter": 10,
                        "isVisible": true,
                        "textColor": 16777215,
                        "deleteAfter": 30,
                        "isDiceSorted": false,
                        "isDiceExpanded": false,
                        "backgroundColor": 0,
                        "isUsernameVisible": true
                    },
                    "roll": {
                        "pickUp": 1,
                        "diceSize": 1,
                        "autoClear": 10,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "allowPlayerMoveDice": false,
                        "disableShakingSound": false,
                        "defaultClickBehavior": "reroll",
                        "allowPlayerRollUpdates": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "spotlightColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    }
                },
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "deleted_at": null
            }
        ],
        "subscription": false,
        "is_merchant": false
    }
}
                 

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 3 accounts/per minute per IP.

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

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

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

Example response (201):

                                        
                    {
    "type": "user",
    "data": {
        "name": "Dr. Riley Friesen Jr.",
        "username": "carroll.walter",
        "uuid": "51644506-313a-3f8d-aad8-89ae3d8fc35c",
        "updated_at": "2024-04-19T16:28:43.000000Z",
        "created_at": "2024-04-19T16:28:43.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": "/images/environment/bg-4.webp",
                "passcode": "velit",
                "slug": "nr9k0cJ",
                "custom_slug": "e7nUZqy",
                "settings": {
                    "chat": {
                        "textSize": "sm",
                        "fadeAfter": 10,
                        "isVisible": true,
                        "textColor": 16777215,
                        "deleteAfter": 30,
                        "isDiceSorted": false,
                        "isDiceExpanded": false,
                        "backgroundColor": 0,
                        "isUsernameVisible": true
                    },
                    "roll": {
                        "pickUp": 1,
                        "diceSize": 1,
                        "autoClear": 10,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "allowPlayerMoveDice": false,
                        "disableShakingSound": false,
                        "defaultClickBehavior": "reroll",
                        "allowPlayerRollUpdates": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "spotlightColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    }
                },
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "deleted_at": null
            }
        ],
        "subscription": false,
        "is_merchant": false
    }
}
                 

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\": \"nesciunt\"
}"
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": "nesciunt"
};

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' => 'nesciunt',
        ],
    ]
);
$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: nesciunt

Delete API Key

requires authentication

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

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

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=sint&ids=vero" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"limit\": 3.39223,
    \"filter\": \"dolorem\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box"
);

const params = {
    "filter": "sint",
    "ids": "vero",
};
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": 3.39223,
    "filter": "dolorem"
};

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' => 'sint',
            'ids' => 'vero',
        ],
        'json' => [
            'limit' => 3.39223,
            'filter' => 'dolorem',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "type": "theme[]",
    "data": [
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "inventore-reiciendis-distinctio",
            "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": "Ipsum repellendus optio tempore autem. Aut adipisci qui aut. Enim dolor veniam nobis incidunt omnis.",
            "user": {
                "username": "hamill.junius",
                "uuid": "53d214b5-a902-3938-8491-1417bceb5296",
                "name": "Humberto Kulas",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "laborum-quo",
            "name": "Ms.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Autem ipsam quas atque. Voluptates voluptas eum quia voluptatem vero aut. In in commodi animi asperiores quidem.",
            "user": {
                "username": "giovani.mclaughlin",
                "uuid": "e141e788-9535-3268-a023-f03389e0359a",
                "name": "Mrs. Leonora Ruecker V",
                "created_at": "2024-04-19T16:28:43.000000Z",
                "updated_at": "2024-04-19T16:28:43.000000Z",
                "subscription": false,
                "is_merchant": false
            },
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.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: sint

ids   string  optional  

Comma seperated list of themes IDs to get Example: vero

Body Parameters

limit   number  optional  

Example: 3.39223

filter   string  optional  

Example: dolorem

Add Theme to Dice Box

requires authentication

Add a theme to your Digital Dice Box.

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

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

let body = {
    "id": "molestiae"
};

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

Example response (201):

                                        
                    {
    "data": {
        "meshes": {
            "d4": "/mesh/d04.fbx",
            "d6": "/mesh/d06.fbx",
            "d8": "/mesh/d08.fbx",
            "d10": "/mesh/d10.fbx",
            "d10x": "/mesh/d10.fbx",
            "d12": "/mesh/d12.fbx",
            "d20": "/mesh/d20.fbx"
        },
        "available_dice": [
            "d4",
            "d6",
            "d8",
            "d10",
            "d10x",
            "d12",
            "d20"
        ],
        "physics": {
            "inertia": {
                "d4": 5,
                "d6": 12,
                "d8": 10,
                "d10": 9,
                "d10x": 9,
                "d12": 8,
                "d20": 6
            },
            "weight": {
                "d4": 300,
                "d6": 300,
                "d8": 340,
                "d10": 350,
                "d10x": 350,
                "d12": 350,
                "d20": 400
            }
        },
        "sizes": {
            "d4": 1,
            "d6": 1,
            "d8": 1,
            "d10": 1,
            "d10x": 1,
            "d12": 1,
            "d20": 1
        },
        "sounds": [
            {
                "src": "/sounds/roll-1.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-2.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-3.mp3",
                "on": "die.collide"
            },
            {
                "src": "/sounds/roll-loading-sm.mp3",
                "on": "roll.loading",
                "value": 2
            },
            {
                "src": "/sounds/roll-loading-lg.mp3",
                "on": "roll.loading",
                "value": ">=3"
            }
        ],
        "uniforms": {
            "number": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.424,
                    "r": 0.463
                }
            },
            "diffuse": {
                "type": "color",
                "value": {
                    "b": 0,
                    "g": 0.929,
                    "r": 1
                }
            }
        },
        "values": {
            "d4": [
                1,
                2,
                3,
                4
            ],
            "d6": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "d8": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8
            ],
            "d10": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10
            ],
            "d12": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12
            ],
            "d20": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20
            ],
            "d10x": [
                10,
                20,
                30,
                40,
                50,
                60,
                70,
                80,
                90,
                0
            ]
        },
        "id": "voluptatem-eaque-similique",
        "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": "Eveniet earum placeat nemo quae. Odit assumenda et iusto odio ut iste sint. Est illo omnis quod fugiat quas.",
        "user": {
            "username": "samanta97",
            "uuid": "5cb65b3d-6369-3f5e-90ba-9d85a46a1845",
            "name": "Myrtis Steuber",
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z",
            "subscription": false,
            "is_merchant": false
        },
        "created_at": "2024-04-19T16:28:43.000000Z",
        "updated_at": "2024-04-19T16:28:43.000000Z"
    }
}
                 

Request      

POST api/1.0/dice-box

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

id   Theme  optional  

ID Example: molestiae

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

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

id   string   

The ID of the theme. Example: dddice-standard

Endpoints

Get a product

requires authentication

Get information about a product including digital items (themes) and merchant information.

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

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

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

Example response (201):

                                        
                    {
    "data": {
        "merchant_id": 11,
        "name": "Marjolaine Williamson",
        "description": "Ex voluptatem est magnam quis delectus nesciunt impedit. Soluta nostrum soluta atque reprehenderit fugiat amet rem iusto. Porro explicabo recusandae explicabo id.",
        "sku": "DDD-9275",
        "is_on_sale": true,
        "updated_at": "2024-04-19T16:28:43.000000Z",
        "created_at": "2024-04-19T16:28:43.000000Z",
        "id": 11,
        "merchant": {
            "id": 11,
            "name": "Otho Hammes Jr.",
            "description": "Porro aliquid quasi sed dolorem temporibus architecto vero. Ut cupiditate corporis molestiae corporis vel. Ut ad nisi dignissimos voluptas ipsum sit. Assumenda ratione sit qui libero.",
            "merchant_commission": 58,
            "logo_path": null,
            "is_contracts_complete": 0,
            "is_tax_documents_complete": 0,
            "sku_prefix": "pbm",
            "contact_email": "johnathan.sipes@gmail.com",
            "paypal_email": "joshua.hamill@gmail.com",
            "website_url": null,
            "applicant_type": null,
            "is_us_citizen": null,
            "applicant_name": null,
            "created_at": "2024-04-19T16:28:43.000000Z",
            "updated_at": "2024-04-19T16:28:43.000000Z"
        },
        "themes": [],
        "original_price": "0.00",
        "price": "0.00",
        "is_available_for_purchase": false
    }
}
                 

Request      

GET api/1.0/product/{product_sku}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_sku   integer   

Example: 1

sku   string  optional  

Product SKU Example: aperiam

Integration Authentication

API for authenticating with third-party applications and integrations

Create activation code

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

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

Call this endpoint and receive an activation code in 'code' and an authentication secret in 'secret'.

Display the code to the user and ask them to navigate to https://dddice.com/activate where they will be prompted to login/register (as needed) and then enter the code.

Your integration can poll GET /activate/{code} to be notified when the user completes the activation flow. See that endpoint's documentation for more details.

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

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

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

Example response (201):

                                        
                    
                 

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. We recommend you poll this endpoint no more frequently than every 5 seconds

One the user has completed the login/registration process and approved the code for activation you will receive an API key in the 'token' field.

This can then be used to authenticate all future requests as that user.

The Secret in the headers is the secret you received along with the code from POST /authenticate

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

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

                                        
                    
                 

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

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

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

                                        
                    
                 

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

Wishlists

API for managing wishlists.

List Wishlist

requires authentication

List all products in a user's wishlist.

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

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

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

Example response (200):

                                        
                    {
    "type": "wishlist[]",
    "data": [
        [],
        []
    ]
}
                 

Request      

GET api/1.0/wishlist

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Get from Wishlist

requires authentication

Get a particular product from a user's wishlist.

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://dddice.com/api/1.0/wishlist/6',
    [
        '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      

GET api/1.0/wishlist/{product_sku}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_sku   integer   

Example: 6

Add to Wishlist

requires authentication

Add a product to a user's wishlist.

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

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

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://dddice.com/api/1.0/wishlist/8',
    [
        '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/wishlist/{product_sku}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_sku   integer   

Example: 8

Delete from Wishlist

requires authentication

Remove a product from a user's wishlist.

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

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

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://dddice.com/api/1.0/wishlist/10',
    [
        '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/wishlist/{product_sku}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_sku   integer   

Example: 10