Articles

Get single article

Retrieve a single article using the article Url

URL : /api/article/:articleurl

Method : GET

Auth required : NO

Limit: Single article

Success Response

Code : 200 OK

Content examples

An example response:

{
    id: "b27e97f5-67e7-4883-9402-c7686da28f8b",
    url: "hello-world",
    title: "Hello world",
    content: "--- content ---",
    published: true,
    category: "General",
    pinned: true,
    publishedDate: "2022-06-10T10:50:29.062Z",
    views: 7,
    createdAt: 2022-06-12T06:50:13.724Z,
    updatedAt: 2022-06-16T11:09:09.259Z
}

Search articles

Search an article using a keyword

URL : /api/search/:searchparam

Method : GET

Auth required : NO

Limit: 10 articles

Success Response

Code : 200 OK

Content examples

An example response:

[
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8b",
        url: "hello-world",
        title: "Hello world",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    },
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8c",
        url: "hello-world-two",
        title: "Hello world two",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    }
]

Get recent articles

Gets a list of recent articles

URL : /api/search/count/:num

Method : GET

Auth required : NO

Limit: Number supplied in parameter. Cannot exceeedt the ARTICLE_LIMIT_RETURNED environment variable.

Success Response

Code : 200 OK

Content examples

An example response:

[
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8b",
        url: "hello-world",
        title: "Hello world",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    },
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8c",
        url: "hello-world-two",
        title: "Hello world two",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    }
]

Insert a new article

Inserts a new article

URL : /api/article/insert

Method : PUT

Auth required : YES

Limit: None

Success Response

Code : 200 OK

Content examples

Example request:

{
    content: "--- content ---"
}

Example response:

{
    articleId: "b27e97f5-67e7-4883-9402-c7686da28f8b"
}

Update existing article

Updates an existing article content

URL : /api/article/save

Method : PUT

Auth required : YES

Limit: None

Success Response

Code : 200 OK

Content examples

Example request:

{
    content: "--- content ---",
    id: "b27e97f5-67e7-4883-9402-c7686da28f8c"
}

Example response:

{
    id: "b27e97f5-67e7-4883-9402-c7686da28f8c",
    url: "hello-world-two",
    title: "Hello world two",
    content: "--- content ---",
    published: true,
    category: "General",
    pinned: true,
    publishedDate: "2022-06-10T10:50:29.062Z",
    views: 7,
    createdAt: 2022-06-12T06:50:13.724Z,
    updatedAt: 2022-06-16T11:09:09.259Z
}

Deletes existing article

Deletes an existing article

URL : /api/article/delete/:id

Method : DELETE

Auth required : YES

Limit: None

Success Response

Code : 200 OK

Content examples

Example response:

{
    "success"
}

Get articles per category

Gets the articles in a given category

URL : /api/category/:category

Method : GET

Auth required : NO

Limit: None

Success Response

Code : 200 OK

Content examples

Example response:

[
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8b",
        url: "hello-world",
        title: "Hello world",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    },
    {
        id: "b27e97f5-67e7-4883-9402-c7686da28f8c",
        url: "hello-world-two",
        title: "Hello world two",
        content: "--- content ---",
        published: true,
        category: "General",
        pinned: true,
        publishedDate: "2022-06-10T10:50:29.062Z",
        views: 7,
        createdAt: 2022-06-12T06:50:13.724Z,
        updatedAt: 2022-06-16T11:09:09.259Z
    }
]

Get a list of categories

Gets an array of available categories

URL : /api/categories

Method : GET

Auth required : NO

Limit: None

Success Response

Code : 200 OK

Content examples

Example response:

[
    { category: "Configuration", count: "2" },
    { category: "General", count: "1" },
    { category: "Getting started", count: "1" }
]