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

Authenticate requests to this API's endpoints 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=iure&ids=veniam" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box"
);

const params = {
    "filter": "iure",
    "ids": "veniam",
};
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'=> 'iure',
            'ids'=> 'veniam',
        ],
    ]
);
$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": "et_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": "Asperiores itaque provident nam quaerat ea modi et. Cum omnis dolores eos nam aspernatur delectus id.",
            "user": {
                "username": "aliquam_cum",
                "uuid": "4c04aefc-9cd5-11ed-997e-6045bdab011a",
                "name": "Brianne Goyette",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "pariatur_qui",
            "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": "Blanditiis nihil sed quam. Libero perspiciatis et et. Voluptates est qui voluptas sit corporis.",
            "user": {
                "username": "voluptatem_non",
                "uuid": "4c063ba7-9cd5-11ed-997e-6045bdab011a",
                "name": "Billie Konopelski",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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/inventore" \
    --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/inventore"
);

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/inventore',
    [
        '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": "aspernatur_et",
        "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": "Dicta impedit ut debitis natus vero. Qui quisquam quia ut iusto consectetur. Culpa et adipisci officia recusandae itaque sunt.",
        "user": {
            "username": "dolores_libero",
            "uuid": "4c09a4a2-9cd5-11ed-997e-6045bdab011a",
            "name": "Trisha Will",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "created_at": "2023-01-25T17:25:43.000000Z",
        "updated_at": "2023-01-25T17:25:43.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/incidunt" \
    --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/incidunt"
);

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/incidunt',
    [
        '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": "libero_voluptas",
        "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": "Voluptate nostrum molestiae modi eaque praesentium non neque. Aut sint molestiae sint incidunt et omnis rem unde. Quo cumque deleniti totam non cupiditate. Vel qui porro debitis aut ex aperiam repudiandae.",
        "user": {
            "username": "quasi_omnis",
            "uuid": "4c0be5c1-9cd5-11ed-997e-6045bdab011a",
            "name": "Prof. Saul Thiel I",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "created_at": "2023-01-25T17:25:43.000000Z",
        "updated_at": "2023-01-25T17:25:43.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/error" \
    --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/error"
);

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/error',
    [
        '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\": \"pariatur\",
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"p\": \"suscipit\",
        \"rr\": \"aut\",
        \"ro\": \"et\",
        \"ra\": \"magni\",
        \"e\": \"rerum\",
        \"mi\": 1633244.09,
        \"ma\": 58.63
    },
    \"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\",
    \"room\": \"HvvOlTl\",
    \"whisper\": [
        213207.481552
    ]
}"
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": "pariatur",
    "operator": {
        "k": "\"h2\"",
        "p": "suscipit",
        "rr": "aut",
        "ro": "et",
        "ra": "magni",
        "e": "rerum",
        "mi": 1633244.09,
        "ma": 58.63
    },
    "label": "\"Longbow damage with Hunter's Mark\"",
    "room": "HvvOlTl",
    "whisper": [
        213207.481552
    ]
};

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' => 'pariatur',
                'operator' => [
                    'k' => '"h2"',
                    'p' => 'suscipit',
                    'rr' => 'aut',
                    'ro' => 'et',
                    'ra' => 'magni',
                    'e' => 'rerum',
                    'mi' => 1633244.09,
                    'ma' => 58.63,
                ],
                'label' => '"Longbow damage with Hunter\'s Mark"',
                'room' => 'HvvOlTl',
                'whisper' => [
                    213207.481552,
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):


{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "quas_explicabo",
            "uuid": "4be182b5-9cd5-11ed-997e-6045bdab011a",
            "name": "Drake Fadel",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "occaecati",
            "slug": "UbFEFdV",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 13,
                    "username": "a_nemo",
                    "color": "#14b941",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "placeat_in",
                        "uuid": "4be29ec8-9cd5-11ed-997e-6045bdab011a",
                        "name": "Davin O'Kon II",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "4be36f32-9cd5-11ed-997e-6045bdab011a",
                "is_hidden": false,
                "is_user_value": false,
                "is_visible": false,
                "is_cleared": true,
                "is_dropped": false,
                "value": 1,
                "value_to_display": "1",
                "type": "d4",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            }
        ],
        "total_value": 1,
        "equation": "1d4",
        "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/numquam" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/roll/numquam"
);

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

Example response (200):


{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "nihil_et",
            "uuid": "4be690b4-9cd5-11ed-997e-6045bdab011a",
            "name": "Mrs. Ivory Rogahn DVM",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "debitis",
            "slug": "X7HBfXy",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 14,
                    "username": "eos_quaerat",
                    "color": "#18bcfe",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "sapiente_repellendus",
                        "uuid": "4be77228-9cd5-11ed-997e-6045bdab011a",
                        "name": "Dr. Emie Pacocha IV",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "4be84126-9cd5-11ed-997e-6045bdab011a",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 2,
                "value_to_display": "2",
                "type": "d10",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            }
        ],
        "total_value": 2,
        "equation": "1d10",
        "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/consequatur" \
    --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/consequatur"
);

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/consequatur',
    [
        '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": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "quia_facilis",
            "uuid": "4beb7f5c-9cd5-11ed-997e-6045bdab011a",
            "name": "Simone Spencer DVM",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "aut",
            "slug": "So2sgoy",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 15,
                    "username": "illo_velit",
                    "color": "#75e27a",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "consequatur_laborum",
                        "uuid": "4bec6464-9cd5-11ed-997e-6045bdab011a",
                        "name": "Dr. Holden Jast MD",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "4bed31e0-9cd5-11ed-997e-6045bdab011a",
                "is_hidden": true,
                "is_user_value": false,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 1,
                "value_to_display": "1",
                "type": "d4",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            }
        ],
        "total_value": 1,
        "equation": "1d4",
        "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": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "odit_illum",
                "uuid": "4bf06dca-9cd5-11ed-997e-6045bdab011a",
                "name": "Prof. Kale Brown",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "ipsa",
                "slug": "BoL_l5f",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 16,
                        "username": "laboriosam_assumenda",
                        "color": "#6a7c43",
                        "position": 0,
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z",
                        "user": {
                            "username": "aut_illo",
                            "uuid": "4bf14893-9cd5-11ed-997e-6045bdab011a",
                            "name": "Xander Christiansen",
                            "created_at": "2023-01-25T17:25:43.000000Z",
                            "updated_at": "2023-01-25T17:25:43.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "4bf21525-9cd5-11ed-997e-6045bdab011a",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 1,
                    "value_to_display": "1",
                    "type": "d20",
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z"
                }
            ],
            "total_value": 1,
            "equation": "1d20",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "et_non",
                "uuid": "4bf39efd-9cd5-11ed-997e-6045bdab011a",
                "name": "Raquel Schaden",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "occaecati",
                "slug": "6nbGuzi",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 17,
                        "username": "inventore_nisi",
                        "color": "#39c465",
                        "position": 0,
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z",
                        "user": {
                            "username": "et_voluptatem",
                            "uuid": "4bf46e63-9cd5-11ed-997e-6045bdab011a",
                            "name": "Wilson Lehner PhD",
                            "created_at": "2023-01-25T17:25:43.000000Z",
                            "updated_at": "2023-01-25T17:25:43.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "4bf5400d-9cd5-11ed-997e-6045bdab011a",
                    "is_hidden": true,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": true,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d10",
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z"
                }
            ],
            "total_value": 2,
            "equation": "1d10",
            "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": "8nB27ue",
            "passcode": "officiis",
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "ad_magni",
                "uuid": "4bbd9962-9cd5-11ed-997e-6045bdab011a",
                "name": "Mackenzie Bins",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "participants": [
                {
                    "id": 2,
                    "username": "aspernatur_sed",
                    "color": "#96dbb6",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "asperiores_omnis",
                        "uuid": "4bbe04f2-9cd5-11ed-997e-6045bdab011a",
                        "name": "Mrs. Liana Kovacek",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                },
                {
                    "id": 3,
                    "username": "ipsum_autem",
                    "color": "#2ea55b",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "suscipit_minima",
                        "uuid": "4bbe639a-9cd5-11ed-997e-6045bdab011a",
                        "name": "Ms. Penelope Crist",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "WJqq95X",
            "passcode": "voluptatem",
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "architecto_vel",
                "uuid": "4bc03b2a-9cd5-11ed-997e-6045bdab011a",
                "name": "Monserrat Daniel",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "participants": [
                {
                    "id": 4,
                    "username": "magni_et",
                    "color": "#cfddfa",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "aliquid_distinctio",
                        "uuid": "4bc08afa-9cd5-11ed-997e-6045bdab011a",
                        "name": "Dr. Jarod Cummings DVM",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z"
                    }
                },
                {
                    "id": 5,
                    "username": "quia_illum",
                    "color": "#9c2548",
                    "position": 0,
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z",
                    "user": {
                        "username": "laborum_dignissimos",
                        "uuid": "4bc0df01-9cd5-11ed-997e-6045bdab011a",
                        "name": "Deanna Wunsch",
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.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\": \"autem\",
    \"is_public\": false,
    \"passcode\": \"itaque\"
}"
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": "autem",
    "is_public": false,
    "passcode": "itaque"
};

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

Example response (201):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "y_Z8md0",
        "passcode": "numquam",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "delectus_odio",
            "uuid": "4bc4a474-9cd5-11ed-997e-6045bdab011a",
            "name": "Marianna Graham",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "participants": []
    }
}
 

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/cupiditate?passcode=odio" \
    --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/cupiditate"
);

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

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "uaTrUEI",
        "passcode": "in",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "qui_qui",
            "uuid": "4bc73cd6-9cd5-11ed-997e-6045bdab011a",
            "name": "Paige Carter",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "participants": []
    }
}
 

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

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

let body = {
    "name": "aut",
    "is_public": true,
    "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/rem',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'aut',
            'is_public' => true,
            '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": "7CqQYuZ",
        "passcode": "voluptatem",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "illum_odio",
            "uuid": "4bca098b-9cd5-11ed-997e-6045bdab011a",
            "name": "Gage Friesen",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "participants": []
    }
}
 

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

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

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

let body = {
    "dice": {
        "is_hidden": true,
        "is_visible": false,
        "is_cleared": 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/15/roll',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'dice' => [
                'is_hidden' => true,
                'is_visible' => false,
                'is_cleared' => true,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "sit_odio",
                "uuid": "4bcdfa85-9cd5-11ed-997e-6045bdab011a",
                "name": "Russ Kuphal",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "velit",
                "slug": "XGjEBGN",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 9,
                        "username": "nam_rem",
                        "color": "#babbac",
                        "position": 0,
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z",
                        "user": {
                            "username": "delectus_dolores",
                            "uuid": "4bcee594-9cd5-11ed-997e-6045bdab011a",
                            "name": "Dr. Santos Dietrich II",
                            "created_at": "2023-01-25T17:25:43.000000Z",
                            "updated_at": "2023-01-25T17:25:43.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "4bcfefa3-9cd5-11ed-997e-6045bdab011a",
                    "is_hidden": true,
                    "is_user_value": false,
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 7,
                    "value_to_display": "7",
                    "type": "d8",
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z"
                }
            ],
            "total_value": 7,
            "equation": "1d8",
            "external_id": null,
            "participants": []
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "minus_impedit",
                "uuid": "4bd18476-9cd5-11ed-997e-6045bdab011a",
                "name": "Demetris Mosciski Jr.",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "non",
                "slug": "8KX54cG",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 10,
                        "username": "et_sint",
                        "color": "#3b99fe",
                        "position": 0,
                        "created_at": "2023-01-25T17:25:43.000000Z",
                        "updated_at": "2023-01-25T17:25:43.000000Z",
                        "user": {
                            "username": "ut_nihil",
                            "uuid": "4bd25511-9cd5-11ed-997e-6045bdab011a",
                            "name": "Jaclyn Von",
                            "created_at": "2023-01-25T17:25:43.000000Z",
                            "updated_at": "2023-01-25T17:25:43.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "4bd32351-9cd5-11ed-997e-6045bdab011a",
                    "is_hidden": true,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 1,
                    "value_to_display": "1",
                    "type": "d8",
                    "created_at": "2023-01-25T17:25:43.000000Z",
                    "updated_at": "2023-01-25T17:25:43.000000Z"
                }
            ],
            "total_value": 1,
            "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/modi/participant" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"passcode\": \"voluptates\"
}"
const url = new URL(
    "https://dddice.com/api/1.0/room/modi/participant"
);

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

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

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

Example response (200):


{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "Sltn0r2",
        "passcode": "nam",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "assumenda_labore",
            "uuid": "4bd72205-9cd5-11ed-997e-6045bdab011a",
            "name": "Carmelo Zemlak",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "participants": []
    }
}
 

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

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

let body = {
    "passcode": "sed",
    "username": "nemo",
    "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/impedit/participant/maxime',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'passcode' => 'sed',
            'username' => 'nemo',
            '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": "oIgfEA5",
        "passcode": "blanditiis",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "quasi_laboriosam",
            "uuid": "4bda0b9e-9cd5-11ed-997e-6045bdab011a",
            "name": "Mac Ortiz",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "participants": []
    }
}
 

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/expedita/participant/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/room/expedita/participant/est"
);

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/expedita/participant/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 (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": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "itaque_quasi",
                "uuid": "4bf87056-9cd5-11ed-997e-6045bdab011a",
                "name": "Deborah Mills",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "theme": {
                "slug": "voluptatem_sed",
                "is_available": true,
                "name": "Mr.",
                "description": "Sapiente aut aut assumenda expedita repellendus quos. Eos sit repellat illum quia voluptatem cum quis. Aperiam a illum amet sunt iure. Minus ipsam in eaque id deserunt minus maxime.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            }
        },
        {
            "updated_at": "2023-01-25T17:25:43.000000Z",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "user": {
                "username": "itaque_tempora",
                "uuid": "4bf9d8a1-9cd5-11ed-997e-6045bdab011a",
                "name": "Cecile McCullough",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "theme": {
                "slug": "aut_ipsa",
                "is_available": true,
                "name": "Mr.",
                "description": "Omnis quo sit et aspernatur voluptatum quidem dolore. Vel amet et est autem reprehenderit delectus assumenda. Commodi eos fugit nostrum accusamus. Nihil voluptatem minima asperiores dolorum. Quasi ut assumenda porro excepturi.",
                "form_state": null,
                "deleted_at": null,
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.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": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "quia_sed",
            "uuid": "4bfbe994-9cd5-11ed-997e-6045bdab011a",
            "name": "Mateo Roberts",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "theme": {
            "slug": "ducimus_itaque",
            "is_available": true,
            "name": "Mrs.",
            "description": "Ad sapiente totam assumenda omnis dolor reiciendis et earum. Dolor est voluptates distinctio et.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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/quo" \
    --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/quo"
);

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/quo',
    [
        '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": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "esse_voluptatem",
            "uuid": "4bfdbf27-9cd5-11ed-997e-6045bdab011a",
            "name": "Mr. Zachery Mohr DDS",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "theme": {
            "slug": "earum_assumenda",
            "is_available": true,
            "name": "Dr.",
            "description": "Eius quia reprehenderit eos vel dicta. Laudantium eius qui voluptas deserunt. Neque ipsa vero consequuntur corporis ipsum blanditiis tempora. Ut soluta velit aut facere similique vitae.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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/commodi" \
    --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/commodi"
);

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/commodi',
    [
        '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": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "consequatur_enim",
            "uuid": "4bff9314-9cd5-11ed-997e-6045bdab011a",
            "name": "Elvis Lockman",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "theme": {
            "slug": "id_impedit",
            "is_available": true,
            "name": "Ms.",
            "description": "Aut illum tempore excepturi ipsum mollitia. Ex eos ea consequatur omnis. Autem in et aut sit qui.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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/animi" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/share/animi"
);

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

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

Example response (204):

[Empty response]
 

Request      

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

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

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

Example response (200):


{
    "data": {
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "user": {
            "username": "laudantium_omnis",
            "uuid": "4c0218fb-9cd5-11ed-997e-6045bdab011a",
            "name": "Catalina Jacobson",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "theme": {
            "slug": "et_quia",
            "is_available": true,
            "name": "Dr.",
            "description": "Consectetur veniam architecto ullam facilis quia quis vel quibusdam. Et totam illum omnis tempora et. Ea ullam ab nihil a nobis veniam accusamus. Et laboriosam possimus sint velit nemo dolorem.",
            "form_state": null,
            "deleted_at": null,
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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": "iste_voluptas",
            "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": "Sint ullam explicabo aut tempora vero modi. Et ab illo impedit expedita. Qui consequatur nihil ducimus facilis est beatae.",
            "user": {
                "username": "minima_placeat",
                "uuid": "4c10a45e-9cd5-11ed-997e-6045bdab011a",
                "name": "Ms. Emmalee Kub II",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "rerum_quidem",
            "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": "Sit provident animi sed pariatur. Tempora beatae quaerat perspiciatis non. Minus eligendi corrupti velit debitis. Magni sed incidunt nulla necessitatibus occaecati dolores deserunt.",
            "user": {
                "username": "culpa_vel",
                "uuid": "4c11f459-9cd5-11ed-997e-6045bdab011a",
                "name": "Arlo Mills",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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=est" \
    --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=earum" \
    --form "assets[]=@/tmp/php0PBEvn" 
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', 'est');
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', 'earum');
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' => 'est'
            ],
            [
                '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' => 'earum'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/php0PBEvn', '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": "inventore_est",
        "name": "Miss",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Cum consequatur molestias at nostrum porro. Eius praesentium recusandae cupiditate est est. Enim quod et temporibus distinctio vel. Asperiores reiciendis nisi pariatur aspernatur.",
        "user": {
            "username": "ab_error",
            "uuid": "4c17d293-9cd5-11ed-997e-6045bdab011a",
            "name": "Katrine Grimes",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "created_at": "2023-01-25T17:25:43.000000Z",
        "updated_at": "2023-01-25T17:25:43.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": "id_ut",
        "name": "Mrs.",
        "label": {
            "color": "#000000",
            "background_color": "#e3d12d"
        },
        "version": "1.0.0",
        "textures": [
            {
                "src": {
                    "d4": "u_numberMap.png",
                    "d6": "u_numberMap.png",
                    "d8": "u_numberMap.png",
                    "d10": "u_numberMap.png",
                    "d12": "u_numberMap.png",
                    "d20": "u_numberMap.png",
                    "d10x": "u_numberMap_d10x.png"
                },
                "binding": "u_numberMap"
            }
        ],
        "api_version": "1.0",
        "description": "Totam dolores nihil necessitatibus. Illo velit molestiae aut necessitatibus laudantium. Assumenda dolores ad nemo rerum aut.",
        "user": {
            "username": "voluptas_non",
            "uuid": "4c1a5ce2-9cd5-11ed-997e-6045bdab011a",
            "name": "Betty Jacobson",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "created_at": "2023-01-25T17:25:43.000000Z",
        "updated_at": "2023-01-25T17:25:43.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": "sit_atque",
            "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": "Quasi quaerat magnam delectus dolorum rem amet dignissimos blanditiis. Minus deserunt ut voluptate qui. Rerum ut dicta est eum. Dolores accusantium accusamus in et eaque.",
            "user": {
                "username": "tempore_fugit",
                "uuid": "4c1d9876-9cd5-11ed-997e-6045bdab011a",
                "name": "Hazel Stokes",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        {
            "meshes": {
                "d4": "/mesh/d04.fbx",
                "d6": "/mesh/d06.fbx",
                "d8": "/mesh/d08.fbx",
                "d10": "/mesh/d10.fbx",
                "d10x": "/mesh/d10.fbx",
                "d12": "/mesh/d12.fbx",
                "d20": "/mesh/d20.fbx"
            },
            "available_dice": [
                "d4",
                "d6",
                "d8",
                "d10",
                "d10x",
                "d12",
                "d20"
            ],
            "physics": {
                "inertia": {
                    "d4": 5,
                    "d6": 12,
                    "d8": 10,
                    "d10": 9,
                    "d10x": 9,
                    "d12": 8,
                    "d20": 6
                },
                "weight": {
                    "d4": 300,
                    "d6": 300,
                    "d8": 340,
                    "d10": 350,
                    "d10x": 350,
                    "d12": 350,
                    "d20": 400
                }
            },
            "sizes": {
                "d4": 1,
                "d6": 1,
                "d8": 1,
                "d10": 1,
                "d10x": 1,
                "d12": 1,
                "d20": 1
            },
            "sounds": [
                {
                    "src": "/sounds/roll-1.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-2.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-3.mp3",
                    "on": "die.collide"
                },
                {
                    "src": "/sounds/roll-loading-sm.mp3",
                    "on": "roll.loading",
                    "value": 2
                },
                {
                    "src": "/sounds/roll-loading-lg.mp3",
                    "on": "roll.loading",
                    "value": ">=3"
                }
            ],
            "uniforms": {
                "number": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.424,
                        "r": 0.463
                    }
                },
                "diffuse": {
                    "type": "color",
                    "value": {
                        "b": 0,
                        "g": 0.929,
                        "r": 1
                    }
                }
            },
            "values": {
                "d4": [
                    1,
                    2,
                    3,
                    4
                ],
                "d6": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                ],
                "d8": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8
                ],
                "d10": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                "d12": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12
                ],
                "d20": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ],
                "d10x": [
                    10,
                    20,
                    30,
                    40,
                    50,
                    60,
                    70,
                    80,
                    90,
                    0
                ]
            },
            "id": "cumque_quis",
            "name": "Mr.",
            "label": {
                "color": "#000000",
                "background_color": "#e3d12d"
            },
            "version": "1.0.0",
            "textures": [
                {
                    "src": {
                        "d4": "u_numberMap.png",
                        "d6": "u_numberMap.png",
                        "d8": "u_numberMap.png",
                        "d10": "u_numberMap.png",
                        "d12": "u_numberMap.png",
                        "d20": "u_numberMap.png",
                        "d10x": "u_numberMap_d10x.png"
                    },
                    "binding": "u_numberMap"
                }
            ],
            "api_version": "1.0",
            "description": "Ullam tempora voluptas similique officiis dignissimos. Debitis beatae suscipit sit nemo nobis facere. Fugiat aut tempora excepturi quam aut odit.",
            "user": {
                "username": "sunt_dolore",
                "uuid": "4c1edab2-9cd5-11ed-997e-6045bdab011a",
                "name": "Adaline Gutmann",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.000000Z"
            },
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.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": "ut_quibusdam",
        "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": "Voluptas animi dignissimos perferendis est eos nemo. Accusamus eius ut quibusdam magnam quas reiciendis veniam et. Qui autem aut quasi autem est qui similique.",
        "user": {
            "username": "eos_ut",
            "uuid": "4c2203f4-9cd5-11ed-997e-6045bdab011a",
            "name": "Virginie Schinner III",
            "created_at": "2023-01-25T17:25:43.000000Z",
            "updated_at": "2023-01-25T17:25:43.000000Z"
        },
        "created_at": "2023-01-25T17:25:43.000000Z",
        "updated_at": "2023-01-25T17:25:43.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/sed" \
    --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/sed"
);

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/sed',
    [
        '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": "Caitlyn Hoppe",
        "username": "repellendus_et",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "sapiente",
                "slug": "BxjSu42",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.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": "Mr. Simeon Adams DDS",
        "username": "qui_ipsam",
        "updated_at": "2023-01-25T17:25:43.000000Z",
        "created_at": "2023-01-25T17:25:43.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "maxime",
                "slug": "g1m2jBn",
                "created_at": "2023-01-25T17:25:43.000000Z",
                "updated_at": "2023-01-25T17:25:43.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/optio" \
    --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/optio"
);

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