Shelf components API calls description.

Search bar(navigate or show search result):


API call: https://developer.shelf.io/api.html#operation/getAutosuggestions

POST: /search/v1/autosuggest

Body:

{

"text": "Mutual Funds",

"filters": {

"searchLanguage": "en",

"path": "libId1, libId2...",

"gemTypes": [

"Article",

"Note"

]

}

}




Search results:

API call: https://developer.shelf.io/api.html#operation/searchGems

POST: /search/v1/gems

Body:

{

    "query": "Mutual Funds",

    "from": 10000,

    "size": 100,

    "sortBy": "RELEVANCE",

    "sortOrder": "ASC",

    "searchLanguage": "en",

        "gemTypes": [

            "Article",

            "Note"

        ],

    "libraryIds": "libId1, libId2..."

}

The same call can be utilized for predefined results e.g. direct navigation from dashboard:

{

    "query": "", 

    "from": 0,

    "size": 100,

    "sortBy": "RELEVANCE",

    "sortOrder": "ASC",

    "parentId": "some-folder-id",

    "searchLanguage": "en",

        "gemTypes": [

            "Article",

            "Note"

        ],

    "libraryIds": ""

}

In this case, we just keep libraryIds and query fields empty and use parentId instead.



Gem details:

The API call to fetch basic gem information(title, description, owner username, created date, category):
GET: /gems/v1/{gemId}

If the gem contains HTML content, the content will be downloaded by utilizing the next API call:
GET: /content/v1/gems/{gemId}/wiki-content

Additional recommendations can be fetched by:
GET: /gems/v1/recommendations?{gemId}