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.

Base URL

https://dddice.com

Authenticating requests

This API is authenticated by sending 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.

Dice Box

API for managing themes in your Digital Dice Box.

List Dice Box Collection

requires authentication

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

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

const params = {
    "filter": "sint",
    "ids": "est",
};
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/dice-box',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter'=> 'sint',
            'ids'=> 'est',
        ],
    ]
);
$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": "cumque_velit",
            "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": "Sed omnis et vel quos quidem aut. Totam excepturi consequuntur fuga necessitatibus nostrum. Nulla illo et eius natus saepe odio atque. Similique asperiores est sed eos quas nam occaecati.",
            "user": {
                "username": "quia_sint",
                "uuid": "acff8389-742d-11ed-a29d-002248ac35ee",
                "name": "Florence Cole",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.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": "in_eveniet",
            "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": "Sunt reiciendis quia beatae qui ipsa. Sint quia itaque quis nihil ex error incidunt. Nihil porro laborum aut dolorem non laboriosam doloribus. Qui amet aut officiis sunt aliquam sit.",
            "user": {
                "username": "omnis_maxime",
                "uuid": "ad00f15b-742d-11ed-a29d-002248ac35ee",
                "name": "Hailee Mosciski",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    ]
}
 

Request      

GET api/1.0/dice-box

Query Parameters

filter  string optional  

Filter themes by name

ids  string optional  

Comma seperated list of themes IDs to get

Get Dice Box Theme

requires authentication

Get information about a theme in your Digital Dice Box.

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

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

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

Example response (200):


{
    "data": {
        "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": "qui_qui",
        "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": "Ut eum autem minus amet voluptatem labore. Quasi et quia dolorum. Molestias nulla cum ab laborum veniam.",
        "user": {
            "username": "cum_natus",
            "uuid": "ad04d84a-742d-11ed-a29d-002248ac35ee",
            "name": "Jermain Jast",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "created_at": "2022-12-04T23:45:04.000000Z",
        "updated_at": "2022-12-04T23:45:04.000000Z"
    }
}
 

Request      

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

URL Parameters

slug  string  

id  string  

The ID of the theme.

Update Dice Box Theme

requires authentication

Upgrade theme version in your Digital Dice Box.

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

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

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://dddice.com/api/1.0/dice-box/velit',
    [
        '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": "pariatur_tempore",
        "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": "Labore possimus consectetur aut quod. Quidem nihil repudiandae aut numquam. Labore eos aut ut harum rerum.",
        "user": {
            "username": "voluptas_aut",
            "uuid": "ad076fd7-742d-11ed-a29d-002248ac35ee",
            "name": "Leola Leuschke",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "created_at": "2022-12-04T23:45:04.000000Z",
        "updated_at": "2022-12-04T23:45:04.000000Z"
    }
}
 

Request      

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

URL Parameters

slug  string  

id  string  

The ID of the theme.

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

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/dolorum',
    [
        '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}

URL Parameters

slug  string  

id  string  

The ID of the theme.

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\": \"necessitatibus\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"p\": \"a\",
        \"rr\": \"vitae\",
        \"ro\": \"recusandae\",
        \"ra\": \"voluptas\",
        \"e\": \"earum\",
        \"mi\": 32.8792349,
        \"ma\": 26692.03
    },
    \"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\",
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        12612.418404041
    ]
}"
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": "necessitatibus",
    "operator": {
        "k": "\"h2\"",
        "p": "a",
        "rr": "vitae",
        "ro": "recusandae",
        "ra": "voluptas",
        "e": "earum",
        "mi": 32.8792349,
        "ma": 26692.03
    },
    "label": "\"Longbow damage with Hunter's Mark\"",
    "room": "HvvOlTl",
    "whisper": [
        12612.418404041
    ]
};

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' => 'necessitatibus',
                'operator' => [
                    'k' => '"h2"',
                    'p' => 'a',
                    'rr' => 'vitae',
                    'ro' => 'recusandae',
                    'ra' => 'voluptas',
                    'e' => 'earum',
                    'mi' => 32.8792349,
                    'ma' => 26692.03,
                ],
                'label' => '"Longbow damage with Hunter\'s Mark"',
                'room' => 'HvvOlTl',
                'whisper' => [
                    12612.418404041,
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):


{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "neque_molestiae",
            "uuid": "acd7ee33-742d-11ed-a29d-002248ac35ee",
            "name": "Prof. Casandra Rippin DVM",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "aliquid",
            "slug": "Mv02ZzF",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 13,
                    "username": "corporis_eos",
                    "color": "#f10fa0",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:04.000000Z",
                    "updated_at": "2022-12-04T23:45:04.000000Z",
                    "user": {
                        "username": "nihil_consequatur",
                        "uuid": "acd92cfd-742d-11ed-a29d-002248ac35ee",
                        "name": "Molly Schulist",
                        "created_at": "2022-12-04T23:45:04.000000Z",
                        "updated_at": "2022-12-04T23:45:04.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "acda1269-742d-11ed-a29d-002248ac35ee",
                "is_hidden": false,
                "is_user_value": true,
                "is_visible": true,
                "is_cleared": true,
                "is_dropped": false,
                "value": 1,
                "value_to_display": "1",
                "type": "d8",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        ],
        "total_value": 1,
        "equation": "1d8",
        "external_id": null,
        "participants": []
    }
}
 

Request      

POST api/1.0/roll

Body Parameters

dice  object[]  

List of dice rolls.

dice.theme  string  

Theme ID

dice.type  string  

Type of dice. Valid types are D20, D12, D10, D8, D6, and D4.

dice.value  number optional  

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

dice.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.

external_id  string optional  

An ID for this roll generated by an external system.

operator  object optional  

Optional operators to manipulate the final value of the dice

operator.k  string optional  

Keep all matched values.

operator.p  string optional  

Drop all matched values (Not yet implemented)

operator.rr  string optional  

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

operator.ro  string optional  

Reroll all matched values once (Not yet implemented)

operator.ra  string optional  

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

operator.e  string optional  

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

operator.mi  number optional  

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

operator.ma  number optional  

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

label  string optional  

Optional label for this roll.

room  string optional  

Room slug.

whisper  number[] optional  

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

Response

Response Fields

uuid  string  

The ID of the roll

direction  number  

The angle the roll was thrown (in degrees)

velocity  number  

How hard the roll was thrown

user  object  

User Object

room  object  

Room Object

values  object[]  

Roll Value Objects

operator  object  

Roll Operators (if any were used)

equation  string  

d20 dice syntax equation

total_value  number  

Sum of all roll value totals

created_at  string  

Created timestamp

updated_at  string  

Updated timestamp

Get a Roll

requires authentication

Fetch roll information including the user and optional room information

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

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

Example response (200):


{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "velit_provident",
            "uuid": "acdd6ca9-742d-11ed-a29d-002248ac35ee",
            "name": "Kaitlin Macejkovic",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "modi",
            "slug": "0DYHsqG",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 14,
                    "username": "qui_id",
                    "color": "#d491cb",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:04.000000Z",
                    "updated_at": "2022-12-04T23:45:04.000000Z",
                    "user": {
                        "username": "consequuntur_et",
                        "uuid": "acde6907-742d-11ed-a29d-002248ac35ee",
                        "name": "Ephraim Hill DVM",
                        "created_at": "2022-12-04T23:45:04.000000Z",
                        "updated_at": "2022-12-04T23:45:04.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "acdf4782-742d-11ed-a29d-002248ac35ee",
                "is_hidden": true,
                "is_user_value": true,
                "is_visible": true,
                "is_cleared": true,
                "is_dropped": false,
                "value": 1,
                "value_to_display": "1",
                "type": "d6",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        ],
        "total_value": 1,
        "equation": "1d6",
        "external_id": null,
        "participants": []
    }
}
 

Request      

GET api/1.0/roll/{id}

URL Parameters

id  string  

Roll ID

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

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


{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "vero_voluptas",
            "uuid": "ace2d49e-742d-11ed-a29d-002248ac35ee",
            "name": "Deondre Bergnaum",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "voluptatem",
            "slug": "RYVuW32",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 15,
                    "username": "corporis_quia",
                    "color": "#13334d",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:04.000000Z",
                    "updated_at": "2022-12-04T23:45:04.000000Z",
                    "user": {
                        "username": "quas_quas",
                        "uuid": "ace463f8-742d-11ed-a29d-002248ac35ee",
                        "name": "Karli Lemke",
                        "created_at": "2022-12-04T23:45:04.000000Z",
                        "updated_at": "2022-12-04T23:45:04.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "ace54416-742d-11ed-a29d-002248ac35ee",
                "is_hidden": false,
                "is_user_value": false,
                "is_visible": true,
                "is_cleared": true,
                "is_dropped": false,
                "value": 5,
                "value_to_display": "5",
                "type": "d6",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        ],
        "total_value": 5,
        "equation": "1d6",
        "external_id": null,
        "participants": []
    }
}
 

Request      

PATCH api/1.0/roll/{id}

URL Parameters

id  string  

Roll ID

Body Parameters

dice  object[]  

List of partial dice rolls.

dice.is_visible  boolean optional  

Roll value hidden

dice.is_cleared  boolean optional  

Roll value cleared

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\": [
        {
            \"uuid\": \"1\",
            \"dice\": [
                {
                    \"uuid\": \"1\",
                    \"is_hidden\": true
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://dddice.com/api/1.0/roll"
);

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

let body = {
    "rolls": [
        {
            "uuid": "1",
            "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',
    [
        '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' => [
                    'uuid' => [
                        '1',
                        '1',
                    ],
                    'dice' => [
                        [
                            $o[1],
                        ],
                    ],
                    'is_hidden' => [
                        1 => true,
                    ],
                ],
            ],
            [
                'rolls' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "user": {
                "username": "ut_est",
                "uuid": "ace97b7a-742d-11ed-a29d-002248ac35ee",
                "name": "Stefan Koch",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "quae",
                "slug": "dEO7F71",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 16,
                        "username": "et_accusantium",
                        "color": "#a961bb",
                        "position": 0,
                        "created_at": "2022-12-04T23:45:04.000000Z",
                        "updated_at": "2022-12-04T23:45:04.000000Z",
                        "user": {
                            "username": "laborum_qui",
                            "uuid": "acea7263-742d-11ed-a29d-002248ac35ee",
                            "name": "Mr. Alvis Beatty IV",
                            "created_at": "2022-12-04T23:45:04.000000Z",
                            "updated_at": "2022-12-04T23:45:04.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "aceb4340-742d-11ed-a29d-002248ac35ee",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 11,
                    "value_to_display": "11",
                    "type": "d12",
                    "created_at": "2022-12-04T23:45:04.000000Z",
                    "updated_at": "2022-12-04T23:45:04.000000Z"
                }
            ],
            "total_value": 11,
            "equation": "1d12",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "user": {
                "username": "harum_qui",
                "uuid": "acecd2ce-742d-11ed-a29d-002248ac35ee",
                "name": "Dr. Nicola Legros",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "mollitia",
                "slug": "GVOBXoP",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 17,
                        "username": "voluptatem_consequatur",
                        "color": "#d23b5d",
                        "position": 0,
                        "created_at": "2022-12-04T23:45:04.000000Z",
                        "updated_at": "2022-12-04T23:45:04.000000Z",
                        "user": {
                            "username": "quos_maxime",
                            "uuid": "acedaaa9-742d-11ed-a29d-002248ac35ee",
                            "name": "Marquise Cummings",
                            "created_at": "2022-12-04T23:45:04.000000Z",
                            "updated_at": "2022-12-04T23:45:04.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "acee7b90-742d-11ed-a29d-002248ac35ee",
                    "is_hidden": false,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 14,
                    "value_to_display": "14",
                    "type": "d20",
                    "created_at": "2022-12-04T23:45:04.000000Z",
                    "updated_at": "2022-12-04T23:45:04.000000Z"
                }
            ],
            "total_value": 14,
            "equation": "1d20",
            "external_id": null,
            "participants": []
        }
    ]
}
 

Request      

PATCH api/1.0/roll

Body Parameters

rolls  object[]  

List of rolls.

rolls.uuid  required optional  

Roll ID

rolls.dice  object[]  

List of partial dice rolls.

rolls.dice.is_visible  boolean optional  

Roll value hidden

rolls.dice.is_cleared  boolean optional  

Roll value cleared

Room

API for managing rooms.

List Rooms

requires authentication

List all rooms created or joined by a user

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

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

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

Example response (200):


{
    "type": "room[]",
    "data": [
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "NxT94C2",
            "passcode": "quos",
            "updated_at": "2022-12-04T23:45:03.000000Z",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "user": {
                "username": "repellendus_nam",
                "uuid": "acb1f130-742d-11ed-a29d-002248ac35ee",
                "name": "Dr. Grover Huels",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            },
            "participants": [
                {
                    "id": 2,
                    "username": "qui_labore",
                    "color": "#32a62a",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z",
                    "user": {
                        "username": "qui_aut",
                        "uuid": "acb25b29-742d-11ed-a29d-002248ac35ee",
                        "name": "Prof. Clemens Schmeler",
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z"
                    }
                },
                {
                    "id": 3,
                    "username": "et_omnis",
                    "color": "#24c0aa",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z",
                    "user": {
                        "username": "quo_recusandae",
                        "uuid": "acb2babd-742d-11ed-a29d-002248ac35ee",
                        "name": "Miss Elisabeth Kshlerin DDS",
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "ijrDRWn",
            "passcode": "ipsum",
            "updated_at": "2022-12-04T23:45:03.000000Z",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "user": {
                "username": "fuga_suscipit",
                "uuid": "acb4b5f6-742d-11ed-a29d-002248ac35ee",
                "name": "Gabe Auer",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            },
            "participants": [
                {
                    "id": 4,
                    "username": "neque_ut",
                    "color": "#d6a7da",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z",
                    "user": {
                        "username": "officiis_ratione",
                        "uuid": "acb509b8-742d-11ed-a29d-002248ac35ee",
                        "name": "Prof. Theron Pollich Sr.",
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z"
                    }
                },
                {
                    "id": 5,
                    "username": "sint_quos",
                    "color": "#599f9c",
                    "position": 0,
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z",
                    "user": {
                        "username": "nesciunt_harum",
                        "uuid": "acb56314-742d-11ed-a29d-002248ac35ee",
                        "name": "Dr. Niko O'Connell",
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z"
                    }
                }
            ]
        }
    ]
}
 

Request      

GET api/1.0/room

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 "{
    \"name\": \"molestiae\",
    \"is_public\": true,
    \"passcode\": \"maiores\"
}"
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 = {
    "name": "molestiae",
    "is_public": true,
    "passcode": "maiores"
};

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' => [
            'name' => 'molestiae',
            'is_public' => true,
            'passcode' => 'maiores',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "wi_MgpT",
        "passcode": "eos",
        "updated_at": "2022-12-04T23:45:03.000000Z",
        "created_at": "2022-12-04T23:45:03.000000Z",
        "user": {
            "username": "ratione_quia",
            "uuid": "acb92792-742d-11ed-a29d-002248ac35ee",
            "name": "Prof. Guiseppe Wiegand",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "updated_at": "2022-12-04T23:45:03.000000Z"
        },
        "participants": [
            {
                "id": 6,
                "username": "quis_dolores",
                "color": "#289302",
                "position": 0,
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            }
        ]
    }
}
 

Request      

POST api/1.0/room

Body Parameters

name  string optional  

Name

is_public  boolean optional  

Public or private

passcode  string optional  

Passcode required for private rooms

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

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

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

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

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "SPNmyVS",
        "passcode": "eos",
        "updated_at": "2022-12-04T23:45:03.000000Z",
        "created_at": "2022-12-04T23:45:03.000000Z",
        "user": {
            "username": "et_repellendus",
            "uuid": "acbc2e67-742d-11ed-a29d-002248ac35ee",
            "name": "Jovan Kreiger",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "updated_at": "2022-12-04T23:45:03.000000Z"
        },
        "participants": [
            {
                "id": 7,
                "username": "magnam_nesciunt",
                "color": "#fafad1",
                "position": 0,
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            }
        ]
    }
}
 

Request      

GET api/1.0/room/{slug}

URL Parameters

slug  string  

The slug of the room.

Query Parameters

passcode  string optional  

Passcode required for private room

Update a Room

requires authentication

Update the name of a room

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

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

let body = {
    "name": "veniam",
    "is_public": false,
    "passcode": 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/dolore',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'veniam',
            'is_public' => false,
            'passcode' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "LY6LwsG",
        "passcode": "fuga",
        "updated_at": "2022-12-04T23:45:03.000000Z",
        "created_at": "2022-12-04T23:45:03.000000Z",
        "user": {
            "username": "qui_inventore",
            "uuid": "acbf49db-742d-11ed-a29d-002248ac35ee",
            "name": "Anna Roberts",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "updated_at": "2022-12-04T23:45:03.000000Z"
        },
        "participants": [
            {
                "id": 8,
                "username": "sed_eaque",
                "color": "#0b3208",
                "position": 0,
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            }
        ]
    }
}
 

Request      

PATCH api/1.0/room/{slug}

URL Parameters

slug  string  

The slug of the room.

Body Parameters

name  string optional  

Name

is_public  boolean optional  

Public or private

passcode  boolean optional  

Passcode required for private rooms

Delete a Room

requires authentication

Delete a room you own.

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

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

Example response (204):

[Empty response]
 

Request      

DELETE api/1.0/room/{slug}

URL Parameters

slug  string  

The slug of the room.

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


{
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-12-04T23:45:03.000000Z",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "user": {
                "username": "sit_quos",
                "uuid": "acc352a8-742d-11ed-a29d-002248ac35ee",
                "name": "May Bins",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sed",
                "slug": "_UwGEvM",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 9,
                        "username": "dolores_repellat",
                        "color": "#f0a444",
                        "position": 0,
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z",
                        "user": {
                            "username": "voluptatum_possimus",
                            "uuid": "acc44209-742d-11ed-a29d-002248ac35ee",
                            "name": "Myriam Greenfelder",
                            "created_at": "2022-12-04T23:45:03.000000Z",
                            "updated_at": "2022-12-04T23:45:03.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "acc555be-742d-11ed-a29d-002248ac35ee",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 6,
                    "value_to_display": "6",
                    "type": "d12",
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z"
                }
            ],
            "total_value": 6,
            "equation": "1d12",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-12-04T23:45:03.000000Z",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "user": {
                "username": "labore_distinctio",
                "uuid": "acc6fe90-742d-11ed-a29d-002248ac35ee",
                "name": "Jettie Schumm I",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "consequatur",
                "slug": "_IcRdD4",
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 10,
                        "username": "reiciendis_voluptatem",
                        "color": "#038647",
                        "position": 0,
                        "created_at": "2022-12-04T23:45:03.000000Z",
                        "updated_at": "2022-12-04T23:45:03.000000Z",
                        "user": {
                            "username": "ab_et",
                            "uuid": "acc7e256-742d-11ed-a29d-002248ac35ee",
                            "name": "Dr. Tess Sauer",
                            "created_at": "2022-12-04T23:45:03.000000Z",
                            "updated_at": "2022-12-04T23:45:03.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "acc8bb06-742d-11ed-a29d-002248ac35ee",
                    "is_hidden": true,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 7,
                    "value_to_display": "7",
                    "type": "d8",
                    "created_at": "2022-12-04T23:45:03.000000Z",
                    "updated_at": "2022-12-04T23:45:03.000000Z"
                }
            ],
            "total_value": 7,
            "equation": "1d8",
            "external_id": null,
            "participants": []
        }
    ]
}
 

Request      

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

URL Parameters

slug  integer  

Body Parameters

dice  object  

Partial dice roll.

dice.is_visible  boolean optional  

Roll value hidden

dice.is_cleared  boolean optional  

Roll value cleared

Join a Room

requires authentication

Join a room as a participant

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

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

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

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

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "ysYc0ul",
        "passcode": "et",
        "updated_at": "2022-12-04T23:45:03.000000Z",
        "created_at": "2022-12-04T23:45:03.000000Z",
        "user": {
            "username": "commodi_consectetur",
            "uuid": "acccfd6d-742d-11ed-a29d-002248ac35ee",
            "name": "Mrs. Marcelle Rath I",
            "created_at": "2022-12-04T23:45:03.000000Z",
            "updated_at": "2022-12-04T23:45:03.000000Z"
        },
        "participants": [
            {
                "id": 11,
                "username": "sed_beatae",
                "color": "#0898b3",
                "position": 0,
                "created_at": "2022-12-04T23:45:03.000000Z",
                "updated_at": "2022-12-04T23:45:03.000000Z"
            }
        ]
    }
}
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

Body Parameters

passcode  string optional  

Passcode required for private room

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

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

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

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

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "-H98R-L",
        "passcode": "rerum",
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "eos_suscipit",
            "uuid": "acd05368-742d-11ed-a29d-002248ac35ee",
            "name": "Vanessa Howell",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "participants": [
            {
                "id": 12,
                "username": "accusantium_aut",
                "color": "#216226",
                "position": 0,
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        ]
    }
}
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

id  string  

Participant ID

Body Parameters

passcode  string optional  

Passcode required for private room

username  string optional  

Update a participant's username

color  string optional  

Update a participant's color.

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/et/participant/consequatur" \
    --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/et/participant/consequatur"
);

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

Example response (204):

[Empty response]
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

id  string  

The ID of the participant.

Share Dice

API for managing share requests.

List Share Requests

requires authentication

Fetch a list of active and inactive share requests.

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

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

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

Example response (200):


{
    "type": "share[]",
    "data": [
        {
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "user": {
                "username": "harum_eaque",
                "uuid": "acf1e9d3-742d-11ed-a29d-002248ac35ee",
                "name": "Dr. Shemar Fadel III",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "theme": {
                "slug": "est_aliquid",
                "is_available": true,
                "name": "Dr.",
                "description": "Molestias qui aperiam quia quidem repudiandae quos officiis. Eum blanditiis accusantium quo totam. Aut nulla aliquid non hic.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        },
        {
            "updated_at": "2022-12-04T23:45:04.000000Z",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "user": {
                "username": "aut_laudantium",
                "uuid": "acf35a7b-742d-11ed-a29d-002248ac35ee",
                "name": "Mrs. Leonor Beahan DDS",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "theme": {
                "slug": "voluptas_a",
                "is_available": true,
                "name": "Mr.",
                "description": "Molestias error aut magni aut qui ut. Nemo ipsam quo quis libero ab quas laborum.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            }
        }
    ]
}
 

Request      

GET api/1.0/share

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

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

Example response (201):


{
    "data": {
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "mollitia_rerum",
            "uuid": "acf5983a-742d-11ed-a29d-002248ac35ee",
            "name": "Jonathon Jacobi",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "theme": {
            "slug": "hic_et",
            "is_available": true,
            "name": "Prof.",
            "description": "Consequatur quidem est ut eos. Ex laboriosam expedita laudantium. Voluptatem laborum voluptatem dolore facere est. Eos unde soluta eaque deleniti.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    }
}
 

Request      

POST api/1.0/share

Body Parameters

slug  string  

Theme slug.

Get Share Request

requires authentication

Get information about a share request.

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

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

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

Example response (200):


{
    "data": {
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "fugiat_numquam",
            "uuid": "acf7aacf-742d-11ed-a29d-002248ac35ee",
            "name": "Dr. Donato Parker",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "theme": {
            "slug": "voluptates_velit",
            "is_available": true,
            "name": "Mrs.",
            "description": "Et voluptatum id consequuntur et et qui architecto. Facere consequatur modi occaecati itaque voluptatibus. Ea officia qui consequatur occaecati repudiandae.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    }
}
 

Request      

GET api/1.0/share/{id}

URL Parameters

id  string  

The ID of the share request

Update Share Request

requires authentication

Update information about a share request.

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

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

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


{
    "data": {
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "quia_magni",
            "uuid": "acf9b78d-742d-11ed-a29d-002248ac35ee",
            "name": "Miss Stephanie Hill",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "theme": {
            "slug": "sed_unde",
            "is_available": true,
            "name": "Mr.",
            "description": "Qui consectetur quia sapiente. Qui dolor dolor hic vel. Recusandae eaque et id dicta qui deleniti maxime. Necessitatibus velit corrupti sint repudiandae voluptatem earum architecto nulla.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    }
}
 

Request      

PATCH api/1.0/share/{id}

URL Parameters

id  string  

The ID of the share request

Delete Share Request

requires authentication

Delete a share request which will invalidate any shared URLs

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

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

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

Example response (204):

[Empty response]
 

Request      

DELETE api/1.0/share/{id}

URL Parameters

id  string  

The ID of the share request

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

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

Example response (200):


{
    "data": {
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "user": {
            "username": "harum_magni",
            "uuid": "acfca525-742d-11ed-a29d-002248ac35ee",
            "name": "Osvaldo Ferry",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "theme": {
            "slug": "ut_odio",
            "is_available": true,
            "name": "Prof.",
            "description": "Ad quia fuga aut possimus soluta adipisci. Eius vero perspiciatis id molestiae. Velit repudiandae aspernatur aliquam est doloremque quaerat ratione.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    }
}
 

Request      

POST api/1.0/share/{id}

URL Parameters

id  string  

The ID of the share request

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": "iure_consequuntur",
            "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": "Quibusdam amet ex ipsum ullam. Qui molestiae aspernatur eligendi et et et minima. Minima totam enim enim consequatur quia laboriosam cum.",
            "user": {
                "username": "ut_voluptatem",
                "uuid": "ad0c6e27-742d-11ed-a29d-002248ac35ee",
                "name": "Therese Kris",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.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": "rerum_ea",
            "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": "Aut ipsum in repudiandae sed molestiae saepe voluptas. Amet laboriosam suscipit nulla optio sunt et voluptas. Ut cum aut vero rem odio id. Molestias ratione neque soluta velit reiciendis modi sequi.",
            "user": {
                "username": "voluptates_rem",
                "uuid": "ad0dc9ab-742d-11ed-a29d-002248ac35ee",
                "name": "Mrs. Thelma Casper",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    ]
}
 

Request      

GET api/1.0/theme

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=et" \
    --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=vitae" \
    --form "assets[]=@/tmp/php5Ky2xq" 
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', 'et');
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', 'vitae');
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' => 'et'
            ],
            [
                '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' => 'vitae'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/php5Ky2xq', '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": "ipsa_et",
        "name": "Prof.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Et ut debitis et sit. Neque magni non laudantium voluptas illo. Voluptatem laboriosam laudantium deserunt et omnis error vel.",
        "user": {
            "username": "assumenda_id",
            "uuid": "ad13f621-742d-11ed-a29d-002248ac35ee",
            "name": "Kamren Rohan Jr.",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "created_at": "2022-12-04T23:45:04.000000Z",
        "updated_at": "2022-12-04T23:45:04.000000Z"
    }
}
 

Request      

POST api/1.0/theme

Body Parameters

frag_shader  string optional  

Custom fragment shader

manifest  string  

Theme manifest configuration

manifest.api_version  string  

API compatibility version, always 1.0 for now no-example

manifest.description  string  

Theme description no-example

manifest.id  string  

A unique machine readable id in slug format no-example

manifest.label  labelObject  

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

manifest.label.background_color  string  

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

manifest.label.color  string  

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

manifest.name  string  

Name of the theme no-example

manifest.version  string  

Semver 2.0.0 version number no-example

manifest.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

manifest.available_dice[].id  string optional  

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

manifest.available_dice[].notation  string optional  

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

manifest.available_dice[].type  string optional  

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

manifest.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

manifest.meshes  object optional  

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

manifest.sizes  object optional  

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

manifest.sounds  soundObject[] optional  

Sounds that play no-example

manifest.sounds[].<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.

manifest.sounds[].on  string optional  

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

manifest.sounds[].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

manifest.textures  textureObject[] optional  

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

manifest.textures[].binding  string optional  

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

manifest.textures[].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

manifest.uniforms  object optional  

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

manifest.uniforms.<uniform-name>  object  

manifest.uniforms.<uniform-name>.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

manifest.uniforms.<uniform-name>.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

manifest.uniforms.<uniform-name>.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

manifest.uniforms.<uniform-name>.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}

manifest.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

manifest.values.<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

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": "rerum_et",
        "name": "Prof.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Repellat nulla doloribus aut sequi exercitationem. Mollitia illo quia officia sit. Ab omnis soluta ut possimus recusandae nemo id.",
        "user": {
            "username": "qui_reprehenderit",
            "uuid": "ad17043c-742d-11ed-a29d-002248ac35ee",
            "name": "Yoshiko Huels",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "created_at": "2022-12-04T23:45:04.000000Z",
        "updated_at": "2022-12-04T23:45:04.000000Z"
    }
}
 

Request      

GET api/1.0/theme/{id}

URL Parameters

id  string  

The ID of the theme.

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}

URL Parameters

id  string  

The ID of the theme.

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": "a_sit",
            "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": "Et ipsum suscipit impedit laudantium. Et ut inventore sint voluptatem laborum. Eum non commodi asperiores qui omnis vitae. Ipsa est temporibus est quos.",
            "user": {
                "username": "placeat_tenetur",
                "uuid": "ad1a7484-742d-11ed-a29d-002248ac35ee",
                "name": "Miss Verna West II",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.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": "error_qui",
            "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": "Sunt architecto consequuntur qui est. Animi et exercitationem veniam enim. In qui iste molestias qui aliquam id.",
            "user": {
                "username": "ratione_dolorum",
                "uuid": "ad1bcd29-742d-11ed-a29d-002248ac35ee",
                "name": "Noemie Stehr",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z"
            },
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        }
    ]
}
 

Request      

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

URL Parameters

id  string  

The ID of the theme.

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": "quaerat_facilis",
        "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": "Impedit repellat sint dicta voluptatem ea laborum. Accusamus qui quod est ea deleniti sed deleniti. Accusamus libero qui temporibus aut assumenda tenetur enim.",
        "user": {
            "username": "dolor_saepe",
            "uuid": "ad1ef9d8-742d-11ed-a29d-002248ac35ee",
            "name": "Garry Dicki",
            "created_at": "2022-12-04T23:45:04.000000Z",
            "updated_at": "2022-12-04T23:45:04.000000Z"
        },
        "created_at": "2022-12-04T23:45:04.000000Z",
        "updated_at": "2022-12-04T23:45:04.000000Z"
    }
}
 

Request      

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

URL Parameters

id  string  

The ID of the theme.

version  string  

Theme Version.

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

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/harum',
    [
        '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}

URL Parameters

id  string  

The ID of the theme.

version  string  

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

URL Parameters

id  string  

The ID of the theme.

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": "Prof. Freddy Huel",
        "username": "aut_illum",
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "dolores",
                "slug": "M89aqn7",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z",
                "deleted_at": null
            }
        ]
    }
}
 

Request      

GET api/1.0/user

Create Guest User

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

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

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

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

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

Example response (201):


{
    "type": "user",
    "data": {
        "name": "Kavon Paucek MD",
        "username": "neque_placeat",
        "updated_at": "2022-12-04T23:45:04.000000Z",
        "created_at": "2022-12-04T23:45:04.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sint",
                "slug": "e5-GX3c",
                "created_at": "2022-12-04T23:45:04.000000Z",
                "updated_at": "2022-12-04T23:45:04.000000Z",
                "deleted_at": null
            }
        ]
    }
}
 

Request      

POST api/1.0/user

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"
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",
};

fetch(url, {
    method: "POST",
    headers,
}).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',
        ],
    ]
);
$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

Delete API Key

requires authentication

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

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/corrupti',
    [
        '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}

URL Parameters

token  string  

Token