MENU navbar-image

Introduction

API do zarządzania kampaniami TTRPG, treściami, mapami, kartami postaci i podręcznikami.

Integracje Mistrza Gry używają tokenów Sanctum z odpowiednimi uprawnieniami. Gracze korzystają z zalogowanej sesji lub tokenu zwróconego podczas logowania. Dostęp do treści kart postaci wymaga dodatkowego, krótkotrwałego tokenu odblokowania PIN.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {TWÓJ_TOKEN}".

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

MG tworzy token w panelu Integracje API. Token jest wyświetlany tylko raz.

Authentication

Registration and short-lived application sessions.

Register an account.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/auth/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"email\": \"zbailey@example.net\",
    \"password\": \"-0pBNvYgxw\",
    \"role\": \"architecto\",
    \"device_name\": \"n\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/auth/register"
);

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

let body = {
    "name": "b",
    "email": "zbailey@example.net",
    "password": "-0pBNvYgxw",
    "role": "architecto",
    "device_name": "n"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/auth/register

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: zbailey@example.net

password   string     

Must be at least 8 characters. Example: -0pBNvYgxw

role   string     

Example: architecto

locale   string  optional    
device_name   string  optional    

Must not be greater than 100 characters. Example: n

Log in and issue a two-hour token.

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"|]|{+-\",
    \"device_name\": \"v\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/auth/login"
);

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

let body = {
    "email": "gbailey@example.net",
    "password": "|]|{+-",
    "device_name": "v"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/auth/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

password   string     

Example: |]|{+-

device_name   string  optional    

Must not be greater than 100 characters. Example: v

Log out the current session or revoke its token.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/auth/logout" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/auth/logout"
);

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


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/auth/logout

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Endpoints

GET api/v1/me

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/me" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/me"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/me

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

GM

Campaigns and memberships Manage campaigns owned by the authenticated game master.

GET api/v1/gm/campaigns

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/gm/campaigns

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Et animi quos velit et fugiat.\",
    \"is_archived\": false
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns"
);

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

let body = {
    "name": "b",
    "description": "Et animi quos velit et fugiat.",
    "is_archived": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

description   string  optional    

Must not be greater than 10000 characters. Example: Et animi quos velit et fugiat.

is_archived   boolean  optional    

Example: false

GET api/v1/gm/campaigns/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the campaign. Example: architecto

campaign   integer     

Campaign ID. Example: 1

PUT api/v1/gm/campaigns/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"description\": \"Et animi quos velit et fugiat.\",
    \"is_archived\": true,
    \"regenerate_invite_code\": false
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto"
);

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

let body = {
    "name": "b",
    "description": "Et animi quos velit et fugiat.",
    "is_archived": true,
    "regenerate_invite_code": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{id}

PATCH api/v1/gm/campaigns/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the campaign. Example: architecto

campaign   integer     

Campaign ID. Example: 1

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

description   string  optional    

Must not be greater than 10000 characters. Example: Et animi quos velit et fugiat.

is_archived   boolean  optional    

Example: true

regenerate_invite_code   boolean  optional    

Example: false

DELETE api/v1/gm/campaigns/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the campaign. Example: architecto

campaign   integer     

Campaign ID. Example: 1

List campaign members.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/members

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   integer     

Campaign ID. Example: 1

Add or update a campaign membership.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 16,
    \"email\": \"zbailey@example.net\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members"
);

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

let body = {
    "user_id": 16,
    "email": "zbailey@example.net"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/members

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   integer     

Campaign ID. Example: 1

Body Parameters

user_id   integer  optional    

This field is required when email is not present. Must match an existing stored value. Example: 16

email   string  optional    

This field is required when user_id is not present. Must be a valid email address. Must match an existing stored value. Example: zbailey@example.net

role   string  optional    

Remove a campaign member.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members/2" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/1/members/2"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/members/{user}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   integer     

Campaign ID. Example: 1

user   integer     

Member user ID. Example: 2

Content and assets Manage campaign notes, locations, NPCs, items, quests, and image assets.

GET api/v1/gm/campaigns/{campaign}/contents

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/contents

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

POST api/v1/gm/campaigns/{campaign}/contents

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents"
);

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


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/contents

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

GET api/v1/gm/campaigns/{campaign}/contents/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/contents/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the content. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/contents/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto"
);

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


fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/contents/{id}

PATCH api/v1/gm/campaigns/{campaign}/contents/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the content. Example: architecto

DELETE api/v1/gm/campaigns/{campaign}/contents/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/contents/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/contents/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the content. Example: architecto

Upload a campaign image.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/assets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "image=@G:\projekty\php\ttrpg-manager\storage\app\tmp\php8C14.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/assets"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/assets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

Body Parameters

image   file     

JPEG, PNG, GIF or WebP image (max 10 MB). Example: G:\projekty\php\ttrpg-manager\storage\app\tmp\php8C14.tmp

Maps and time Manage maps, map pins, time trackers, and tracker entries.

GET api/v1/gm/campaigns/{campaign}/maps

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/maps

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

POST api/v1/gm/campaigns/{campaign}/maps

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"image_asset_id\": 16,
    \"title\": \"n\",
    \"description\": \"Animi quos velit et fugiat.\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps"
);

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

let body = {
    "image_asset_id": 16,
    "title": "n",
    "description": "Animi quos velit et fugiat."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/maps

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

Body Parameters

image_asset_id   integer     

Example: 16

title   string     

Must not be greater than 255 characters. Example: n

description   string  optional    

Must not be greater than 10000 characters. Example: Animi quos velit et fugiat.

visibility   string  optional    

GET api/v1/gm/campaigns/{campaign}/maps/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/maps/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the map. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/maps/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"image_asset_id\": 16,
    \"title\": \"n\",
    \"description\": \"Animi quos velit et fugiat.\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto"
);

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

let body = {
    "image_asset_id": 16,
    "title": "n",
    "description": "Animi quos velit et fugiat."
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/maps/{id}

PATCH api/v1/gm/campaigns/{campaign}/maps/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the map. Example: architecto

Body Parameters

image_asset_id   integer  optional    

Example: 16

title   string  optional    

Must not be greater than 255 characters. Example: n

description   string  optional    

Must not be greater than 10000 characters. Example: Animi quos velit et fugiat.

visibility   string  optional    

DELETE api/v1/gm/campaigns/{campaign}/maps/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/maps/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the map. Example: architecto

GET api/v1/gm/campaigns/{campaign}/maps/{map}/pins

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/maps/{map}/pins

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

POST api/v1/gm/campaigns/{campaign}/maps/{map}/pins

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins"
);

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


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/maps/{map}/pins

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

GET api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

id   string     

The ID of the pin. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto"
);

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


fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

PATCH api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

id   string     

The ID of the pin. Example: architecto

DELETE api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/maps/architecto/pins/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/maps/{map}/pins/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

id   string     

The ID of the pin. Example: architecto

GET api/v1/gm/campaigns/{campaign}/trackers

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/trackers

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

POST api/v1/gm/campaigns/{campaign}/trackers

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers"
);

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


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/trackers

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

GET api/v1/gm/campaigns/{campaign}/trackers/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/trackers/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the tracker. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/trackers/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto"
);

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


fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/trackers/{id}

PATCH api/v1/gm/campaigns/{campaign}/trackers/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the tracker. Example: architecto

DELETE api/v1/gm/campaigns/{campaign}/trackers/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/trackers/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the tracker. Example: architecto

GET api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

tracker   string     

The tracker. Example: architecto

POST api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries"
);

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


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

tracker   string     

The tracker. Example: architecto

GET api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

tracker   string     

The tracker. Example: architecto

id   string     

The ID of the entry. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto"
);

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


fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

PATCH api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

tracker   string     

The tracker. Example: architecto

id   string     

The ID of the entry. Example: architecto

DELETE api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/trackers/architecto/entries/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/trackers/{tracker}/entries/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

tracker   string     

The tracker. Example: architecto

id   string     

The ID of the entry. Example: architecto

Character sheets Manage all character sheets in owned campaigns. PIN hashes are never returned.

GET api/v1/gm/campaigns/{campaign}/sheets

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/sheets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

POST api/v1/gm/campaigns/{campaign}/sheets

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"owner_user_id\": 16,
    \"name\": \"n\",
    \"content_html\": \"g\",
    \"pin\": \"1374491716\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets"
);

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

let body = {
    "owner_user_id": 16,
    "name": "n",
    "content_html": "g",
    "pin": "1374491716"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/gm/campaigns/{campaign}/sheets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

Body Parameters

owner_user_id   integer     

Example: 16

avatar_asset_id   string  optional    
name   string     

Must not be greater than 255 characters. Example: n

content_html   string  optional    

Must not be greater than 1000000 characters. Example: g

pin   string     

Must be between 4 and 12 digits. Example: 1374491716

GET api/v1/gm/campaigns/{campaign}/sheets/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/campaigns/{campaign}/sheets/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the sheet. Example: architecto

PUT api/v1/gm/campaigns/{campaign}/sheets/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"owner_user_id\": 16,
    \"name\": \"n\",
    \"content_html\": \"g\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto"
);

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

let body = {
    "owner_user_id": 16,
    "name": "n",
    "content_html": "g"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/sheets/{id}

PATCH api/v1/gm/campaigns/{campaign}/sheets/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the sheet. Example: architecto

Body Parameters

owner_user_id   integer  optional    

Example: 16

avatar_asset_id   string  optional    
name   string  optional    

Must not be greater than 255 characters. Example: n

content_html   string  optional    

Must not be greater than 1000000 characters. Example: g

DELETE api/v1/gm/campaigns/{campaign}/sheets/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/campaigns/{campaign}/sheets/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the sheet. Example: architecto

Set a new PIN and revoke all existing sheet unlocks.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto/pin" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"pin\": \"1374491716\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/campaigns/architecto/sheets/architecto/pin"
);

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

let body = {
    "pin": "1374491716"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/gm/campaigns/{campaign}/sheets/{sheet}/pin

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

sheet   string     

The sheet. Example: architecto

Body Parameters

pin   string     

Must be between 4 and 12 digits. Example: 1374491716

Handbooks Upload private PDFs, inspect processing metadata, and search extracted pages.

GET api/v1/gm/handbooks

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/handbooks" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/handbooks

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Upload a private PDF and queue text extraction.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/handbooks" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "title=b"\
    --form "campaign_id=16"\
    --form "language=ngzm"\
    --form "pdf=@G:\projekty\php\ttrpg-manager\storage\app\tmp\php8C73.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('title', 'b');
body.append('campaign_id', '16');
body.append('language', 'ngzm');
body.append('pdf', document.querySelector('input[name="pdf"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/gm/handbooks

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

pdf   file     

PDF file (max 50 MB). Example: G:\projekty\php\ttrpg-manager\storage\app\tmp\php8C73.tmp

title   string     

Must not be greater than 255 characters. Example: b

campaign_id   integer  optional    

Example: 16

language   string  optional    

Must not be greater than 12 characters. Example: ngzm

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/handbooks/search" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"query\": \"b\",
    \"handbook_ids\": [
        16
    ],
    \"limit\": 2
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/search"
);

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

let body = {
    "query": "b",
    "handbook_ids": [
        16
    ],
    "limit": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

GET api/v1/gm/handbooks/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/handbooks/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the handbook. Example: architecto

PUT api/v1/gm/handbooks/{id}

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"b\",
    \"campaign_id\": 16,
    \"language\": \"ngzm\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto"
);

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

let body = {
    "title": "b",
    "campaign_id": 16,
    "language": "ngzm"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/gm/handbooks/{id}

PATCH api/v1/gm/handbooks/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the handbook. Example: architecto

Body Parameters

title   string  optional    

Must not be greater than 255 characters. Example: b

campaign_id   integer  optional    

Example: 16

language   string  optional    

Must not be greater than 12 characters. Example: ngzm

GET api/v1/gm/handbooks/{handbook}/pages

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto/pages" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto/pages"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/handbooks/{handbook}/pages

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

handbook   string     

The handbook. Example: architecto

requires authentication

Use the returned url in an iframe, new tab, or window.open. Optional #page=N is appended for native browser PDF viewers.

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto/preview-link?page=12&expires_in=600" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"page\": 16,
    \"expires_in\": 61
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto/preview-link"
);

const params = {
    "page": "12",
    "expires_in": "600",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "page": 16,
    "expires_in": 61
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

DELETE api/v1/gm/handbooks/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/handbooks/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/handbooks/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the handbook. Example: architecto

API tokens Manage persistent, ability-scoped GM integration tokens. Plain text is returned only once.

GET api/v1/gm/tokens

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/gm/tokens" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/tokens"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/gm/tokens

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/v1/gm/tokens

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/gm/tokens" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"abilities\": [
        \"architecto\"
    ],
    \"expires_in_days\": 2
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/tokens"
);

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

let body = {
    "name": "b",
    "abilities": [
        "architecto"
    ],
    "expires_in_days": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/gm/tokens

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Must not be greater than 100 characters. Example: b

abilities   string[]  optional    
expires_in_days   integer  optional    

Must be between 1 and 365. Example: 2

DELETE api/v1/gm/tokens/{id}

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/gm/tokens/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/gm/tokens/architecto"
);

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


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/gm/tokens/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the token. Example: architecto

Player

Campaigns List joined campaigns and join a campaign using its invitation code.

GET api/v1/player/campaigns

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Join a campaign.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/player/campaigns/join" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"invite_code\": \"ABCDE12345\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/join"
);

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

let body = {
    "invite_code": "ABCDE12345"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/player/campaigns/join

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

invite_code   string     

Campaign invitation code. Example: ABCDE12345

GET api/v1/player/campaigns/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the campaign. Example: architecto

Campaign data Read player-visible campaign content, maps, pins, and time trackers.

GET api/v1/player/campaigns/{campaign}/contents

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/contents" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/contents"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/contents

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

GET api/v1/player/campaigns/{campaign}/contents/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/contents/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/contents/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/contents/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the content. Example: architecto

GET api/v1/player/campaigns/{campaign}/maps

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/maps

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

GET api/v1/player/campaigns/{campaign}/maps/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/maps/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the map. Example: architecto

GET api/v1/player/campaigns/{campaign}/maps/{map}/pins

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps/architecto/pins" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/maps/architecto/pins"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/maps/{map}/pins

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

map   string     

The map. Example: architecto

GET api/v1/player/campaigns/{campaign}/trackers

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/trackers" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/trackers"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/trackers

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

GET api/v1/player/campaigns/{campaign}/trackers/{id}

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/trackers/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/trackers/architecto"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/trackers/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the tracker. Example: architecto

Character sheets Sheet metadata is campaign-visible. Content requires a short-lived token in X-Sheet-Unlock.

GET api/v1/player/campaigns/{campaign}/sheets

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets"
);

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


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/sheets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

POST api/v1/player/campaigns/{campaign}/sheets

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"content_html\": \"n\",
    \"pin\": \"1374491716\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets"
);

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

let body = {
    "name": "b",
    "content_html": "n",
    "pin": "1374491716"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/player/campaigns/{campaign}/sheets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

Body Parameters

avatar_asset_id   string  optional    
name   string     

Must not be greater than 255 characters. Example: b

content_html   string  optional    

Must not be greater than 1000000 characters. Example: n

pin   string     

Must be between 4 and 12 digits. Example: 1374491716

POST api/v1/player/campaigns/{campaign}/sheet-assets

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheet-assets" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "image=@G:\projekty\php\ttrpg-manager\storage\app\tmp\php8CC3.tmp" 
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheet-assets"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/player/campaigns/{campaign}/sheet-assets

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

Body Parameters

image   file     

Must be an image. Must not be greater than 10240 kilobytes. Example: G:\projekty\php\ttrpg-manager\storage\app\tmp\php8CC3.tmp

Verify a PIN and issue a 15-minute sheet unlock.

requires authentication

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto/verify-pin" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"pin\": \"1374491716\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto/verify-pin"
);

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

let body = {
    "pin": "1374491716"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (422):


{
    "message": "Podany PIN jest nieprawidłowy.",
    "errors": {
        "pin": [
            "Podany PIN jest nieprawidłowy."
        ]
    }
}
 

Request      

POST api/v1/player/campaigns/{campaign}/sheets/{sheet}/verify-pin

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

sheet   string     

The sheet. Example: architecto

Body Parameters

pin   string     

Must be between 4 and 12 digits. Example: 1374491716

Open a sheet.

requires authentication

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "X-Sheet-Unlock: required Short-lived sheet unlock token." \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "X-Sheet-Unlock": "required Short-lived sheet unlock token.",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/v1/player/campaigns/{campaign}/sheets/{sheet}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

X-Sheet-Unlock        

Example: required Short-lived sheet unlock token.

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

sheet   string     

The sheet. Example: architecto

Update an owned sheet.

requires authentication

Example request:
curl --request PUT \
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "X-Sheet-Unlock: required An unlock token with edit ability." \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"content_html\": \"n\"
}"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "X-Sheet-Unlock": "required An unlock token with edit ability.",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "b",
    "content_html": "n"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/player/campaigns/{campaign}/sheets/{id}

PATCH api/v1/player/campaigns/{campaign}/sheets/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

X-Sheet-Unlock        

Example: required An unlock token with edit ability.

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the sheet. Example: architecto

Body Parameters

avatar_asset_id   string  optional    
name   string  optional    

Must not be greater than 255 characters. Example: b

content_html   string  optional    

Must not be greater than 1000000 characters. Example: n

Delete an owned sheet.

requires authentication

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto" \
    --header "Authorization: Bearer {TWÓJ_TOKEN}" \
    --header "X-Sheet-Unlock: required An unlock token with edit ability." \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/v1/player/campaigns/architecto/sheets/architecto"
);

const headers = {
    "Authorization": "Bearer {TWÓJ_TOKEN}",
    "X-Sheet-Unlock": "required An unlock token with edit ability.",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/player/campaigns/{campaign}/sheets/{id}

Headers

Authorization        

Example: Bearer {TWÓJ_TOKEN}

X-Sheet-Unlock        

Example: required An unlock token with edit ability.

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

campaign   string     

The campaign. Example: architecto

id   string     

The ID of the sheet. Example: architecto