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": "fuga-alias-eos",
            "name": "Miss",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Ipsa beatae distinctio sapiente consectetur culpa fuga ut. Quo possimus repellendus necessitatibus. Praesentium corporis ab harum minima nisi.",
            "user": {
                "username": "west.jeramie",
                "uuid": "826366d2-170d-3954-8959-031ec472923b",
                "name": "Felicity Grimes",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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": "id-exercitationem-facere",
            "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": "Et quia rem tempore esse sit tenetur ea id. Deserunt unde quis illum similique est voluptatem atque qui. Laborum perspiciatis aut voluptatem sunt maiores. Alias natus consectetur totam beatae voluptate at aut.",
            "user": {
                "username": "jameson.beer",
                "uuid": "e2f5abe3-b3a3-3a37-8f7b-30870d9a3157",
                "name": "Nannie Miller",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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=velit" \
    --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=nemo" \
    --form "assets[]=@/tmp/phpV3rKcy" 
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', 'velit');
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', 'nemo');
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' => 'velit'
            ],
            [
                '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' => 'nemo'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/phpV3rKcy', '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": "nemo-et-vel",
        "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": "Consequatur non saepe est eveniet. Voluptatem quaerat alias qui laborum. Eos nam nam at et. Voluptatem nostrum vitae adipisci voluptas ut exercitationem culpa.",
        "user": {
            "username": "dibbert.sean",
            "uuid": "21f8b1b8-159c-3edb-8344-7150faf141de",
            "name": "Miss Maci Nikolaus II",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "created_at": "2024-03-29T10:29:58.000000Z",
        "updated_at": "2024-03-29T10:29:58.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: velit

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

description   string   

Theme description no-example Example: Voluptatem sint qui nihil repellat et.

id   string   

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

label   labelObject   

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

background_color   string   

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

color   string   

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

name   string   

Name of the theme no-example Example: qui

version   string   

Semver 2.0.0 version number no-example Example: molestiae

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

notation   string  optional  

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

type   string  optional  

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

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

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

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

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

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

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

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": "dignissimos-omnis-ipsa",
        "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": "Placeat iste blanditiis magni impedit dolor architecto quasi natus. Beatae aut vitae mollitia rerum culpa qui facere. Repellat vel quod recusandae nemo rerum laborum est. Blanditiis aliquid magni ex incidunt officia nesciunt nisi aut.",
        "user": {
            "username": "mathilde.robel",
            "uuid": "9d82d14f-0239-397d-9af0-5a14e701e78f",
            "name": "Zula Goyette",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "created_at": "2024-03-29T10:29:58.000000Z",
        "updated_at": "2024-03-29T10:29:58.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": "maiores-ut",
            "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": "Deleniti aut animi quo dolorem quisquam ab aliquid laudantium. Inventore molestiae cumque ut rerum quisquam et voluptatem. Magni qui et quidem quo repudiandae. Ipsam suscipit nostrum explicabo reiciendis.",
            "user": {
                "username": "creola68",
                "uuid": "a52c3abd-0506-34cb-b3d8-5d93d2daf7ad",
                "name": "Lois Feil",
                "created_at": "2024-03-29T10:29:59.000000Z",
                "updated_at": "2024-03-29T10:29:59.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:59.000000Z",
            "updated_at": "2024-03-29T10:29:59.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "ut-quis",
            "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": "Quos nihil enim reiciendis perferendis placeat voluptatem rerum dolor. Molestiae et illum id rerum. Et accusamus recusandae pariatur. Nulla culpa molestiae nobis alias quia esse.",
            "user": {
                "username": "keagan.sauer",
                "uuid": "2d63d13d-699d-3d0c-b771-8e2fbbaeb491",
                "name": "Julianne Herzog",
                "created_at": "2024-03-29T10:29:59.000000Z",
                "updated_at": "2024-03-29T10:29:59.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:59.000000Z",
            "updated_at": "2024-03-29T10:29:59.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": "suscipit-esse-unde",
        "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": "Ducimus facere repellendus dolor recusandae dolor vitae. Quis et fuga earum autem. In ut totam fugit autem et. At aut tempora quibusdam consectetur. Labore sit voluptatem possimus doloribus quaerat quae quos.",
        "user": {
            "username": "ora.moen",
            "uuid": "acbf576d-da9f-3847-8b3d-dc759895d656",
            "name": "Catalina Russel",
            "created_at": "2024-03-29T10:29:59.000000Z",
            "updated_at": "2024-03-29T10:29:59.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "created_at": "2024-03-29T10:29:59.000000Z",
        "updated_at": "2024-03-29T10:29:59.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/qui" \
    --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/qui"
);

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

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=qui" \
    --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": "qui",
};
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' => 'qui',
        ],
    ]
);
$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-3.webp",
            "slug": "DZTcMAI",
            "passcode": "aut",
            "custom_slug": "N8ptROb",
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "user": {
                "username": "nfeest",
                "uuid": "e32a9d01-3d22-380b-b076-95bc17a8dc36",
                "name": "Adrien Gusikowski",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "participants": [
                {
                    "id": 2,
                    "username": "corrupti_sit",
                    "color": "#95a533",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-03-29T10:29:58.000000Z",
                    "updated_at": "2024-03-29T10:29:58.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "nathan72",
                        "uuid": "919dd153-02b1-30b3-acc4-ff2d7e21bd7c",
                        "name": "Mrs. Katrine Hills II",
                        "created_at": "2024-03-29T10:29:58.000000Z",
                        "updated_at": "2024-03-29T10:29:58.000000Z",
                        "stripe_id": null,
                        "pm_type": null,
                        "pm_last_four": null,
                        "trial_ends_at": null
                    }
                },
                {
                    "id": 3,
                    "username": "ratione_maxime",
                    "color": "#1b4f85",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-03-29T10:29:58.000000Z",
                    "updated_at": "2024-03-29T10:29:58.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "rauer",
                        "uuid": "04dc2a2f-a716-3bef-ad58-9f242d565c2d",
                        "name": "Leanne Corwin",
                        "created_at": "2024-03-29T10:29:58.000000Z",
                        "updated_at": "2024-03-29T10:29:58.000000Z",
                        "stripe_id": null,
                        "pm_type": null,
                        "pm_last_four": null,
                        "trial_ends_at": null
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": "//images/environment/bg-5.webp",
            "slug": "zQZeuUe",
            "passcode": "dolorem",
            "custom_slug": "OAmQutH",
            "settings": {
                "chat": {
                    "backgroundColor": 0,
                    "deleteAfter": 30,
                    "fadeAfter": 10,
                    "isDiceExpanded": false,
                    "isDiceSorted": false,
                    "isUsernameVisible": true,
                    "isVisible": true,
                    "textColor": 16777215,
                    "textSize": "sm"
                },
                "lighting": {
                    "ambientColor": 16777215,
                    "ambientIntensity": 0.5,
                    "spotlightColor": 16777215,
                    "spotlightIntensity": 0.33
                },
                "participant": {
                    "defaultDiceTrayToGM": false
                },
                "physics": {
                    "gravity": 9.82,
                    "throwSpeed": 30
                },
                "roll": {
                    "allowPlayerRollUpdates": false,
                    "allowPlayerMoveDice": false,
                    "autoClear": 10,
                    "defaultClickBehavior": "reroll",
                    "diceSize": 1,
                    "diceLimit": 25,
                    "diceTrayColor": 0,
                    "disableDiceOutline": false,
                    "disableDiceShadows": false,
                    "disableShakingSound": false,
                    "pickUp": 1
                }
            },
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "user": {
                "username": "rtowne",
                "uuid": "3e556754-8c33-35a6-9717-19076a8a9bc3",
                "name": "Jamar Ortiz",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "participants": [
                {
                    "id": 4,
                    "username": "ad_beatae",
                    "color": "#ab8714",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-03-29T10:29:58.000000Z",
                    "updated_at": "2024-03-29T10:29:58.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "wharvey",
                        "uuid": "6c89bfa1-2dfd-3bd5-87b4-7b18f931dd5e",
                        "name": "Prof. Don Bartoletti V",
                        "created_at": "2024-03-29T10:29:58.000000Z",
                        "updated_at": "2024-03-29T10:29:58.000000Z",
                        "stripe_id": null,
                        "pm_type": null,
                        "pm_last_four": null,
                        "trial_ends_at": null
                    }
                },
                {
                    "id": 5,
                    "username": "molestiae_architecto",
                    "color": "#296909",
                    "position": 0,
                    "settings": null,
                    "created_at": "2024-03-29T10:29:58.000000Z",
                    "updated_at": "2024-03-29T10:29:58.000000Z",
                    "deleted_at": null,
                    "user": {
                        "username": "ryleigh79",
                        "uuid": "849aba93-66c4-3fde-af3d-f3be373705bf",
                        "name": "Leatha Gaylord",
                        "created_at": "2024-03-29T10:29:58.000000Z",
                        "updated_at": "2024-03-29T10:29:58.000000Z",
                        "stripe_id": null,
                        "pm_type": null,
                        "pm_last_four": null,
                        "trial_ends_at": null
                    }
                }
            ]
        }
    ]
}
                 

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

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\": \"ullam\",
    \"passcode\": \"ullam\"
}"
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": "ullam",
    "passcode": "ullam"
};

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

Example response (201):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-1.webp",
        "slug": "RdLINVa",
        "passcode": "iste",
        "custom_slug": "lEcsYRJ",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "gracie76",
            "uuid": "5c6f0d78-8f77-37ee-abcf-f7425affd353",
            "name": "Rossie Kiehn",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "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: ullam

passcode   string  optional  

Passcode required for private rooms Example: ullam

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=numquam" \
    --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": "numquam",
};
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' => 'numquam',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

                                        
                    {
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": "//images/environment/bg-5.webp",
        "slug": "bzCtMYg",
        "passcode": "repellendus",
        "custom_slug": "JTQBYwv",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "jamal59",
            "uuid": "ec27720e-b2a6-3f9f-afad-75a061ced33a",
            "name": "Gerard Willms",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "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: quaerat

Query Parameters

passcode   string  optional  

Passcode required for private room Example: numquam

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=nesciunt" \
    --form "passcode=" \
    --form "custom_slug=thamtqhxniraqna" \
    --form "bg_file_path=@/tmp/php0ZSTfv" 
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', 'nesciunt');
body.append('passcode', '');
body.append('custom_slug', 'thamtqhxniraqna');
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' => 'nesciunt'
            ],
            [
                'name' => 'passcode',
                'contents' => ''
            ],
            [
                'name' => 'custom_slug',
                'contents' => 'thamtqhxniraqna'
            ],
            [
                'name' => 'bg_file_path',
                'contents' => fopen('/tmp/php0ZSTfv', '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-3.webp",
        "slug": "yMi3AvA",
        "passcode": "voluptas",
        "custom_slug": "9N1gnXJ",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "sblick",
            "uuid": "100b6fb7-41d4-3b85-aaf1-7d3bbb6cf78e",
            "name": "Rodrick Nolan",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "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: est

Body Parameters

is_public   boolean  optional  

Public or private Example: true

name   string  optional  

Name Example: nesciunt

passcode   boolean  optional  

Passcode required for private rooms Example: false

bg_file_path   file  optional  

Must be a file. Example: /tmp/php0ZSTfv

custom_slug   string  optional  

Must not be greater than 32 characters. Example: thamtqhxniraqna

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

Update Room Rolls

requires authentication

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

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

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

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

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

Example response (200):

                                        
                    
                 

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

is_cleared   boolean  optional  

Roll value cleared Example: true

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

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' => 'quis',
        ],
    ]
);
$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-3.webp",
        "slug": "QrAO18X",
        "passcode": "debitis",
        "custom_slug": "EVfzWxv",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "brekke.nicola",
            "uuid": "e113cbc2-e5a6-373f-8df4-dc1bd2dc6b8d",
            "name": "Mr. Lonny Kovacek",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "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: sunt

Body Parameters

passcode   string  optional  

Passcode required for private room Example: quis

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/dicta" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"username\": \"natus\",
    \"color\": \"#FF0000\",
    \"passcode\": \"aspernatur\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/1/participant/dicta"
);

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

let body = {
    "username": "natus",
    "color": "#FF0000",
    "passcode": "aspernatur"
};

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/dicta',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'username' => 'natus',
            'color' => '#FF0000',
            'passcode' => 'aspernatur',
        ],
    ]
);
$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-3.webp",
        "slug": "aWXy0k8",
        "passcode": "ut",
        "custom_slug": "nAeViLB",
        "settings": {
            "chat": {
                "backgroundColor": 0,
                "deleteAfter": 30,
                "fadeAfter": 10,
                "isDiceExpanded": false,
                "isDiceSorted": false,
                "isUsernameVisible": true,
                "isVisible": true,
                "textColor": 16777215,
                "textSize": "sm"
            },
            "lighting": {
                "ambientColor": 16777215,
                "ambientIntensity": 0.5,
                "spotlightColor": 16777215,
                "spotlightIntensity": 0.33
            },
            "participant": {
                "defaultDiceTrayToGM": false
            },
            "physics": {
                "gravity": 9.82,
                "throwSpeed": 30
            },
            "roll": {
                "allowPlayerRollUpdates": false,
                "allowPlayerMoveDice": false,
                "autoClear": 10,
                "defaultClickBehavior": "reroll",
                "diceSize": 1,
                "diceLimit": 25,
                "diceTrayColor": 0,
                "disableDiceOutline": false,
                "disableDiceShadows": false,
                "disableShakingSound": false,
                "pickUp": 1
            }
        },
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "worn",
            "uuid": "204446ea-cf25-375e-a603-f7c5f452d724",
            "name": "Jermaine Franecki",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "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: dicta

slug   string   

The slug of the room. Example: accusamus

Body Parameters

username   string  optional  

Update a participant's username Example: natus

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

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

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

slug   string   

The slug of the room. Example: inventore

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\": \"ctghgmeiyfkk\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"d\": \"\\\"l1\\\"\",
        \"*\": 9,
        \"\\/\": 19
    },
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        138427.81319
    ],
    \"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": "ctghgmeiyfkk",
    "operator": {
        "k": "\"h2\"",
        "d": "\"l1\"",
        "*": 9,
        "\/": 19
    },
    "room": "HvvOlTl",
    "whisper": [
        138427.81319
    ],
    "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' => 'ctghgmeiyfkk',
                'operator' => [
                    'k' => '"h2"',
                    'd' => '"l1"',
                    '*' => 9,
                    '/' => 19,
                ],
                'room' => 'HvvOlTl',
                'whisper' => [
                    138427.81319,
                ],
                '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: false

type   string   

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

theme   string   

Theme ID Example: eius

label   string  optional  

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

value   number  optional  

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

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

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

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

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

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

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

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

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

Body Parameters

dice   object[]   

List of partial dice rolls.

uuid   string  optional  

Example: 8c579dc4-1c4e-3fdb-a8b8-6d0724a9ad13

is_cleared   boolean  optional  

Roll value cleared Example: true

is_dropped   boolean  optional  

Example: false

is_hidden   boolean  optional  

Roll value hidden Example: true

meta   object  optional  

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

Response

Response Fields

uuid   string   

The ID of the roll

direction   number   

The angle the roll was thrown (in degrees)

velocity   number   

How hard the roll was thrown

user   object   

User Object

room   object   

Room Object

values   object[]   

Roll Value Objects

total_value   number   

Sum of all roll value totals

created_at   string   

Created timestamp

updated_at   string   

Updated timestamp

Bulk Update Rolls

requires authentication

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

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

Example request:
curl --request PATCH \
    "https://dddice.com/api/1.0/roll" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"rolls\": [
        {
            \"dice\": [
                {
                    \"uuid\": \"cc8e1ab7-f4bb-399a-ab69-6cf01190886b\",
                    \"is_cleared\": true,
                    \"is_dropped\": false,
                    \"is_hidden\": false
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

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

let body = {
    "rolls": [
        {
            "dice": [
                {
                    "uuid": "cc8e1ab7-f4bb-399a-ab69-6cf01190886b",
                    "is_cleared": true,
                    "is_dropped": false,
                    "is_hidden": false
                }
            ]
        }
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'rolls' => [
                [
                    'dice' => [
                        [
                            'uuid' => 'cc8e1ab7-f4bb-399a-ab69-6cf01190886b',
                            'is_cleared' => true,
                            '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: 73aafd33-a203-3dbf-acc4-a52ad4d268b2

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

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

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\": 1,
    \"expires_at\": \"dignissimos\"
}"
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": 1,
    "expires_at": "dignissimos"
};

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

Example response (201):

                                        
                    {
    "data": {
        "limit": 5,
        "expires_at": "2024-03-29T10:29:58.000000Z",
        "uuid": "72c111d3-907b-31ab-89df-b45569566020",
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "cristobal.sauer",
            "uuid": "db1f11ea-1d32-342c-b671-17e896eb812b",
            "name": "Janie Brakus",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "theme": {
            "slug": "officia-reprehenderit",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Prof.",
            "description": "Alias earum omnis cum laborum. Non corrupti omnis ipsum consequatur tempora dignissimos accusantium. Vero provident provident qui temporibus sunt. Asperiores voluptatibus dolorem dolorem accusantium placeat hic delectus velit. Autem omnis in et ex eius ea.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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: 1

expires_at   string  optional  

Expiration date or datetime Example: dignissimos

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

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/aut',
    [
        '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-03-29T10:29:58.000000Z",
        "uuid": "d9435a53-71c4-3d8e-9746-7bf72b303b08",
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "user": {
            "username": "tyler37",
            "uuid": "74bc07db-9618-3dee-842f-508caab70482",
            "name": "Prof. Mckenzie Cronin I",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "theme": {
            "slug": "eius-esse-harum",
            "is_available": true,
            "is_extendable": true,
            "is_discoverable": true,
            "name": "Prof.",
            "description": "Ea nam illo necessitatibus reiciendis corporis cupiditate. Fuga commodi ab quasi maiores est laudantium. Porro distinctio numquam et sequi voluptate nostrum non.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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: aut

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": "Collin Schaefer",
        "username": "arno30",
        "uuid": "b3aaffb6-386f-3f42-86af-667f2b2b8f20",
        "updated_at": "2024-03-29T10:29:59.000000Z",
        "created_at": "2024-03-29T10:29:59.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": "/images/environment/bg-1.webp",
                "passcode": "repellat",
                "slug": "F2EjEH2",
                "custom_slug": "yvMFfNe",
                "settings": {
                    "chat": {
                        "textSize": "sm",
                        "fadeAfter": 10,
                        "isVisible": true,
                        "textColor": 16777215,
                        "deleteAfter": 30,
                        "isDiceSorted": false,
                        "isDiceExpanded": false,
                        "backgroundColor": 0,
                        "isUsernameVisible": true
                    },
                    "roll": {
                        "pickUp": 1,
                        "diceSize": 1,
                        "autoClear": 10,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "allowPlayerMoveDice": false,
                        "disableShakingSound": false,
                        "defaultClickBehavior": "reroll",
                        "allowPlayerRollUpdates": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "spotlightColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    }
                },
                "created_at": "2024-03-29T10:29:59.000000Z",
                "updated_at": "2024-03-29T10:29:59.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": "Trevor Kris",
        "username": "natalia57",
        "uuid": "56f0d9cc-8a6a-3cbe-94c5-f7563fc8fdcf",
        "updated_at": "2024-03-29T10:29:59.000000Z",
        "created_at": "2024-03-29T10:29:59.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": "/images/environment/bg-1.webp",
                "passcode": "aperiam",
                "slug": "WIRDVMh",
                "custom_slug": "kOhYmss",
                "settings": {
                    "chat": {
                        "textSize": "sm",
                        "fadeAfter": 10,
                        "isVisible": true,
                        "textColor": 16777215,
                        "deleteAfter": 30,
                        "isDiceSorted": false,
                        "isDiceExpanded": false,
                        "backgroundColor": 0,
                        "isUsernameVisible": true
                    },
                    "roll": {
                        "pickUp": 1,
                        "diceSize": 1,
                        "autoClear": 10,
                        "diceLimit": 25,
                        "diceTrayColor": 0,
                        "disableDiceOutline": false,
                        "disableDiceShadows": false,
                        "allowPlayerMoveDice": false,
                        "disableShakingSound": false,
                        "defaultClickBehavior": "reroll",
                        "allowPlayerRollUpdates": false
                    },
                    "physics": {
                        "gravity": 9.82,
                        "throwSpeed": 30
                    },
                    "lighting": {
                        "ambientColor": 16777215,
                        "spotlightColor": 16777215,
                        "ambientIntensity": 0.5,
                        "spotlightIntensity": 0.33
                    },
                    "participant": {
                        "defaultDiceTrayToGM": false
                    }
                },
                "created_at": "2024-03-29T10:29:59.000000Z",
                "updated_at": "2024-03-29T10:29:59.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\": \"in\"
}"
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": "in"
};

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

Delete API Key

requires authentication

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

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

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

const params = {
    "filter": "suscipit",
    "ids": "hic",
};
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": 7033386.676074699,
    "filter": "dolore"
};

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' => 'suscipit',
            'ids' => 'hic',
        ],
        'json' => [
            'limit' => 7033386.676074699,
            'filter' => 'dolore',
        ],
    ]
);
$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": "iusto-eius-quia",
            "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": "Reprehenderit laudantium voluptatem voluptatem. Voluptatem cum qui est voluptatem quis ullam natus. Voluptate quasi blanditiis consequatur repellendus deleniti iusto.",
            "user": {
                "username": "jovanny.braun",
                "uuid": "817d0c50-c7c3-3e7b-a669-ceec83fc47e2",
                "name": "Chester Walsh",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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": "nostrum-commodi-commodi",
            "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": "Fuga laboriosam ducimus commodi dolor error rerum. Veniam voluptatibus dignissimos velit est ut inventore. Sint est dolor perspiciatis.",
            "user": {
                "username": "gharris",
                "uuid": "adcf12dd-d4ca-3649-a459-5d6d7fc391f7",
                "name": "Ofelia Runolfsdottir",
                "created_at": "2024-03-29T10:29:58.000000Z",
                "updated_at": "2024-03-29T10:29:58.000000Z",
                "stripe_id": null,
                "pm_type": null,
                "pm_last_four": null,
                "trial_ends_at": null
            },
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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: suscipit

ids   string  optional  

Comma seperated list of themes IDs to get Example: hic

Body Parameters

limit   number  optional  

Example: 7033386.6760747

filter   string  optional  

Example: dolore

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

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' => 'veniam',
        ],
    ]
);
$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": "doloremque-quia-ad",
        "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": "Tempore eveniet modi maxime cumque nostrum sit. Sed reiciendis natus nobis placeat. Modi sed quibusdam ut soluta quaerat incidunt hic sed. Nisi quia molestiae quibusdam corporis et veniam dolores debitis. Eos error et dolor in ea facere minus.",
        "user": {
            "username": "kub.esperanza",
            "uuid": "8e7d7c29-4719-3cd2-bfd5-790fe3c7826e",
            "name": "Mrs. Marquise Yundt Sr.",
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.000000Z",
            "stripe_id": null,
            "pm_type": null,
            "pm_last_four": null,
            "trial_ends_at": null
        },
        "created_at": "2024-03-29T10:29:58.000000Z",
        "updated_at": "2024-03-29T10:29:58.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: veniam

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

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

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": "Afton Brekke",
        "description": "Delectus in at dolore autem cumque eos quos magnam. Quas aut sit est modi commodi. Possimus ut dignissimos distinctio est at esse exercitationem.",
        "sku": "DDD-7014",
        "is_on_sale": false,
        "updated_at": "2024-03-29T10:29:58.000000Z",
        "created_at": "2024-03-29T10:29:58.000000Z",
        "id": 11,
        "merchant": {
            "id": 11,
            "name": "Mrs. Anabelle Paucek PhD",
            "description": "Unde quae ea animi assumenda. Laboriosam sapiente voluptatum enim voluptatem itaque vitae. Doloribus impedit consequuntur atque esse quod ab.",
            "merchant_commission": 51,
            "logo_path": null,
            "is_contracts_complete": 0,
            "is_tax_documents_complete": 0,
            "sku_prefix": "wks",
            "contact_email": "heloise.ebert@gmail.com",
            "paypal_email": "bret.jakubowski@hotmail.com",
            "website_url": null,
            "applicant_type": null,
            "is_us_citizen": null,
            "applicant_name": null,
            "created_at": "2024-03-29T10:29:58.000000Z",
            "updated_at": "2024-03-29T10:29:58.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: ab

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

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

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

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

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

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

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

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

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

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