MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

SDKs

Software Development Kits (SDKs) allow developers to easily render 3D dice and interact with the API specifications below. We offer SDKs for the following languages:

If you have a particular language you wish to use dddice with, please let us know.

Base URL

https://dddice.com

Authenticating requests

This API is authenticated by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting My Account > Developers and clicking Copy API Key.

You must have an account to use the API.

Dice Box

API for managing themes in your Digital Dice Box.

List Dice Box Collection

requires authentication

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

Example request:
curl --request GET \
    --get "https://dddice.com/api/1.0/dice-box?filter=debitis&ids=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/dice-box"
);

const params = {
    "filter": "debitis",
    "ids": "sed",
};
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'=> 'debitis',
            'ids'=> 'sed',
        ],
    ]
);
$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"
                }
            ],
            "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": "nam_ut",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Prof.",
            "description": "Nostrum dolorem consequatur quo sequi ad harum. Incidunt veniam sunt eveniet sit.",
            "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": "dolor_quia",
                "uuid": "de15ef8c-3818-11ed-b246-5600040f110d",
                "name": "Candace Jones",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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"
                }
            ],
            "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": "molestias_officiis",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Mr.",
            "description": "Dolorem nisi ea facilis magni quos. Qui ipsa delectus molestiae. Sunt voluptatem asperiores quidem et veniam omnis.",
            "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": "sed_aut",
                "uuid": "de16af8a-3818-11ed-b246-5600040f110d",
                "name": "Dr. Armand Stiedemann",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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/voluptatem" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/dice-box/voluptatem"
);

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

Example response (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"
            }
        ],
        "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": "eos_corporis",
        "version": "1.0.0",
        "api_version": "1.0",
        "name": "Miss",
        "description": "Eos consequatur quos ea consequatur rem placeat. Corrupti rem est eligendi nihil earum veniam. Quia a quaerat porro ea placeat quod.",
        "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": "et_vitae",
            "uuid": "de184b29-3818-11ed-b246-5600040f110d",
            "name": "Gia Ledner",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "created_at": "2022-09-19T12:44:57.000000Z",
        "updated_at": "2022-09-19T12:44:57.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/voluptatum" \
    --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/voluptatum"
);

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/voluptatum',
    [
        '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"
            }
        ],
        "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": "necessitatibus_rem",
        "version": "1.0.0",
        "api_version": "1.0",
        "name": "Prof.",
        "description": "Dolores fuga ratione odio commodi voluptatem. Recusandae qui expedita ducimus enim. Velit iusto sit deleniti ducimus. Qui assumenda voluptatum aliquam temporibus molestias.",
        "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": "corrupti_qui",
            "uuid": "de198ff3-3818-11ed-b246-5600040f110d",
            "name": "Prof. Rowena Hammes Sr.",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "created_at": "2022-09-19T12:44:57.000000Z",
        "updated_at": "2022-09-19T12:44:57.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/porro" \
    --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/porro"
);

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/porro',
    [
        '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\"
        }
    ],
    \"operator\": {
        \"k\": \"\\\"h2\\\"\",
        \"p\": \"ab\",
        \"rr\": \"expedita\",
        \"ro\": \"vitae\",
        \"ra\": \"quo\",
        \"e\": \"et\",
        \"mi\": 39030.851,
        \"ma\": 2733716.1
    },
    \"label\": \"\\\"Longbow damage with Hunter\'s Mark\\\"\",
    \"room\": \"HvvOlTl\"
}"
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"
        }
    ],
    "operator": {
        "k": "\"h2\"",
        "p": "ab",
        "rr": "expedita",
        "ro": "vitae",
        "ra": "quo",
        "e": "et",
        "mi": 39030.851,
        "ma": 2733716.1
    },
    "label": "\"Longbow damage with Hunter's Mark\"",
    "room": "HvvOlTl"
};

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],
                ],
                'operator' => [
                    'k' => '"h2"',
                    'p' => 'ab',
                    'rr' => 'expedita',
                    'ro' => 'vitae',
                    'ra' => 'quo',
                    'e' => 'et',
                    'mi' => 39030.851,
                    'ma' => 2733716.1,
                ],
                'label' => '"Longbow damage with Hunter\'s Mark"',
                'room' => 'HvvOlTl',
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (201):

{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "quam_et",
            "uuid": "ddfa19d7-3818-11ed-b246-5600040f110d",
            "name": "Yasmin Krajcik",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "vel",
            "slug": "4grlgZW",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 2892,
                    "username": "repellendus_architecto",
                    "color": "#8848f1",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "occaecati_animi",
                        "uuid": "ddfb9780-3818-11ed-b246-5600040f110d",
                        "name": "Mekhi West",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "ddfc2696-3818-11ed-b246-5600040f110d",
                "is_hidden": false,
                "is_user_value": true,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 5,
                "value_to_display": "5",
                "type": "d6",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ],
        "total_value": 5
    }
}
 

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

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.

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

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/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/roll/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/roll/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": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "eum_non",
            "uuid": "ddfe0859-3818-11ed-b246-5600040f110d",
            "name": "Prof. Brenden Smitham",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "distinctio",
            "slug": "6hEfB-3",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 2893,
                    "username": "vel_voluptates",
                    "color": "#16f733",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "cupiditate_est",
                        "uuid": "ddfef21a-3818-11ed-b246-5600040f110d",
                        "name": "Mr. Cornelius West Sr.",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "ddffa78f-3818-11ed-b246-5600040f110d",
                "is_hidden": false,
                "is_user_value": false,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 3,
                "value_to_display": "3",
                "type": "d4",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ],
        "total_value": 3
    }
}
 

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

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/quam',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'uuid' => [
                        '1',
                    ],
                    'is_hidden' => [
                        true,
                    ],
                ],
            ],
            [
                'dice' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": {
        "direction": 180,
        "velocity": 1,
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "enim_consectetur",
            "uuid": "de01a8d6-3818-11ed-b246-5600040f110d",
            "name": "Jarret McGlynn",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "room": {
            "is_public": true,
            "name": "Untitled Room",
            "bg_file_path": null,
            "passcode": "blanditiis",
            "slug": "O80R9HU",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "deleted_at": null,
            "participants": [
                {
                    "id": 2894,
                    "username": "sint_aut",
                    "color": "#2250d7",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "similique_molestias",
                        "uuid": "de029528-3818-11ed-b246-5600040f110d",
                        "name": "Mr. Waldo Brekke",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                }
            ]
        },
        "values": [
            {
                "uuid": "de03464e-3818-11ed-b246-5600040f110d",
                "is_hidden": true,
                "is_user_value": true,
                "is_visible": true,
                "is_cleared": false,
                "is_dropped": false,
                "value": 12,
                "value_to_display": "12",
                "type": "d12",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ],
        "total_value": 12
    }
}
 

Request      

PATCH api/1.0/roll/{id}

URL Parameters

id  string  

Roll ID

Body Parameters

dice  object[]  

List of partial dice rolls.

dice.is_visible  boolean optional  

Roll value hidden

dice.is_cleared  boolean optional  

Roll value cleared

Response

Response Fields

uuid  string  

The ID of the roll

direction  number  

The angle the roll was thrown (in degrees)

velocity  number  

How hard the roll was thrown

user  object  

User Object

room  object  

Room Object

values  object[]  

Roll Value Objects

total_value  number  

Sum of all roll value totals

created_at  string  

Created timestamp

updated_at  string  

Updated timestamp

Bulk Update Rolls

requires authentication

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

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

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

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

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

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

Example response (200):

{
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "recusandae_ipsum",
                "uuid": "de050d55-3818-11ed-b246-5600040f110d",
                "name": "Gerardo Kshlerin DDS",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "atque",
                "slug": "K5OVk9N",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 2895,
                        "username": "accusantium_quia",
                        "color": "#587c40",
                        "position": 0,
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z",
                        "user": {
                            "username": "unde_incidunt",
                            "uuid": "de060951-3818-11ed-b246-5600040f110d",
                            "name": "Elmira Bashirian",
                            "created_at": "2022-09-19T12:44:57.000000Z",
                            "updated_at": "2022-09-19T12:44:57.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "de06add7-3818-11ed-b246-5600040f110d",
                    "is_hidden": false,
                    "is_user_value": true,
                    "is_visible": true,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 3,
                    "value_to_display": "3",
                    "type": "d10",
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z"
                }
            ],
            "total_value": 3
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "nemo_ullam",
                "uuid": "de07b112-3818-11ed-b246-5600040f110d",
                "name": "Alanis Barrows",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "exercitationem",
                "slug": "9vYVMMg",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 2896,
                        "username": "est_sunt",
                        "color": "#1f2598",
                        "position": 0,
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z",
                        "user": {
                            "username": "blanditiis_alias",
                            "uuid": "de08d447-3818-11ed-b246-5600040f110d",
                            "name": "Germaine Waters",
                            "created_at": "2022-09-19T12:44:57.000000Z",
                            "updated_at": "2022-09-19T12:44:57.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "de099196-3818-11ed-b246-5600040f110d",
                    "is_hidden": true,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d12",
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z"
                }
            ],
            "total_value": 2
        }
    ]
}
 

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": "6jml106",
            "passcode": "sit",
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "atque_perferendis",
                "uuid": "dddd8877-3818-11ed-b246-5600040f110d",
                "name": "Prudence Goodwin",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "participants": [
                {
                    "id": 2881,
                    "username": "et_quo",
                    "color": "#45464f",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "deleniti_quasi",
                        "uuid": "ddde207e-3818-11ed-b246-5600040f110d",
                        "name": "Dortha Mertz",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                },
                {
                    "id": 2882,
                    "username": "veniam_expedita",
                    "color": "#c96126",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "neque_voluptatem",
                        "uuid": "dddea416-3818-11ed-b246-5600040f110d",
                        "name": "Betsy Roob",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                }
            ]
        },
        {
            "name": "Untitled Room",
            "is_public": true,
            "bg_file_path": null,
            "slug": "Ahlb4Kl",
            "passcode": "modi",
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "corrupti_omnis",
                "uuid": "dde073ce-3818-11ed-b246-5600040f110d",
                "name": "Sabryna Koch V",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "participants": [
                {
                    "id": 2883,
                    "username": "nihil_dolorem",
                    "color": "#e3d647",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "atque_omnis",
                        "uuid": "dde0bcca-3818-11ed-b246-5600040f110d",
                        "name": "Mrs. Hildegard Konopelski IV",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z"
                    }
                },
                {
                    "id": 2884,
                    "username": "ducimus_possimus",
                    "color": "#3ee242",
                    "position": 0,
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z",
                    "user": {
                        "username": "eos_non",
                        "uuid": "dde0fea9-3818-11ed-b246-5600040f110d",
                        "name": "Verla Gaylord DVM",
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.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\": \"est\",
    \"is_public\": false,
    \"passcode\": \"sapiente\"
}"
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": "est",
    "is_public": false,
    "passcode": "sapiente"
};

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

Example response (201):

{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "H8_Ot2I",
        "passcode": "inventore",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "maxime_sed",
            "uuid": "dde6a13b-3818-11ed-b246-5600040f110d",
            "name": "Brandy Schimmel II",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "participants": [
            {
                "id": 2885,
                "username": "molestiae_hic",
                "color": "#22260f",
                "position": 0,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ]
    }
}
 

Request      

POST api/1.0/room

Body Parameters

name  string optional  

Name

is_public  boolean optional  

Public or private

passcode  string optional  

Passcode required for private rooms

Get a Room

requires authentication

Get information about a room and active participants.

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

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

Example response (200):

{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "0RHM0eD",
        "passcode": "quidem",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "atque_suscipit",
            "uuid": "dde9678d-3818-11ed-b246-5600040f110d",
            "name": "Hal Weimann",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "participants": [
            {
                "id": 2886,
                "username": "accusantium_fugiat",
                "color": "#80a5c6",
                "position": 0,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ]
    }
}
 

Request      

GET api/1.0/room/{slug}

URL Parameters

slug  string  

The slug of the room.

Query Parameters

passcode  string optional  

Passcode required for private room

Update a Room

requires authentication

Update the name of a room

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

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

let body = {
    "name": "deserunt",
    "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/est',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'deserunt',
            '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": "xPETEIt",
        "passcode": "atque",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "natus_non",
            "uuid": "ddeb9bbf-3818-11ed-b246-5600040f110d",
            "name": "Miss Marie Toy MD",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "participants": [
            {
                "id": 2887,
                "username": "a_quis",
                "color": "#cdd134",
                "position": 0,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ]
    }
}
 

Request      

PATCH api/1.0/room/{slug}

URL Parameters

slug  string  

The slug of the room.

Body Parameters

name  string optional  

Name

is_public  boolean optional  

Public or private

passcode  boolean optional  

Passcode required for private rooms

Delete a Room

requires authentication

Delete a room you own.

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

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

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

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

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

Example response (200):

{
    "type": "roll[]",
    "data": [
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "a_ut",
                "uuid": "ddedcc1f-3818-11ed-b246-5600040f110d",
                "name": "Elody Simonis",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "dolores",
                "slug": "LKlNdAZ",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 2888,
                        "username": "praesentium_sed",
                        "color": "#3690d3",
                        "position": 0,
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z",
                        "user": {
                            "username": "est_aut",
                            "uuid": "ddeeccc1-3818-11ed-b246-5600040f110d",
                            "name": "Adelia Emard IV",
                            "created_at": "2022-09-19T12:44:57.000000Z",
                            "updated_at": "2022-09-19T12:44:57.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "ddefcadd-3818-11ed-b246-5600040f110d",
                    "is_hidden": false,
                    "is_user_value": true,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d4",
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z"
                }
            ],
            "total_value": 2
        },
        {
            "direction": 180,
            "velocity": 1,
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "ea_delectus",
                "uuid": "ddf0dba5-3818-11ed-b246-5600040f110d",
                "name": "Adell Jakubowski V",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "room": {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "voluptas",
                "slug": "-2k0fhP",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z",
                "deleted_at": null,
                "participants": [
                    {
                        "id": 2889,
                        "username": "et_velit",
                        "color": "#143f14",
                        "position": 0,
                        "created_at": "2022-09-19T12:44:57.000000Z",
                        "updated_at": "2022-09-19T12:44:57.000000Z",
                        "user": {
                            "username": "a_quis",
                            "uuid": "ddf1a8df-3818-11ed-b246-5600040f110d",
                            "name": "Giuseppe Kuphal Sr.",
                            "created_at": "2022-09-19T12:44:57.000000Z",
                            "updated_at": "2022-09-19T12:44:57.000000Z"
                        }
                    }
                ]
            },
            "values": [
                {
                    "uuid": "ddf25537-3818-11ed-b246-5600040f110d",
                    "is_hidden": false,
                    "is_user_value": false,
                    "is_visible": false,
                    "is_cleared": false,
                    "is_dropped": false,
                    "value": 2,
                    "value_to_display": "2",
                    "type": "d8",
                    "created_at": "2022-09-19T12:44:57.000000Z",
                    "updated_at": "2022-09-19T12:44:57.000000Z"
                }
            ],
            "total_value": 2
        }
    ]
}
 

Request      

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

URL Parameters

slug  integer  

Body Parameters

dice  object  

Partial dice roll.

dice.is_visible  boolean optional  

Roll value hidden

dice.is_cleared  boolean optional  

Roll value cleared

Join a Room

requires authentication

Join a room as a participant

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

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

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

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

Example response (200):

{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "NmIFARR",
        "passcode": "et",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "vitae_rem",
            "uuid": "ddf50ed6-3818-11ed-b246-5600040f110d",
            "name": "Xavier Gorczany III",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "participants": [
            {
                "id": 2890,
                "username": "hic_dolore",
                "color": "#d1d3dc",
                "position": 0,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ]
    }
}
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

Body Parameters

passcode  string optional  

Passcode required for private room

Update a Participant

requires authentication

Update the username or color of the room participant.

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

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

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

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

Example response (200):

{
    "data": {
        "name": "Untitled Room",
        "is_public": true,
        "bg_file_path": null,
        "slug": "k1eAMQf",
        "passcode": "eos",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "cumque_earum",
            "uuid": "ddf70465-3818-11ed-b246-5600040f110d",
            "name": "Jakob Walker MD",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "participants": [
            {
                "id": 2891,
                "username": "eos_tempora",
                "color": "#7c5e05",
                "position": 0,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        ]
    }
}
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

id  string  

Participant ID

Body Parameters

passcode  string optional  

Passcode required for private room

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/id/participant/cumque" \
    --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/id/participant/cumque"
);

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

Example response (204):

[Empty response]
 

Request      

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

URL Parameters

slug  string  

The slug of the room.

id  string  

The ID of the participant.

Share Dice

API for managing share requests.

List Share Requests

requires authentication

Fetch a list of active and inactive share requests.

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

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

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

Example response (200):

{
    "type": "share[]",
    "data": [
        {
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "possimus_placeat",
                "uuid": "de0bda12-3818-11ed-b246-5600040f110d",
                "name": "Elias Stracke",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "theme": {
                "extend_id": null,
                "slug": "sapiente_saepe",
                "is_available": true,
                "manifest": "{\"id\": \"slug\", \"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\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Et sint quae provident sit. Et reprehenderit nemo debitis illum. Tenetur aperiam et architecto.\"}",
                "version": "1.0.0",
                "api_version": "1.0",
                "manifest_hash": "test_hash",
                "deleted_at": null,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        },
        {
            "updated_at": "2022-09-19T12:44:57.000000Z",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "user": {
                "username": "cumque_et",
                "uuid": "de0d04be-3818-11ed-b246-5600040f110d",
                "name": "Prof. Osbaldo Leuschke",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "theme": {
                "extend_id": null,
                "slug": "quisquam_minus",
                "is_available": true,
                "manifest": "{\"id\": \"slug\", \"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\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Corrupti praesentium labore ut cum magni. Sapiente voluptatem cum tenetur eligendi fuga. Ea deserunt dolorem officiis atque.\"}",
                "version": "1.0.0",
                "api_version": "1.0",
                "manifest_hash": "test_hash",
                "deleted_at": null,
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            }
        }
    ]
}
 

Request      

GET api/1.0/share

Create Share Request

requires authentication

Create a share request for a given theme.

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

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

let body = {
    "slug": "dddice-standard"
};

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

Example response (201):

{
    "data": {
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "id_rerum",
            "uuid": "de0ebff8-3818-11ed-b246-5600040f110d",
            "name": "Jazmyne Beer",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "theme": {
            "extend_id": null,
            "slug": "quia_doloribus",
            "is_available": true,
            "manifest": "{\"id\": \"slug\", \"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\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Et placeat a est. Earum quisquam occaecati iste rerum molestias impedit. Qui nulla deleniti at reprehenderit maxime. Aut error placeat placeat aspernatur quia id.\"}",
            "version": "1.0.0",
            "api_version": "1.0",
            "manifest_hash": "test_hash",
            "deleted_at": null,
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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/vero" \
    --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/vero"
);

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

Example response (200):

{
    "data": {
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "inventore_rerum",
            "uuid": "de109755-3818-11ed-b246-5600040f110d",
            "name": "Eldred Cummings",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "theme": {
            "extend_id": null,
            "slug": "architecto_qui",
            "is_available": true,
            "manifest": "{\"id\": \"slug\", \"name\": \"Ms.\", \"label\": {\"color\": \"#000000\", \"background_color\": \"#e3d12d\"}, \"version\": \"1.0.0\", \"textures\": [{\"src\": {\"d4\": \"u_numberMap.png\", \"d6\": \"u_numberMap.png\", \"d8\": \"u_numberMap.png\", \"d10\": \"u_numberMap.png\", \"d12\": \"u_numberMap.png\", \"d20\": \"u_numberMap.png\", \"d10x\": \"u_numberMap_d10x.png\"}, \"binding\": \"u_numberMap\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Et omnis aut sit omnis ea molestias. Tempora repellendus sapiente qui voluptas voluptatem vel. Quisquam sunt quasi qui enim rerum non aut ad.\"}",
            "version": "1.0.0",
            "api_version": "1.0",
            "manifest_hash": "test_hash",
            "deleted_at": null,
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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/necessitatibus" \
    --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/necessitatibus"
);

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

Example response (200):

{
    "data": {
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "minus_nobis",
            "uuid": "de1203e5-3818-11ed-b246-5600040f110d",
            "name": "Prof. Tyler Swift",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "theme": {
            "extend_id": null,
            "slug": "sed_aut",
            "is_available": true,
            "manifest": "{\"id\": \"slug\", \"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\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Minima expedita repellat reprehenderit placeat. Minima dolorem eius quo qui qui sapiente quia.\"}",
            "version": "1.0.0",
            "api_version": "1.0",
            "manifest_hash": "test_hash",
            "deleted_at": null,
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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/nihil" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/share/nihil"
);

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

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

Example response (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": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "user": {
            "username": "vel_facilis",
            "uuid": "de13fc92-3818-11ed-b246-5600040f110d",
            "name": "Jaren Lowe",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "theme": {
            "extend_id": null,
            "slug": "ex_quos",
            "is_available": true,
            "manifest": "{\"id\": \"slug\", \"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\"}], \"uniforms\": {\"number\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.424, \"r\": 0.463}}, \"diffuse\": {\"type\": \"color\", \"value\": {\"b\": 0, \"g\": 0.929, \"r\": 1}}}, \"api_version\": \"1.0\", \"description\": \"Sed nam dolorem et quam. Architecto qui voluptas voluptatibus voluptatum natus officiis enim. Aut reiciendis ut quos rerum. Provident deserunt quis ut aut alias.\"}",
            "version": "1.0.0",
            "api_version": "1.0",
            "manifest_hash": "test_hash",
            "deleted_at": null,
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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"
                }
            ],
            "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": "suscipit_molestiae",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Dr.",
            "description": "Et vel eaque explicabo fugiat necessitatibus commodi. Eum asperiores asperiores voluptatem sunt ut qui. Eos praesentium cumque eius. Quo aut non repellendus numquam enim.",
            "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": "et_dolores",
                "uuid": "de1c5be0-3818-11ed-b246-5600040f110d",
                "name": "Prof. Lamar Kuhn",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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"
                }
            ],
            "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": "enim_deleniti",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Ms.",
            "description": "At ipsum doloribus et et aspernatur optio debitis. Sint accusamus optio consequuntur dolores. Excepturi repellendus perferendis aut et ex distinctio voluptatibus. In architecto fuga delectus et aut sed.",
            "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": "reprehenderit_enim",
                "uuid": "de1cf3a3-3818-11ed-b246-5600040f110d",
                "name": "Ms. Dariana VonRueden DDS",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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=dolor" \
    --form "manifest=voluptatum" \
    --form "vert_shader=labore" \
    --form "assets[][email protected]/tmp/phpR2tcOM" 
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', 'dolor');
body.append('manifest', 'voluptatum');
body.append('vert_shader', 'labore');
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' => 'dolor'
            ],
            [
                'name' => 'manifest',
                'contents' => 'voluptatum'
            ],
            [
                'name' => 'vert_shader',
                'contents' => 'labore'
            ],
            [
                'name' => 'assets[]',
                'contents' => fopen('/tmp/phpR2tcOM', '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"
            }
        ],
        "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": "minima_facere",
        "version": "1.0.0",
        "api_version": "1.0",
        "name": "Prof.",
        "description": "Sunt eius labore recusandae ipsa optio. Voluptatem reprehenderit quis quaerat fuga laboriosam. Aspernatur iusto quidem et asperiores fuga neque.",
        "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": "nostrum_illum",
            "uuid": "de1fe88e-3818-11ed-b246-5600040f110d",
            "name": "Angus Kulas Sr.",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "created_at": "2022-09-19T12:44:57.000000Z",
        "updated_at": "2022-09-19T12:44:57.000000Z"
    }
}
 

Request      

POST api/1.0/theme

Body Parameters

frag_shader  string optional  

Optional custom fragment shader

manifest  string  

Theme manifest configuration

vert_shader  string optional  

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"
            }
        ],
        "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": "aliquid_omnis",
        "version": "1.0.0",
        "api_version": "1.0",
        "name": "Dr.",
        "description": "Ratione molestiae beatae eligendi. Accusamus et ipsum facilis sunt deserunt rerum alias. Praesentium consequatur autem architecto in voluptatibus explicabo maxime earum. Asperiores eum ipsam quo aut omnis facilis doloribus.",
        "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": "et_nostrum",
            "uuid": "de212ba4-3818-11ed-b246-5600040f110d",
            "name": "Bridgette Emmerich",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "created_at": "2022-09-19T12:44:57.000000Z",
        "updated_at": "2022-09-19T12:44:57.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"
                }
            ],
            "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": "modi_aut",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Miss",
            "description": "Ut fuga vel dolorum officia. Possimus non ut non eos magni iusto. Unde dicta repellat esse ea molestiae.",
            "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": "eos_et",
                "uuid": "de22bbbf-3818-11ed-b246-5600040f110d",
                "name": "Liza Parisian DVM",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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"
                }
            ],
            "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": "autem_qui",
            "version": "1.0.0",
            "api_version": "1.0",
            "name": "Ms.",
            "description": "Incidunt dolorem non dolores corporis. Dolorem rerum dolorem maxime deleniti. Ad aperiam pariatur veritatis totam.",
            "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": "assumenda_necessitatibus",
                "uuid": "de234777-3818-11ed-b246-5600040f110d",
                "name": "Viola Simonis",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z"
            },
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.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"
            }
        ],
        "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": "id_quia",
        "version": "1.0.0",
        "api_version": "1.0",
        "name": "Ms.",
        "description": "Est aperiam similique animi labore. Non est sunt neque et dolores sit accusantium. Veritatis autem et veritatis commodi voluptate. Necessitatibus sint optio aut enim aliquid sit eveniet. Commodi voluptatibus eos natus.",
        "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": "fuga_eligendi",
            "uuid": "de254edf-3818-11ed-b246-5600040f110d",
            "name": "Kristopher Streich",
            "created_at": "2022-09-19T12:44:57.000000Z",
            "updated_at": "2022-09-19T12:44:57.000000Z"
        },
        "created_at": "2022-09-19T12:44:57.000000Z",
        "updated_at": "2022-09-19T12:44:57.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/aut" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://dddice.com/api/1.0/theme/dddice-standard/version/aut"
);

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

Example response (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": "Bryana Osinski",
        "username": "ut_veritatis",
        "updated_at": "2022-09-19T12:44:57.000000Z",
        "created_at": "2022-09-19T12:44:57.000000Z",
        "rooms": [
            {
                "is_public": true,
                "name": "Untitled Room",
                "bg_file_path": null,
                "passcode": "vero",
                "slug": "vlpkUR2",
                "created_at": "2022-09-19T12:44:57.000000Z",
                "updated_at": "2022-09-19T12:44:57.000000Z",
                "deleted_at": null
            }
        ]
    }
}
 

Request      

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

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

Example response (204):

[Empty response]
 

Request      

DELETE api/1.0/user/token/{token}

URL Parameters

token  string  

Token