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());
Received response:
Request failed with error:
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"
}
]
}
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"
}
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error: