Introduction

Authenticating requests

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

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

Contact udruga@citati.hr if you are interested in API integration.

Authors

Get authors

GET
https://api.citati.hr
/authors
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,10000 Number of items per page. Default 10.

Example:
10
Example request:
const url = new URL(
    "https://api.citati.hr/authors"
);

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": [
        {
            "id": 1,
            "name": "Abbe Constane",
            "slug": "abbe-constane"
        },
        {
            "id": 2,
            "name": "Abdulhak Šinasi Hisar",
            "slug": "abdulhak-sinasi-hisar"
        },
        {
            "id": 3,
            "name": "Abel Dufresnes",
            "slug": "abel-dufresnes"
        },
        {
            "id": 4,
            "name": "Abigail Van Buren",
            "slug": "abigail-van-buren"
        },
        {
            "id": 5,
            "name": "Abraham Ezra",
            "slug": "abraham-ezra"
        },
        {
            "id": 6,
            "name": "Abraham Harold Maslow",
            "slug": "abraham-harold-maslow"
        },
        {
            "id": 7,
            "name": "Abraham Lincoln",
            "slug": "abraham-lincoln"
        },
        {
            "id": 8,
            "name": "Abu Hanifa",
            "slug": "abu-hanifa"
        },
        {
            "id": 9,
            "name": "Adalbert Rebić",
            "slug": "adalbert-rebic"
        },
        {
            "id": 10,
            "name": "Adam Smith",
            "slug": "adam-smith"
        }
    ],
    "links": {
        "first": "https://citati-api.test/authors?page=1",
        "last": "https://citati-api.test/authors?page=182",
        "prev": null,
        "next": "https://citati-api.test/authors?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 182,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://citati-api.test/authors?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=6",
                "label": "6",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=7",
                "label": "7",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=8",
                "label": "8",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=9",
                "label": "9",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=10",
                "label": "10",
                "active": false
            },
            {
                "url": null,
                "label": "...",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=181",
                "label": "181",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=182",
                "label": "182",
                "active": false
            },
            {
                "url": "https://citati-api.test/authors?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://citati-api.test/authors",
        "per_page": 10,
        "to": 10,
        "total": 1819
    }
}
GET
https://api.citati.hr
/authors/search
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,30 Number of items per page. Default 10.

Example:
10
query
string
required

Search terms. Default none.

Example:
lorem
Example request:
const url = new URL(
    "https://api.citati.hr/authors/search"
);

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

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

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

Get author

GET
https://api.citati.hr
/authors/{author_id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

author_id
integer

required_without:author_slug The ID of the author.

Example:
1
author_slug
string

required_without:author_id The slug of the author.

Example:
lorem-ipsum
Example request:
const url = new URL(
    "https://api.citati.hr/authors/1"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": {
        "id": 1,
        "name": "Abbe Constane",
        "slug": "abbe-constane"
    }
}

Collections

Get collections

GET
https://api.citati.hr
/collections
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,10000 Number of items per page. Default 10.

Example:
10
order_by
string

Must be one of latest, relevant, random, featured, or popular. How to sort the collections. Default latest.

Example:
random
type
string

Must be one of text or gallery. Default all.

Example:
text
Example request:
const url = new URL(
    "https://api.citati.hr/collections"
);

const params = {
    "page": "1",
    "per_page": "10",
    "order_by": "random",
    "type": "text",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": [
        {
            "id": 69,
            "title": "Vesla na vodi",
            "slug": "vesla-na-vodi",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 59,
            "title": "Posoljeni zrak i razlivena tinta",
            "slug": "posoljeni-zrak-i-razlivena-tinta",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 65,
            "title": "Svi moji punti kad se zbroje",
            "slug": "svi-moji-punti-kad-se-zbroje",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 24,
            "title": "Crno ili bijelo",
            "slug": "crno-ili-bijelo",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 56,
            "title": "Ovo mi je škola",
            "slug": "ovo-mi-je-skola",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 40,
            "title": "Lipa moja",
            "slug": "lipa-moja",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 67,
            "title": "Tebe nisam bio vrijedan",
            "slug": "tebe-nisam-bio-vrijedan",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "song",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 2,
            "title": "Poslovice",
            "slug": "poslovice",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": null,
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 10,
            "title": "E-bonton",
            "slug": "e-bonton",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": null,
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        },
        {
            "id": 16,
            "title": "Ruža vjetrova",
            "slug": "ruza-vjetrova",
            "caption": null,
            "sticky": false,
            "featured_at": null,
            "promo_until": null,
            "type": "text",
            "source": "album",
            "image": null,
            "cover": null,
            "label": null,
            "link": null
        }
    ],
    "links": {
        "first": "https://citati-api.test/collections?page=1",
        "last": "https://citati-api.test/collections?page=9",
        "prev": null,
        "next": "https://citati-api.test/collections?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 9,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://citati-api.test/collections?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=6",
                "label": "6",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=7",
                "label": "7",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=8",
                "label": "8",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=9",
                "label": "9",
                "active": false
            },
            {
                "url": "https://citati-api.test/collections?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://citati-api.test/collections",
        "per_page": 10,
        "to": 10,
        "total": 83
    }
}
GET
https://api.citati.hr
/collections/search
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,30 Number of items per page. Default 10.

Example:
10
query
string
required

Search terms. Default none.

Example:
lorem
Example request:
const url = new URL(
    "https://api.citati.hr/collections/search"
);

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

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

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

Get collection

GET
https://api.citati.hr
/collections/{collection_id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

collection_id
integer

required_without:collection_slug The ID of the collection.

Example:
1
collection_slug
string

required_without:collection_id The slug of the collection.

Example:
quotes
Example request:
const url = new URL(
    "https://api.citati.hr/collections/1"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": {
        "id": 1,
        "title": "Citati",
        "slug": "citati",
        "caption": null,
        "sticky": false,
        "featured_at": null,
        "promo_until": null,
        "type": "text",
        "source": null,
        "image": null,
        "cover": null,
        "label": null,
        "link": null
    }
}

Interactions

Create interaction

POST
https://api.citati.hr
/interactions
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
const url = new URL(
    "https://api.citati.hr/interactions"
);

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

let body = {
    "post_id": 1,
    "collection_id": 1,
    "user_id": 2,
    "type": "like"
};

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

Posts

Get posts

GET
https://api.citati.hr
/posts
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,1000 Number of items per page. Default 10.

Example:
10
collections
string

Collection ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.

Example:
1
authors
string

Author ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.

Example:
1
topics
string

Topic ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.

Example:
1
order_by
string

Must be one of latest, relevant, random, featured, or popular. How to sort the posts. Default latest.

Example:
random
Example request:
const url = new URL(
    "https://api.citati.hr/posts"
);

const params = {
    "page": "1",
    "per_page": "10",
    "collections": "1",
    "authors": "1",
    "topics": "1",
    "order_by": "random",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": [],
    "links": {
        "first": "https://citati-api.test/posts?page=1",
        "last": "https://citati-api.test/posts?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://citati-api.test/posts?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://citati-api.test/posts",
        "per_page": 10,
        "to": null,
        "total": 0
    }
}
GET
https://api.citati.hr
/posts/search
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,30 Number of items per page. Default 10.

Example:
10
query
string
required

Search terms. Default none.

Example:
lorem
Example request:
const url = new URL(
    "https://api.citati.hr/posts/search"
);

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

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

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

Get post

GET
https://api.citati.hr
/posts/{post_id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

post_id
integer

required_without:post_slug The ID of the post.

Example:
1
post_slug
string

required_without:post_id The UID of the post.

Example:
X6eK2zR
Example request:
const url = new URL(
    "https://api.citati.hr/posts/1"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": {
        "id": 1,
        "uid": "QUeodrV",
        "content": "Kinofobija",
        "description": "Strah od psa.",
        "sticky": false,
        "featured_at": null,
        "image": null,
        "updated_at": "2023-09-02T10:29:15.000000Z",
        "collections": [
            {
                "id": 4,
                "title": "Znanje",
                "slug": "znanje",
                "caption": null,
                "sticky": false,
                "featured_at": null,
                "promo_until": null,
                "type": "text",
                "source": null,
                "image": null,
                "cover": null,
                "label": null,
                "link": null
            },
            {
                "id": 8,
                "title": "Fobije",
                "slug": "fobije",
                "caption": null,
                "sticky": false,
                "featured_at": null,
                "promo_until": null,
                "type": "text",
                "source": null,
                "image": null,
                "cover": null,
                "label": null,
                "link": null
            }
        ],
        "authors": [
            {
                "id": 530,
                "name": "Fobija",
                "slug": "fobija"
            }
        ],
        "topics": []
    }
}

Topics

Get topics

GET
https://api.citati.hr
/topics
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,10000 Number of items per page. Default 10.

Example:
10
Example request:
const url = new URL(
    "https://api.citati.hr/topics"
);

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

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": [
        {
            "id": 1,
            "name": "alkohol",
            "slug": "alkohol"
        },
        {
            "id": 2,
            "name": "ambicija",
            "slug": "ambicija"
        },
        {
            "id": 3,
            "name": "anegdote",
            "slug": "anegdote"
        },
        {
            "id": 4,
            "name": "bog",
            "slug": "bog"
        },
        {
            "id": 5,
            "name": "bogatstvo",
            "slug": "bogatstvo"
        },
        {
            "id": 6,
            "name": "bol",
            "slug": "bol"
        },
        {
            "id": 7,
            "name": "bolest",
            "slug": "bolest"
        },
        {
            "id": 8,
            "name": "borba",
            "slug": "borba"
        },
        {
            "id": 9,
            "name": "brak",
            "slug": "brak"
        },
        {
            "id": 10,
            "name": "budućnost",
            "slug": "buducnost"
        }
    ],
    "links": {
        "first": "https://citati-api.test/topics?page=1",
        "last": "https://citati-api.test/topics?page=16",
        "prev": null,
        "next": "https://citati-api.test/topics?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 16,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://citati-api.test/topics?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=5",
                "label": "5",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=6",
                "label": "6",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=7",
                "label": "7",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=8",
                "label": "8",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=9",
                "label": "9",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=10",
                "label": "10",
                "active": false
            },
            {
                "url": null,
                "label": "...",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=15",
                "label": "15",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=16",
                "label": "16",
                "active": false
            },
            {
                "url": "https://citati-api.test/topics?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://citati-api.test/topics",
        "per_page": 10,
        "to": 10,
        "total": 153
    }
}
GET
https://api.citati.hr
/topics/search
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Query Parameters

page
integer

Page number to retrieve. Default 1.

Example:
1
per_page
integer

between:1,30 Number of items per page. Default 10.

Example:
10
query
string
required

Search terms. Default none.

Example:
lorem
Example request:
const url = new URL(
    "https://api.citati.hr/topics/search"
);

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

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

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

Get topic

GET
https://api.citati.hr
/topics/{topic_id}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_TOKEN_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

topic_id
integer

required_without:topic_slug The ID of the topic.

Example:
1
topic_slug
string

required_without:topic_id The slug of the topic.

Example:
lorem
Example request:
const url = new URL(
    "https://api.citati.hr/topics/1"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
Example response:
Headers
                                                            cache-control
                                                            : no-cache, private
                                                                                                                    content-type
                                                            : application/json
                                                                                                                    access-control-allow-origin
                                                            : *
                                                         
{
    "data": {
        "id": 1,
        "name": "alkohol",
        "slug": "alkohol"
    }
}