Kanka logo Kanka

Dice Rolls


All Dice Rolls

You can get a list of all the dice-rolls of a campaign by using the following endpoint.

{warning} Don't forget that all endpoints documented here need to be prefixed with api/1.0/campaigns/{campaign.id}/.

Method Endpoint Headers
GET/HEAD dice_rolls Default

Results

{
    "data": [
        {
            "id": 1,
            "name": "Super Dice",
            "entry": "\n<p>Lorem Ipsum.</p>\n",
            "image": "{path}",
            "image_full": "{url}",
            "image_thumb": "{url}",
            "is_private": false,
            "entity_id": 302,
            "tags": [],
            "created_at": {
                "date": "2017-10-31 10:55:08.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "created_by": 1,
            "updated_at": {
                "date": "2018-09-20 09:18:58.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "updated_by": 1,
            "character_id": 1,
            "system": "standard",
            "parameters": "2d2",
            "rolls": [
              "2",
              "4",
              "2"
            ]
        }
    ]
}

Dice Roll

To get the details of a single dice-roll, use the following endpoint.

Method Endpoint Headers
GET/HEAD dice_rolls/{dice_roll.id} Default

Results

{
    "data": {
        "id": 1,
        "name": "Super Dice",
        "entry": "\n<p>Lorem Ipsum.</p>\n",
        "image": "{path}",
        "image_full": "{url}",
        "image_thumb": "{url}",
        "is_private": false,
        "entity_id": 302,
        "tags": [],
        "created_at": {
            "date": "2017-10-31 10:55:08.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "created_by": 1,
        "updated_at": {
            "date": "2018-09-20 09:18:58.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "updated_by": 1,
        "character_id": 1,
        "system": "standard",
        "parameters": "2d2",
        "rolls": [
          "2",
          "4",
          "2"
        ]
    }

}

Create a Dice Roll

To create a dice-roll, use the following endpoint.

Method Endpoint Headers
POST dice_rolls Default

Body

Parameter Type Detail
name string (Required) Name of the dice-roll
parameters string (required) The dice-roll's parameters (dice roll config)
system string The dice-roll's system (always standard)
character_id integer The dice-roll's owner
tags array Array of tag ids
is_private boolean If the dice-roll is only visible to admin members of the campaign
image stream Stream to file uploaded to the dice-roll
image_url string URL to a picture to be used for the dice-roll

Results

{success} Code 200 with JSON body of the new dice-roll.

Update a Dice Roll

To update a dice-roll, use the following endpoint.

Method Endpoint Headers
PUT/PATCH dice_rolls/{dice_roll.id} Default

Body

The same body parameters are available as for when creating a dice-roll.

Results

{success} Code 200 with JSON body of the updated dice-roll.

Delete a Dice Roll

To delete a dice-roll, use the following endpoint.

Method Endpoint Headers
DELETE dice_rolls/{dice_roll.id} Default

Results

{success} Code 200 with JSON.