API Discovery

The API Discovery API allows you to list the Haven OnDemand APIs that you have available. You can use this API to programmatically access the list of available APIs, so that you can use them in the combination API to create new APIs.

The API Discovery API is a platform API. To use it, you can send a call of the form /1/discovery/api. The following table lists the parameters that the API accepts:

Parameter Description Type Default
Category Filter results by the API category. You can use one of the following category values:
  • Format-convert
  • image-analysis
  • indexing
  • text-search
  • text-analysis
enum(string)  
Full_definition Whether to return the request and response parameters from the API definitions. Boolean False
Max_results The maximum number of APIs to return. If you set the Start parameter, Max_results sets the number of the last result from the total results set. Integer 10
Search_text Text to use to search the API list. String  
Start The number of the first result to return. Integer 1

The API returns the API definitions, with the parameters merged into the parameter section.

Note: The API returns only APIs that your account has access to.

Example

The following example requests the first three available APIs for the API key <MyAPIKey>.

/1/discovery/api?apikey=<MyAPIKey>&start=1&max_results=3

The following is an example result for the discovery API.

[
  {
    "id": "addtotextindex",
    "version": "1.0",
    "api_documentation": {
      "category": "indexing",
      "shortDescription": "Indexes a document.",
      "name": "Add to Text Index",
      "description": "Indexes a JSON document or file into the specified text index.",
      "requiresContext": true,
      "badges": [
        "preview"
      ]
    }
  },
  {
    "id": "analyzesentiment",
    "version": "1.0",
    "api_documentation": {
      "category": "improve",
      "shortDescription": "Analyzes text for positive or negative sentiment.",
      "name": "Sentiment Analysis",
      "description": "Analyzes text for positive or negative sentiment."
    },
    "aliases": [
      "detectsentiment"
    ]
  },
  {
    "id": "categorizedocument",
    "version": "1.0",
    "api_documentation": {
      "category": "inquire",
      "shortDescription": "Searches for categories that match a specified document.",
      "name": "Categorize Document",
      "description": "Search a Haven OnDemand category text indexes for categories that match the contents of a specified document.",
      "badges": [
        "preview"
      ],
      "requiresContext": true
    }
  }
]