NAV -image
bash javascript

Introduction

Resource-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.

1. 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

2. Marketing plan endpoints

Get Marketing Plans

Returns a list of marketing plans

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/marketing_plans?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/marketing_plans"
);

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": 7,
            "date": {
                "date": "2021-03-27 20:57:21.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "option_1": "autem",
            "option_2": "et",
            "option_3": "veniam"
        },
        {
            "id": 99544,
            "date": {
                "date": "2021-04-11 01:05:42.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "option_1": "et",
            "option_2": "minima",
            "option_3": "voluptatum"
        }
    ]
}

Request   

GET api/marketing_plans

Query Parameters

page  integer optional  
Pagination parameter.

per_page  integer optional  
Pagination parameter.

Create Marketing Plan

Returns newly created marketing plan

requires authentication

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/marketing_plans" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"date":"2020-12-01"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/marketing_plans"
);

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

let body = {
    "date": "2020-12-01"
}

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

Request   

POST api/marketing_plans

Body Parameters

date  string optional  
Date in Y-m-d format.

Show Marketing Plan

Returns a single marketing plan

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 98721466,
    "date": {
        "date": "2021-04-01 00:41:56.000000",
        "timezone_type": 3,
        "timezone": "UTC"
    },
    "option_1": "velit",
    "option_2": "vel",
    "option_3": "ut"
}

Request   

GET api/marketing_plans/{marketing_plan}

URL Parameters

marketing_plan  string  
Marketing Plan Id.

Update Marketing Plan

Returns an updated marketing plan

requires authentication

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/marketing_plans/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"date":"2021-04-19T13:52:38+0000"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/marketing_plans/1"
);

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

let body = {
    "date": "2021-04-19T13:52:38+0000"
}

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

Example response (200):

{
    "id": 989,
    "date": {
        "date": "2021-03-24 03:42:02.000000",
        "timezone_type": 3,
        "timezone": "UTC"
    },
    "option_1": "unde",
    "option_2": "qui",
    "option_3": "sint"
}

Request   

PUT api/marketing_plans/{marketing_plan}

PATCH api/marketing_plans/{marketing_plan}

URL Parameters

marketing_plan  string  
Marketing Plan Id.

Body Parameters

date  string optional  
The value must be a valid date.

Delete Marketing Plan

Returns 200 after successful deletion

requires authentication

Example request:

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

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

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

Example response (200):

{
    "code": 200,
    "data": {},
    "time": 205.7879
}

Request   

DELETE api/marketing_plans/{marketing_plan}

URL Parameters

marketing_plan  string  
Marketing Plan Id.

3. Video endpoints

Get Videos

Return a list af videos

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/videos?tags=tag1%2Ctag2%2Ctag3&date=1999-12-12&upcoming=2021-12-12&category=qui&bookmarked_by=123&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/videos"
);

let params = {
    "tags": "tag1,tag2,tag3",
    "date": "1999-12-12",
    "upcoming": "2021-12-12",
    "category": "qui",
    "bookmarked_by": "123",
    "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": 6484940,
            "title": "Aliquid ut aut quam nemo.",
            "description": "Similique officia dolorum delectus harum. Veritatis totam culpa voluptatem ducimus voluptatum aut. Rem nesciunt provident magni porro praesentium.",
            "category": "aut",
            "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/002211?text=eum",
            "date": "2013-08-05T00:00:00.000000Z",
            "url": "http:\/\/blick.com\/possimus-soluta-nobis-architecto-officia-veniam",
            "video_views": null,
            "original_url_views": null,
            "popularity": null,
            "original_url": null,
            "tags": [],
            "people": []
        },
        {
            "id": 4064,
            "title": "Beatae distinctio numquam nihil dolorum et officiis dolorem.",
            "description": "Quod sunt eligendi magnam fugiat veniam et quo. Voluptas autem nobis eum aut et qui placeat deserunt. Laudantium dolorum quos ipsa accusantium sit. Est est explicabo adipisci quisquam.",
            "category": "dolorum",
            "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/00ddaa?text=nesciunt",
            "date": "1989-08-22T00:00:00.000000Z",
            "url": "https:\/\/zemlak.net\/commodi-nihil-est-iste-sed.html",
            "video_views": null,
            "original_url_views": null,
            "popularity": null,
            "original_url": null,
            "tags": [],
            "people": []
        }
    ]
}

Request   

GET api/videos

Query Parameters

tags  string optional  
Optional list of tags, coma separated.

date  string optional  
Optional date to display only the videos BEFORE that date.

upcoming  string optional  
Optional date to display only the videos AFTER that date.

category  string optional  
Category filter.

bookmarked_by  string optional  
User ID filter. Bookmark filter.

page  integer optional  
Pagination parameter.

per_page  integer optional  
Pagination parameter.

Create Video

Returns a newly created video object

requires authentication

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/videos" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"\"Jumping ball\"","description":"possimus","thumbnail":"http:\/\/www.zboncak.net\/iure-saepe-sit-nihil-ducimus.html","date":"2021-04-19T13:52:38+0000","url":"http:\/\/fisher.com\/eligendi-perferendis-qui-libero-ipsa","original_url":"https:\/\/www.stracke.com\/voluptatem-magnam-nihil-modi-in-voluptatibus","category":"\"Funny videos\"","people_ids":["dolores"],"tag_ids":["itaque"]}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/videos"
);

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

let body = {
    "title": "\"Jumping ball\"",
    "description": "possimus",
    "thumbnail": "http:\/\/www.zboncak.net\/iure-saepe-sit-nihil-ducimus.html",
    "date": "2021-04-19T13:52:38+0000",
    "url": "http:\/\/fisher.com\/eligendi-perferendis-qui-libero-ipsa",
    "original_url": "https:\/\/www.stracke.com\/voluptatem-magnam-nihil-modi-in-voluptatibus",
    "category": "\"Funny videos\"",
    "people_ids": [
        "dolores"
    ],
    "tag_ids": [
        "itaque"
    ]
}

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

Example response (200):

{
    "id": 1539,
    "title": "Soluta facere accusamus velit qui molestias corrupti.",
    "description": "Quisquam molestiae impedit fugit in maiores deserunt qui. Recusandae est consequatur nostrum corporis doloribus itaque. Ut nulla non sed sunt.",
    "category": "hic",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/0077aa?text=inventore",
    "date": "1982-04-18T00:00:00.000000Z",
    "url": "http:\/\/kohler.com\/",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

POST api/videos

Body Parameters

title  string  
Video Title.

description  text  
Video description.

thumbnail  string  
The value must be a valid URL.

date  string  
The value must be a valid date.

url  string  
The value must be a valid URL.

original_url  string optional  
The value must be a valid URL.

category  string  
Video Title.

people_ids  string[] optional  

tag_ids  string[] optional  

Show Video

Returns a single marketing plan

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 72,
    "title": "Maiores quae minus vel vero consequatur.",
    "description": "Et minus ut ex et impedit corporis dolorum. Cum quo doloribus voluptatem laudantium odit.",
    "category": "adipisci",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/0022ff?text=quia",
    "date": "1995-01-23T00:00:00.000000Z",
    "url": "http:\/\/hodkiewicz.org\/in-sit-quia-ut-voluptatem-animi",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

GET api/videos/{video}

URL Parameters

video  string  
Video Id.

Update Video

Returns an updated video

requires authentication

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/videos/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"ipsam","description":"voluptatem","thumbnail":"http:\/\/hauck.net\/illum-aut-maiores-maiores-nostrum-facilis-consequatur","date":"2021-04-19T13:52:38+0000","url":"http:\/\/www.feeney.com\/quasi-dolore-rerum-aspernatur-voluptas-earum-id-enim.html","original_url":"http:\/\/gislason.com\/","category":["illo"],"people_ids":["labore"],"tag_ids":["illo"]}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/videos/1"
);

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

let body = {
    "title": "ipsam",
    "description": "voluptatem",
    "thumbnail": "http:\/\/hauck.net\/illum-aut-maiores-maiores-nostrum-facilis-consequatur",
    "date": "2021-04-19T13:52:38+0000",
    "url": "http:\/\/www.feeney.com\/quasi-dolore-rerum-aspernatur-voluptas-earum-id-enim.html",
    "original_url": "http:\/\/gislason.com\/",
    "category": [
        "illo"
    ],
    "people_ids": [
        "labore"
    ],
    "tag_ids": [
        "illo"
    ]
}

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

Example response (200):

{
    "id": 93816,
    "title": "Eum repellat velit sed adipisci modi.",
    "description": "Velit consequuntur et porro omnis atque. Explicabo excepturi ullam repellat ab quidem quia.",
    "category": "ab",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/000022?text=impedit",
    "date": "1989-12-12T00:00:00.000000Z",
    "url": "http:\/\/www.schamberger.info\/iste-sunt-molestias-quam-neque-sunt-rerum",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

PUT api/videos/{video}

PATCH api/videos/{video}

URL Parameters

video  string  
Video Id.

Body Parameters

title  string optional  

description  string optional  

thumbnail  string optional  
The value must be a valid URL.

date  string optional  
The value must be a valid date.

url  string optional  
The value must be a valid URL.

original_url  string optional  
The value must be a valid URL.

category  string[] optional  

people_ids  string[] optional  

tag_ids  string[] optional  

Delete Video

Returns 200 after successful deletion

requires authentication

Example request:

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

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

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

Example response (200):

{
    "code": 200,
    "data": {},
    "time": 205.7879
}

Request   

DELETE api/videos/{video}

URL Parameters

video  string  
Video Id.

View Add

Increase View Views by 1

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 664767,
    "title": "In molestiae fuga ut consequatur veritatis eius.",
    "description": "Architecto et culpa quasi ea. Optio deserunt quas odio velit quasi. Incidunt nulla voluptatibus sapiente laudantium ea perferendis in et. Quo vero numquam sapiente beatae quam.",
    "category": "ipsa",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/00cc55?text=quidem",
    "date": "2006-05-14T00:00:00.000000Z",
    "url": "http:\/\/www.casper.com\/est-fugit-eos-tempore-sint-molestiae-dignissimos-ratione.html",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

GET api/videos/{video}/view_add

URL Parameters

video  string  

Original Url View Add

Increase original url views

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 762,
    "title": "Mollitia aut numquam molestiae nemo.",
    "description": "Et eos voluptatem fuga quibusdam. Vero rem rerum ut officiis aliquid. Debitis omnis qui non. Repudiandae laboriosam iure modi eum laboriosam.",
    "category": "suscipit",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/003300?text=dolore",
    "date": "1988-05-31T00:00:00.000000Z",
    "url": "http:\/\/www.hoppe.com\/soluta-velit-est-maiores-libero-enim-laboriosam",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

GET api/videos/{video}/original_url_view_add

URL Parameters

video  string  

Create Bookmark

Creates a bookmark for a video and returns a bookmark object

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/videos/1/bookmarks" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/videos/1/bookmarks"
);

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

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

Request   

POST api/videos/{video}/bookmarks

URL Parameters

video  string  
Video Id.

Delete Bookmark

Creates a bookmark for a video and returns a bookmark object

Example request:

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

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

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

Request   

DELETE api/videos/{video}/bookmarks

URL Parameters

video  string  
Video Id.

4. People endpoints

Get People

Return a list af people

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/people?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/people"
);

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": 59,
            "name": "Cyril Grady",
            "title": "Prof.",
            "image": "https:\/\/via.placeholder.com\/640x480.png\/0044aa?text=sit",
            "updated_at": "2021-04-19T13:52:38.000000Z",
            "created_at": "2021-04-19T13:52:38.000000Z"
        },
        {
            "id": 6046428,
            "name": "Icie Russel",
            "title": "Miss",
            "image": "https:\/\/via.placeholder.com\/640x480.png\/0077ee?text=aliquid",
            "updated_at": "2021-04-19T13:52:38.000000Z",
            "created_at": "2021-04-19T13:52:38.000000Z"
        }
    ]
}

Request   

GET api/people

Query Parameters

page  integer optional  
Pagination parameter.

per_page  integer optional  
Pagination parameter.

Create Person

Returns a newly created person object

requires authentication

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/people" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"eos","title":"eaque","bio":"voluptas","image":"http:\/\/haley.com\/","video_ids":["enim"]}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/people"
);

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

let body = {
    "name": "eos",
    "title": "eaque",
    "bio": "voluptas",
    "image": "http:\/\/haley.com\/",
    "video_ids": [
        "enim"
    ]
}

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

Example response (200):

{
    "id": 94,
    "name": "Darian Balistreri",
    "title": "Mrs.",
    "image": "https:\/\/via.placeholder.com\/640x480.png\/000077?text=aspernatur",
    "updated_at": "2021-04-19T13:52:38.000000Z",
    "created_at": "2021-04-19T13:52:38.000000Z"
}

Request   

POST api/people

Body Parameters

name  string  

title  string optional  

bio  string optional  

image  string  
The value must be a valid URL.

video_ids  string[] optional  

Show Video

Returns a single marketing plan

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 285961,
    "name": "Chloe Erdman",
    "title": "Mr.",
    "image": "https:\/\/via.placeholder.com\/640x480.png\/00cc00?text=ut",
    "updated_at": "2021-04-19T13:52:38.000000Z",
    "created_at": "2021-04-19T13:52:38.000000Z"
}

Request   

GET api/people/{person}

URL Parameters

person  string  
Video Id.

Update Person

Returns an updated person

requires authentication

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/people/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"name":"soluta","title":"est","bio":"at","image":"http:\/\/www.rippin.net\/aut-sint-soluta-temporibus-pariatur-impedit-inventore.html","video_ids":["sequi"]}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/people/1"
);

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

let body = {
    "name": "soluta",
    "title": "est",
    "bio": "at",
    "image": "http:\/\/www.rippin.net\/aut-sint-soluta-temporibus-pariatur-impedit-inventore.html",
    "video_ids": [
        "sequi"
    ]
}

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

Example response (200):

{
    "id": 91,
    "name": "Josefina Hauck",
    "title": "Dr.",
    "image": "https:\/\/via.placeholder.com\/640x480.png\/003344?text=praesentium",
    "updated_at": "2021-04-19T13:52:38.000000Z",
    "created_at": "2021-04-19T13:52:38.000000Z"
}

Request   

PUT api/people/{person}

PATCH api/people/{person}

URL Parameters

person  string  
Person Id.

Body Parameters

name  string optional  

title  string optional  

bio  string optional  

image  string optional  
The value must be a valid URL.

video_ids  string[] optional  

Delete Person

Returns 200 after successful deletion

requires authentication

Example request:

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

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

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

Example response (200):

{
    "code": 200,
    "data": {},
    "time": 205.7879
}

Request   

DELETE api/people/{person}

URL Parameters

person  string  
Person Id.

4. 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": 692644,
            "name": "ipsam",
            "color": "DodgerBlue",
            "created_at": "1990-07-08T14:46:19.000000Z",
            "updated_at": "2011-08-21T17:36:49.000000Z"
        },
        {
            "id": 765601953,
            "name": "dignissimos",
            "color": "Tan",
            "created_at": "1997-11-29T20:25:37.000000Z",
            "updated_at": "1971-07-12T01:09:18.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\"","color":"aliquam"}'
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\"",
    "color": "aliquam"
}

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

Example response (200):

{
    "id": 5991428,
    "name": "ratione",
    "color": "Olive",
    "created_at": "2001-02-07T15:01:24.000000Z",
    "updated_at": "2013-06-17T04:01:31.000000Z"
}

Request   

POST api/tags

Body Parameters

name  string  
Tag name.

color  string  

5. Product Log endpoints

Get Product Logs

Returns a list of product logs

Example request:

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

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

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

Request   

GET api/product_logs

Create Product Log

Returns a newly created product log

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/product_logs" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"quaerat","content":"et","date":"2021-04-19T13:52:38+0000","category":["ut"],"status_id":30.637,"user_notify":false,"image":"http:\/\/www.beatty.info\/possimus-dolores-laborum-non-quis-deserunt-sit-ratione-quas"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs"
);

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

let body = {
    "title": "quaerat",
    "content": "et",
    "date": "2021-04-19T13:52:38+0000",
    "category": [
        "ut"
    ],
    "status_id": 30.637,
    "user_notify": false,
    "image": "http:\/\/www.beatty.info\/possimus-dolores-laborum-non-quis-deserunt-sit-ratione-quas"
}

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

Request   

POST api/product_logs

Body Parameters

title  string  

content  string  

date  string  
The value must be a valid date.

category  string[]  

status_id  number  

user_notify  boolean  

image  string  
The value must be a valid URL.

Show Product Log

Returns a single product log

requires authentication

Example request:

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

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

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

Example response (200):

{
    "id": 69892,
    "title": "Aliquid sunt deleniti debitis eius eligendi.",
    "description": "Qui quibusdam esse consectetur qui qui. Tempora fuga sint aut quisquam. Qui ex et ab necessitatibus. Ut consequatur mollitia corporis adipisci est qui ducimus.",
    "category": "inventore",
    "thumbnail": "https:\/\/via.placeholder.com\/640x480.png\/002299?text=dolor",
    "date": "1996-05-05T00:00:00.000000Z",
    "url": "http:\/\/larkin.com\/perspiciatis-perspiciatis-delectus-doloribus-id-voluptatem-et-vero-et.html",
    "video_views": null,
    "original_url_views": null,
    "popularity": null,
    "original_url": null,
    "tags": [],
    "people": []
}

Request   

GET api/product_logs/{product_log}

URL Parameters

product_log  string  
Product Log Id.

Update Product Log

Returns an updated Product log

requires authentication

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/product_logs/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"title":"facilis","content":"est","date":"2021-04-19T13:52:38+0000","category":["repudiandae"],"status":7013,"user_notify":false,"image":"http:\/\/www.emard.info\/"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/1"
);

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

let body = {
    "title": "facilis",
    "content": "est",
    "date": "2021-04-19T13:52:38+0000",
    "category": [
        "repudiandae"
    ],
    "status": 7013,
    "user_notify": false,
    "image": "http:\/\/www.emard.info\/"
}

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

Request   

PUT api/product_logs/{product_log}

PATCH api/product_logs/{product_log}

URL Parameters

product_log  string  
Product Log Id.

Body Parameters

title  string optional  

content  string optional  

date  string optional  
The value must be a valid date.

category  string[] optional  

status  number optional  

user_notify  boolean optional  

image  string optional  
The value must be a valid URL.

Delete Product Log

Returns 200 after successful deletion

requires authentication

Example request:

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

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

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

Example response (200):

{
    "code": 200,
    "data": {},
    "time": 205.7879
}

Request   

DELETE api/product_logs/{product_log}

URL Parameters

product_log  string  
Product Log Id.

6. Comment endpoints

Get Comments

Example request:

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

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

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

Request   

GET api/product_logs/{product_log}/comments

URL Parameters

product_log  string  

Create a comment

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/product_logs/sed/comments" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"comment":"eius"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/sed/comments"
);

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

let body = {
    "comment": "eius"
}

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

Request   

POST api/product_logs/{product_log}/comments

URL Parameters

product_log  string  

Body Parameters

comment  string  

Show comment

Example request:

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

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

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

Request   

GET api/product_logs/{product_log}/comments/{comment}

URL Parameters

product_log  string  

comment  string  

Update a comment

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/product_logs/quam/comments/dolorum" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"comment":"qui"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/quam/comments/dolorum"
);

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

let body = {
    "comment": "qui"
}

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

Request   

PUT api/product_logs/{product_log}/comments/{comment}

PATCH api/product_logs/{product_log}/comments/{comment}

URL Parameters

product_log  string  

comment  string  

Body Parameters

comment  string optional  

Delete comment

Example request:

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

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

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

Request   

DELETE api/product_logs/{product_log}/comments/{comment}

URL Parameters

product_log  string  

comment  string  

7. Reaction endpoints

Get Reactions

Get reactions for a single product log

requires authentication

Example request:

curl -X GET \
    -G "http://127.0.0.1:8000/api/api/product_logs/1/reactions?current=true" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/1/reactions"
);

let params = {
    "current": "true",
};
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());

Request   

GET api/product_logs/{product_log}/reactions

URL Parameters

product_log  integer optional  
ID of the product log.

Query Parameters

current  string optional  
Determines if the rections should be returned only for teh current user. Send either true or dont send at all.

Create Reaction

Example request:

curl -X POST \
    "http://127.0.0.1:8000/api/api/product_logs/1/reactions" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"reaction":"nam"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/1/reactions"
);

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

let body = {
    "reaction": "nam"
}

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

Request   

POST api/product_logs/{product_log}/reactions

URL Parameters

product_log  integer optional  
ID of the product log.

Body Parameters

reaction  string  

Update Reaction

Example request:

curl -X PUT \
    "http://127.0.0.1:8000/api/api/product_logs/1/reactions/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"reaction":"aperiam"}'
const url = new URL(
    "http://127.0.0.1:8000/api/api/product_logs/1/reactions/1"
);

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

let body = {
    "reaction": "aperiam"
}

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

Request   

PUT api/product_logs/{product_log}/reactions/{reaction}

PATCH api/product_logs/{product_log}/reactions/{reaction}

URL Parameters

product_log  integer optional  
ID of the product log.

reaction  integer optional  
ID of the reaction.

Body Parameters

reaction  string  

Delete Reaction

Example request:

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

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

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

Request   

DELETE api/product_logs/{product_log}/reactions/{reaction}

URL Parameters

product_log  integer optional  
ID of the product log.

reaction  integer optional  
ID of the reaction.