Items


All Items

You can get a list of all the items 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 items Default

Results

{
    "data": [
        {
            "id": 1,
            "name": "Spear",
            "entry": "\n<p>Lorem Ipsum.</p>\n",
            "image": "{path}",
            "image_full": "{url}",
            "image_thumb": "{url}",
            "has_custom_image": false,
            "is_private": true,
            "entity_id": 7,
            "tags": [],
            "created_at":  "2019-01-30T00:01:44.000000Z",
            "created_by": 1,
            "updated_at":  "2019-08-29T13:48:54.000000Z",
            "updated_by": 1,
            "location_id": 4,
            "character_id": 2,
            "type": "Weapon",
            "price": "25 gp",
            "size": "1 lb."
        }
    ]
}

Filters

The list of returned items can be filtered. The available filters are available here: API filters.

Item

To get the details of a single item, use the following endpoint.

Method Endpoint Headers
GET/HEAD items/{item.id} Default

Results

{
    "data": {
        "id": 1,
        "name": "Spear",
        "entry": "\n<p>Lorem Ipsum.</p>\n",
        "image": "{path}",
        "image_full": "{url}",
        "image_thumb": "{url}",
        "has_custom_image": false,
        "is_private": true,
        "entity_id": 7,
        "tags": [],
        "created_at":  "2019-01-30T00:01:44.000000Z",
        "created_by": 1,
        "updated_at":  "2019-08-29T13:48:54.000000Z",
        "updated_by": 1,
        "location_id": 4,
        "character_id": 2,
        "type": "Weapon",
        "price": "25 gp",
        "size": "1 lb."
    }

}

Create a Item

To create a item, use the following endpoint.

Method Endpoint Headers
POST items Default

Body

Parameter Type Detail
name string (Required) Name of the item
entry string The html description of the item
type string The item's type
location_id integer The item's location
character_id integer The item's owner
price string The item's price
size string The item's size
tags array Array of tag ids
is_private boolean If the item is only visible to admin members of the campaign
image_url string URL to a picture to be used for the item

Results

{success} Code 200 with JSON body of the new item.

Update a Item

To update a item, use the following endpoint.

Method Endpoint Headers
PUT/PATCH items/{item.id} Default

Body

The same body parameters are available as for when creating a item.

Results

{success} Code 200 with JSON body of the updated item.

Delete a Item

To delete a item, use the following endpoint.

Method Endpoint Headers
DELETE items/{item.id} Default

Results

{success} Code 200 with JSON.