1. Search

URL: api/search

Method: get

Response Format: JSON

Description: Searches for articles in the knowledge base

Parameters:

Name Data Type Required / Optional Description
s String Required The string that user wants to search
token String Optional If the token is provided, backend considers that as logged in user, else guest

 Success Response:

 

2. Category-list with article count

URL: api/category-list-with-article-count

Method: get

Response Format: JSON

Description: Gives all the categories accessible to logged in user/guest along with the article count in that category

Parameters:

Name Data Type Required / Optional Description
token String Optional If the token is provided, backend considers that as logged in user, else guest

Success Response:

{

"status": 1,

“data”:{

"categories": [

    {

        "id": 1,

        "name": "category1",

        "slug": "category1",

        "articles_count": "1"

    },

    {

        "id": 2,

        "name": "category2",

        "slug": "category2",

        "articles_count": "1"

    }

]

}

3. Category-list with articles

URL: api/category-list-with-articles

Method: get

Response Format: JSON

Description: Gives all the categories accessible to logged in user/guest along with the article names  in that category to list on the page

Parameters:

Name Data Type Required / Optional Description
token String Optional If token is provided, backend considers that as logged in user, else guest

Success Response:

{

"status": 1,

“data”:{

"categories": [

    {

        "id": 1,

        "name": "category1",

        "slug": "category1",

        "created_at": "2018-02-14 07:22:50",

        "updated_at": "2018-02-14 07:22:50",

        "articles":

[{

                "id": 1,

                "name": "article1"

            }]},

    {

        "id": 3,

        "name": "category3",

        "slug": "category3",

        "created_at": "2018-02-14 07:23:23",

        "updated_at": "2018-02-14 07:23:23",

        "articles": [

            {

                "id": 1,

                "name": "article1"

            },

            {

                "id": 2,

                "name": "article2"

            }]}

]

}

4. Articles under a category

URL: api/category-list/{categoryId}

Method: get

Response Format: JSON

Description : Gives all the articles under the asked category

Leave a Reply

Your email address will not be published. Required fields are marked *