NAV -image
bash javascript

Introduction

Themes-API Documentation

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

Base URL

http://127.0.0.1:8000/api

Authenticating requests

This API is not authenticated.

Common endpoints

Ping

Returns a "pong" response from the server with the version

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/ping" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/ping"
);

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

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

Request   

GET api/ping

Tag endpoints

Get Tags

Return a list af tags

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/tags?page=1&per_page=100" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/tags"
);

let params = {
    "page": "1",
    "per_page": "100",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):

{
    "data": [
        {
            "id": 56747737,
            "name": "dolores",
            "created_at": "1970-08-22T17:40:56.000000Z",
            "updated_at": "2018-04-08T11:04:49.000000Z"
        },
        {
            "id": 5017849,
            "name": "et",
            "created_at": "2000-02-04T07:25:28.000000Z",
            "updated_at": "2008-12-26T05:18:07.000000Z"
        }
    ]
}

Request   

GET api/tags

Query Parameters

page  integer optional  
Pagination parameter.

per_page  integer optional  
Pagination parameter.

Create Tag

Returns a newly created tag object

requires authentication

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/tags" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"\"Nemanja\""}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/tags"
);

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

let body = {
    "name": "\"Nemanja\""
}

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

Example response (200):

{
    "id": 41899,
    "name": "rerum",
    "created_at": "2005-12-08T10:04:36.000000Z",
    "updated_at": "2019-03-01T18:33:30.000000Z"
}

Request   

POST api/tags

Body Parameters

name  string  
Tag name.

Template endpoints

List templates

Returns a list of templates

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/templates" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/templates"
);

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

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

Request   

GET api/templates

Create template

Returns a newly created template

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/templates" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"eaque","thumbnail":"https:\/\/www.hane.org\/nulla-quo-aut-tempora-perferendis","content":"iste","category":["odio"],"marketer":false}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/templates"
);

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

let body = {
    "title": "eaque",
    "thumbnail": "https:\/\/www.hane.org\/nulla-quo-aut-tempora-perferendis",
    "content": "iste",
    "category": [
        "odio"
    ],
    "marketer": false
}

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

Request   

POST api/templates

Body Parameters

title  string  

thumbnail  string  
The value must be a valid URL.

content  string  

category  string[]  

marketer  boolean optional  

Get Template

Returns a single template

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/templates/in" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/templates/in"
);

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

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

Request   

GET api/templates/{template}

URL Parameters

template  string  

Update Template

Returns and updated template

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/templates/ea" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"thumbnail":"http:\/\/www.zulauf.org\/ut-aspernatur-dolore-sunt-et","content":{},"category":["ipsa"],"marketer":false}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/templates/ea"
);

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

let body = {
    "thumbnail": "http:\/\/www.zulauf.org\/ut-aspernatur-dolore-sunt-et",
    "content": {},
    "category": [
        "ipsa"
    ],
    "marketer": false
}

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

Request   

PUT api/templates/{template}

PATCH api/templates/{template}

URL Parameters

template  string  

Body Parameters

thumbnail  string optional  
The value must be a valid URL.

content  string optional  

category  string[] optional  

marketer  boolean optional  

Delete template

Example request:

curl -X DELETE \
    "http://127.0.0.1:8000/api/api/templates/sit" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/templates/sit"
);

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

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

Request   

DELETE api/templates/{template}

URL Parameters

template  string  

Theme endpoints

List Themes

Returns a list of themes

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/themes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/themes"
);

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

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

Request   

GET api/themes

Create Theme

Returns a newly created theme

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/themes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"veritatis","thumbnail":"http:\/\/muller.info\/molestias-sit-minima-id-esse-quia-nostrum.html","settings":["cumque"],"category":["velit"],"layouts":["ut"],"blocks":["rem"],"marketer":false}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/themes"
);

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

let body = {
    "title": "veritatis",
    "thumbnail": "http:\/\/muller.info\/molestias-sit-minima-id-esse-quia-nostrum.html",
    "settings": [
        "cumque"
    ],
    "category": [
        "velit"
    ],
    "layouts": [
        "ut"
    ],
    "blocks": [
        "rem"
    ],
    "marketer": false
}

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

Request   

POST api/themes

Body Parameters

title  string  

thumbnail  string  
The value must be a valid URL.

settings  string[]  

category  string[]  

layouts  string[] optional  

blocks  string[] optional  

marketer  boolean optional  

Get Theme

Returns a single theme

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/themes/cum" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/themes/cum"
);

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

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

Request   

GET api/themes/{theme}

URL Parameters

theme  string  

Update Theme

Returns an updated theme

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/themes/possimus" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"thumbnail":"http:\/\/homenick.org\/","settings":["animi"],"category":["veritatis"],"layouts":["sed"],"blocks":["aspernatur"],"marketer":false}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/themes/possimus"
);

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

let body = {
    "thumbnail": "http:\/\/homenick.org\/",
    "settings": [
        "animi"
    ],
    "category": [
        "veritatis"
    ],
    "layouts": [
        "sed"
    ],
    "blocks": [
        "aspernatur"
    ],
    "marketer": false
}

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

Request   

PUT api/themes/{theme}

PATCH api/themes/{theme}

URL Parameters

theme  string  

Body Parameters

thumbnail  string optional  
The value must be a valid URL.

settings  string[] optional  

category  string[] optional  

layouts  string[] optional  

blocks  string[] optional  

marketer  boolean optional  

Delete Theme

Example request:

curl -X DELETE \
    "http://127.0.0.1:8000/api/api/themes/dolore" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/themes/dolore"
);

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

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

Request   

DELETE api/themes/{theme}

URL Parameters

theme  string