Searching for Suggestions GET

Basic Search for Suggestions

The Dynamic Health API GET /content/search/suggestions endpoint returns a list of completed phrases that contain the term (or partial term) supplied in the query parameter. The /content/search/suggestions endpoint is useful for providing autocomplete suggestions to users searching the Dynamic Health content set.

To Perform a Search Suggestions Query (example):

Gather the following information for the request:

  • An access token. Please see Using the Client Credentials Grant for further information.
  • A word or phrase to search for suggestions. It may be a single letter or partial word.

Request

https://apis.ebsco.com/medsapi-dynamic-health/v1/content/search/suggestions?query=be&maxItemsPerSuggestionType=1

The request above is for suggestions for the partial term "be". The request specifies that the endpoint should return no more than 1 suggestion per suggestion type (term/title).

Response

{
  "_metadata": {
    "links": [
      {
        "rel": "self",
        "href": "https://apis.ebsco.com/medsapi-dynamic-health/v1/content/search/suggestions?query=be&maxItemsPerSuggestionType=1"
      }
    ]
  },
  "items": [
    {
      "suggestionType": "title",
      "suggestions": [
        {
          "completedPhrase": "Bed Bug Bites",
          "resource": {
            "id": "T900607",
            "slug": "/condition/bed-bug-bites",
            "links": [
               {
                 "rel": "self",
                 "href": "https://apis.ebsco.com/medsapi-dynamic-health/v1/content/articles/T900607"
               }
             ]
          }
        }
      ]
    },
    {
      "suggestionType": "term",
      "suggestions": [
        {
          "completedPhrase": "bed bugs",
          "links": [
            {
              "rel": "search",
              "href": "https://apis.ebsco.com/medsapi-dynamic-health/v1/content/search",
              "method": "POST",
              "request": {
                "query": "bed bugs"
              }
            }
          ]
        }
      ]
    }
  ]
}

Request Parameters

  • query - A word or phrase to search for suggestions. It may be a single letter or partial word.
  • maxItemsPerSuggestionType - Maximum number of items to return.
  • pubTypeGroup - Publication Groups to include in results.
  • completionType - The endpoint attempts to return two types of suggestions: title suggestions and term suggestions by default. In a title suggestion, the completed phrase is the title of an article containing the query term. Title suggestions are returned to all users of Dynamic Health. In a term suggestion, the completed phrase is a term or phrase that can be used with the GET /content/search endpoint to search the content in Dynamic Health. Only users with access to Dynamic Health's clinical decision support content will receive term suggestions in response to a GET /content/search/suggestions request. To only return one type you can just request that one type. The other type will return an empty array.

Error Response Codes

The Dynamic Health get search suggestions endpoint can return one of the error response codes.