Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Discovery API

Pureinsights Discovery Platform exposes a REST API that can be used by the UI components and can be called directly to configure and access OpenSearch features.

Likewise, the Admin API, the Discovery API can be configured to follow steps, described as processors, within an endpoint defined by the user.

Processor API

Create a processor

POST /admin/processor

Allows you to create a processor for different tasks related to search.

{
    "component": <String>,
    "description": <String>,
    ... Component-based configuration ...
}

Retrieve processors

GET /admin/processor

Returns a list of configured processors within the Discovery API.

Retrieve a processor

GET /admin/processor/<processor ID>

Retrieve processors configuration

Returns configuration for a given processor.

PUT /admin/processor/<processor ID>

Update a processor

Allows you to update a processor for different tasks related to search.

{
    "component": <String>,
    "description": <String>,
    ... Component-based configuration ...
}

Remove a processor

DELETE /admin/processor/<processor ID>

Removes a processor from the Discovery API.

Pre-defined processors

Logger

Log requests running through the Discovery API.

Configuration:
{
    "component": "logger",
    "description": "logger processor",
    <configuration>
}
Configuration parameters:

logMissingHeaders

(Optional, Boolean) If true, headers without values that were specifically asked to be logged are logged. Otherwise, headers without values are ignored. Defaults to true.

logMissingParameters

(Optional, Boolean) If true, query parameters without values that were specifically asked to be logged are logged. Otherwise, query parameters without values are ignored. Defaults to true.

singleValueArray

(Optional, Boolean) If true, single element arrays are converted to a value. Defaults to false.

group

(Optional, Boolean) If true, request body, headers and query parameters are grouped into a single object. Defaults to false.

noHeaders

(Optional, Boolean) If true, request headers are not logged. Defaults to false.

noParameters

(Optional, Boolean) If true, request query parameters are not logged. Defaults to false.

noBody

(Optional, Boolean) If true, request body is not logged. Defaults to false.

headers

(List<String>) Header names to explicitly log when queries are run. Defaults to all.

query

(List<String>) Query parameter names to explicitly log when queries are run. Defaults to all.

body

(List<JsonPointer >) Body fields to explicitly log when queries are run. Defaults to all.

Post

Post requests to a given instance.

Configuration:
{
    "component": "post",
    "description": "post processor",
    <configuration>
}
Configuration parameters:

method

(HTTP Method) HTTP method to use. If not set, it'll default to the incoming method.

defaultUrl

(String) Default URL to send to if nothing is found in the query parameters.

urlParameter

(Optional, String) Query parameter the URL to send to is found in.

passParameters

(Optional, List<String>) Parameters that will be passed though to the URL.

merge

(Optional, Boolean) If true, responses are merged before sending back to the caller. Defaults to true.

credentials

(Optional, Basic Credentials) JSON containing username and password for basic authentication on the given instance.

Elastic

Post requests to a given Elasticsearch instance using the official Java API (High level REST client).

Configuration:
{
    "component": "elastic",
    "description": "Elasticsearch processor",
    <configuration>
}
Configuration parameters:

method

(HTTP Method) HTTP method to use when calling Elasticsearch. If not set, it'll default to the incoming method.

endpoint

(String) The endpoint to call Elasticsearch on.

contentType

(Optional, String) The content type to use for the request to ElasticSearch. For instance, on _msearch requests this is application/x-ndjson. Defaults to application/json

connection

(Json) The Elasticsearch connection properties (credentials, scroll, bulk etc).

{
     "servers": List<ConnectionInfo>,
     "auth": AuthenticationCredentials,
     "scroll": {
         "size": Integer,
         "timeout": Duration
     }
}

      servers (ConnectionInfo array) The search engine servers

      auth (AuthenticationCredentials) The search engine authentication

      scroll (Scroll) The configuration for scrolls when querying

Opensearch

Post requests to a given Opensearch instance.

Configuration:
{
    "component": "opensearch",
    "description": "opensearch processor",
    <configuration>
}
Configuration parameters:

method

(HTTP Method) HTTP method to use when calling Opensearch. If not set, it'll default to the incoming method.

endpoint

(String) The endpoint to call Opensearch on.

contentType

(Optional, String) The content type to use for the request to Opensearch. For instance, on _msearch requests this is application/x-ndjson. Defaults to application/json

connection

(Json) The Opensearch connection properties (credentials, scroll, bulk etc).

{
     "servers": List<ConnectionInfo>,
     "auth": AuthenticationCredentials,
     "scroll": {
         "size": Integer,
         "timeout": Duration
     }
}

      servers (ConnectionInfo array) The search engine servers

      auth (AuthenticationCredentials) The search engine authentication

      scroll (Scroll) The configuration for scrolls when querying

OpenSearch Manual Pre-Requisites

On the resources folder of this repository, the opensearch folder contains the necessary templates to properly use OpenSearch with other discovery components.

Featured Snippets

Execute mappings found in fs-mappings.json

 curl -H 'Content-Type: application/json' -X PUT 'http://<host>:<port>/_index_template/featured_snippets' --data-binary "@fs-mappings.json"
Frequently Asked Questions

Execute mappings found in faq-mappings.json

 curl -H 'Content-Type: application/json' -X PUT 'http://<host>:<port>/_index_template/frequently_asked_questions' --data-binary "@faq-mappings.json"

Script

Run scripts as part of the search query sent to the Discovery API.

Configuration:
{
    "component": "script",
    "description": "script processor",
    <configuration>
}
Configuration parameters:

language

(String) Language used to write the script. Available languages are groovy, python and javascript. Defaults to groovy.

script

(String) Script code to be executed as part of this processor.

Query Snap

Snaps to facets and their values from the query in the request, by examining the query for values from those facets. Where a match is found, the facet and value will be applied as a filter to the query and the value optionally removed from the main query text.

Configuration:
{
    "component": "snap",
    "description": "snap processor",
    <configuration>
}
Configuration parameters:

queryParameter

(Optional, String) The name of the query parameter that holds the query to snapped to. One of queryParameter or queryBody should be specified.

queryBody

(Optional, JsonPointer) The path in the Json body of the query to snap to. One of queryParameter or queryBody should be specified.

snapTo

(Json) The list of facets that will be downloaded from the search engine and whose values will be snapped to snap to.

{
     "index": String,
     "facets": List<String>
}

      index (String) The index to load the facets from

      facets (String array) The field names of the facets that should be loaded and snapped to

replaceQuery

(Optional, Boolean) If true, update the query in the query parameter or body, removing the tokens whose values matched facet values. Defaults to true.

reload

(Optional, Long) The number of milliseconds between reloads of the facet values. Defaults to 10 minutes.

engine

(Json) The configuration of the search engine holding the facets and values to snap to

{
     "servers": List<ConnectionInfo>,
     "credentials": BasicCredentials,
     "postFilter": boolean,
     "type": String,
     "aclField": String
}

     servers (ConnectionInfo array) The search engine servers

     credentials (BasicCredentials) The credentials for the search engine

     postFilter (Optional, Boolean) If true the facet value query will be added as a post filter Defaults to true.

     type

(String) The search engine type (Elastic/Open/Solr for instance). Currently, only elasticsearch and opensearch are supported

     aclField (String) The name of the search engine field to use for filtering facet values snapped to based on user permissions

maskQueriesWithEntities

(Json, Optional) The list of entities and their masks to be replaced. Note if this field doesn't exist the processor will continue with the normal flow otherwise the mask query flow will start. Example:

{
     "[facet.keyword]": "[mask value]",
      ...
}

      facet.keyword (String) This is the facet name value

      mask value (String) The value to mask the facet name.

matchAllValues (boolean, Optional) When enabled, the filter created with the snapped facet values will add a terms clause per facet value instead of a terms clause per facet.

Template

The template component allows for the loading of Json objects into the request body, optionally based on the values of query parameters. This allows for loading of (say) a complex structure used for querying, filtering or sorting that can then have minor modifications made to it by a scripting component.

Configuration:
{
    "component": "template",
    "description": "template processor",
    <configuration>
}
Configuration parameters:

templates

(Optional, Json) Used in conjunction with the parameter option below, this holds a Json object containing a set of named templates. The top level field name is the template name. Its (object) value is the template. When selected the (object) value will replace or be merged into the request body.

defaultTemplate

(Optional, Json) The json describing the default template. This template will be chosen if there are no named templates or if the value in the query parameter (if specified) does not match one of the values in the parameter map.

replace

(Boolean) If true the template will completely replace the request body. Otherwise, the template will be merged into the existing request body. Defaults to false.

parameter

(Optional, Json) A Json object containing the name of a query parameter to examine, and a map of parameter values to template names. When used in conjunction with the templates parameter above, the value from the given parameter will be looked up in the template map to find the name of the template to use. This allows multiple parameter values to reference the same name template. Once the template name has been discovered, the template with that name will be found with in the named templates (from templates) and will replace or be merged with the request body. If the parameter value does not appear in the value map, or the named template does not exist, the defaultTemplate (if it exists) will be used instead.

{
     "name": String,
     "templates": Map<String,String>
}

      name (String) The parameter whose value will be examined to decide which named template (from templates) will be used.

      templates (Json) A simple Json object holding the mapping between the parameter value, and the named template to use. The field name will be matched against the parameter value, and the field value gives the name of the template to use.

Language Detector

This component detects the language from the input query. It expects a list of possible language to detect. The output language is added as part as a header.

Configuration:
{
   "component": "languageDetector",
   "description": "Language detector description",
    <configuration>
}
Configuration parameters:

languagesDetector

(Optional, Json) Languages to detect. The detection process will narrow down to only detect these languages. Full language names are expected in lower case, for example: ['spanish', 'english'] The default value is an empty list.

defaultLanguage

(Optional, String) If a language cannot be detected, then default to this value. Defaults to English.

minDistance

(Optional, Double) As per Lingua's documentation:

By default, Lingua returns the most likely language for a given input text. However, there are certain words that are spelled the same in more than one language. The word prologue, for instance, is both a valid English and French word. Lingua would output either English or French which might be wrong in the given context. For cases like that, it is possible to specify a minimum relative distance that the logarithmized and summed up probabilities for each possible language have to satisfy.

stripPunctuation

(Optional, Boolean) Removes punctuation from the query. Defaults to true

queryParameter

(Optional, String) Which query parameter to analyze. Defaults to q

Question Detector

This component detects whether a query is in question format or not. It analyzes a query to detect if it starts with a word that denotates a question or if it ends with a question mark (?). If any of those are met. Then a question is detected. If a question is not detected, then the flow terminates.

If a language has been previously detected (i.e. a custom response header exists), then the questions prefixes associated to that language will be used. If not, a default language will be selected.

Configuration:
{
  "component": "questionDetector",
  "description": "Question detector description",
  <configuration>
}
Configuration parameters:

questionPrefixes

(Optional, Json) Map of lists that contains the words that help to detect questions. For example:

"questionPrefixes": {
    "english": ["what", "who", "why", "where", "when", "how", "in", "from", "is", "to", "for", "does", "do"],
    "french": ["quel", "quels","quelle", "quelles", "qui", "ou", "où", "a", "à", "qui", "en", "combien", "quand", "comment", "pour", "pourquoi", "dans", "est", "quoi", "que", "qu" ]
  }

If defaults to a structure that contains the following English words: ["what", "who", "why", "where", "when", "how"]

includeResultInResponse

(Optional, boolean) Adds a boolean to the response to indicate the result of this question detection. Defaults to false.

queryParameter

(Optional, String) Which query parameter to analyze. Defaults to q

NLP Service

This component takes a query as input and send it to the spacy NLP service for analysis. Both entities and dependency responses from Spacy are added to the API request so they can be used by a downstream component.

Configuration:
{
  "component" : "NLPClient",
  "description" : "Performs NLP analysis using Spacy service.",
  <configuration>
}
Configuration parameters:

model

(Optional, String) Name of the spacy model to use. Can be overridden with the discovery-api-nlp-model response header.

Defaults to en

collapsePunctuation

(Optional, Integer) Boolean expressed as an integer to tell Spacy whether to use it collapse punctuation feature during dependency parsing.

Defaults to 0

collapsePhrases

(Optional, Integer) Boolean expressed as an integer to tell Spacy whether to use it collapse phrases feature during dependency parsing.

Defaults to 0

queryParameter

(Optional, String) Which query parameter to analyze.

Defaults to q

servers

(Json) The configuration of the spacy endpoint(s).

{
  "servers": List<ConnectionInfo>,
}

Replace Entities

This component detects in an array of cypher queries the entity to be changed.

Configuration:
{
  "component": "replaceEntities",
  "description": "Replace Entity description",
  <configuration>
}
Configuration parameters:

numberOfQueriesToUse

(Optional, Integer) Number of queries which are going to be used in this component. Defaults to 1.

entityDelimiter

(Optional, String) The delimiter used to detect entities. Defaults to "__".

replacementDelimiter

(Optional, String) if 'useQuotes' is true, this value will be used to replace the 'entityDelimiter'. Defaults to "'".

useQuotes

(Optional, Boolean) if the flag is true single quotes will be added between the entity replaced, otherwise single quotes won't be added. Defaults to true.

toReplaceWithinEntity (Optional, String/regex) This field contains the string to be replaced by the 'replacementWithinEntity' in the entity. Defaults to "'"

replacementWithinEntity (Optional, String) the new entity value. Defaults to "\'"

Neo4J

This component runs all cypher queries which are stored in the context Object as "cypherQuery".

Note: If the value is a list for example:

[
  {
    "entity": "x",
    "attribute": "y",
    "value": ["a", "b", "c"]
  },
  {
    "entity": "x",
    "attribute": "y",
    "value": ["d","b","f"]
  }
]

The value will be dedupe and flatten:

{
  "entity": "x",
  "attribute": "y",
  "value": ["a","b","c","d","f"]
}
Configuration:
{
  "component": "neo4j",
  "description": "neo4j description",
  <configuration>
}
Configuration parameters:

emptyResponseMap (Optional, Json) This text will be used in cases where an empty value comes from neo4j. Defaults to:

{
  "english": "Empty source data",
  "french" : "Données source vides"
}

The language will be taken from the header, if there's no language in the header, "english" will be the default text.

neo4j

(Optional, Json) Contains all the information and credentials necessary to connect to Neo4j.

{
  "url":"bolt://pdp-neo4j.neo4j.svc.cluster.local:7687",
  "credentials": {
    "username": "neo4j",
    "password": "password"
  },
  "database" : ""
}

     database (Optional, String) An specific neo4j db to be pointed. Defaults to "neo4j" db.

Vector Query

This component creates a vector query for the given query string. The vector query is based on the template given or a default template if none is given.

The query may use a vector only, or may include a minimum should match element depending on configuration.

The default templates are tied to a specific engine type (ie opensearch or elasticsearch) which can be specified in the configuration

Configuration:
{
  "component": "replaceEntities",
  "description": "Replace Entity description",
  <configuration>
}
Configuration parameters:

engineType

(Optional, opensearch or elastic) The type of search engine to produce queries for when using default templates. Defaults to opensearch.

merge

(Optional, boolean) Replace or merge the query into the body. Defaults to false.

stripPunctuation

(Optional, boolean) Strip punctuation. Defaults to true.

queryParameter

(Optional, String) The (query) parameter. Defaults to 'q'.

minimumLength

(Optional, int) The minimum length of a query to process. Defaults to 0.

vectorField

(String) The field to form the vector query for.

minScore

(Optional, float) Minimum score for results. Defaults to 0.92f.

maxResults

(Optional, int) Maximum number of results. Defaults to 20.

servers

(JsonNode) Credentials to be able to connect in to Bert API.

minimumShouldMatch (JsonNode) Add MinimumShouldMatch template into the query.

{
  "minimumShouldMatch": {
    "total": "1<-1",
    "indexField": "vectors.text",
    "matchesField": {
      "should": ["a", "b"],
      "must": "c"
    }
  }
}

total (String) Total matches.

indexField (String) indexField.

matchesField (HashMap) These are the fields which are going to be added in the should match template. The key is the field where the value (String or Array) will be added into the template.

Featured Snippets

This component calls the DistilBERT service with a question and a list of text chunks.

Configuration:
{
    "component": "featuredSnippet",
    "description": "Replace featured snippets description",
    <configuration>
}
Configuration parameters:

queryParameter

(Optional, String) The (query) parameter. Defaults to 'q'.

servers

(JsonNode) Credentials to be able to connect in to Distilbert API.

connection

(JsonNode) connectTimeout and readTimeout.

minScore

(Optional, float) Minimum score for results. Defaults to 0.75f.

idField

(String) Path where the id is located in the ES/OS hit.

textField

(String) Path where the text is located in the ES/OS hit.

metadataField (JsonNode, optional) Paths of extra data to extract in the ES/OS hit. for example

{
  "metadataField": {
    "uri": "_source.uri",
    ...
  }
}

Feedback

This component saves various values as a feedback entity in storage

Configuration:
{
    "component": "feedback",
    "description": "This processor saves feedback data in storage",
    <configuration>
}
Configuration parameters:

feedbackField

(String) The path for fetching the numeric value that measures the subjective opinion of a feedback. Example: -1:Bad, 1:Good.

feedbackMessagesField

(Optional, String array) The paths to field names (String), the key and value of each field is stored as part of the feedback entity.

endpointField

(Optional, String) The path for fetching the value for the endpoint (String) used for the feedback.

queryField

(Optional, String) The path for fetching the query (String) used for the feedback.

queryResponseField

(Optional, String) The path for fetching the response (JsonNode) for the query used in the feedback.

{
  "feedbackField": "/..",
  "feedbackMessagesField": [
    "/.."
  ],
  "endpointField": "/..",
  "queryField": "/..",
  "queryResponseField": "/.."
}

Staging

This component performs operations in the staging respository (such as storage and fetch)

Configuration:
{
    "component": "staging",
    "description": "This component executes operations in the staging repository",
    <configuration>
}
Configuration parameters:

bucket

(String) The name of the bucket to use in the staging repository.

operation

(String) The staging operation to perform. Options are:

     getAll Gets all documents from bucket

     fetch Fetches a document with ID specified in idField from bucket

     store Stores in bucket

staging

(Json) The staging connection properties (servers, connection, credentials).

{
     "servers": List<ConnectionInfo>,
     "connection": HttpConnectionProperties,
     "credentials": {
       "username": String,
       "password": String
     }
}

      servers (ConnectionInfo array) The staging servers

      connection (Optional, HttpConnectionProperties) connectTimeout and readTimeout. Both defaults to 5 seconds.

      credentials (Optional, Basic Credentials) JSON containing username and password for basic authentication on the given instance.

idField

(Optional, String) If fetch required, path to the ID of the doc to get. If store optional, the new ID of the doc.

multiDocumentPath

(Optional, String) If store, The path in the body that splits it into sub-documents. This value must be an array.

useResponse

(Optional, Boolean) If true, component fetches paths from previous component response. Defaults to false.

Find Entity

This component identifies an entity based on configuration parameters.

Configuration:
{
    "component": "findEntity",
    "description": "This processor finds an entity",
    <configuration>
}
Configuration parameters:

acceptedPOS

(String array) The array list of POS to identify the entity, valid POS: NOUN, ADJ, JJ, JJR, JJS, AFX, NN, PROPN, NNP, NNPS, NNS.

minTokens

(Integer) The amount of tokens of the entity to be extracted. If entity tokens is les than minTokens param the entity will be ignored.

Security Filter

This component adds a security filter for a query.

Configuration:
{
    "component": "security_filter",
    "description": "A security filter component",
    <configuration>
}
Configuration parameters:

header

(String) The name of the header the token should be in.

field

(String) The name for the permissions filter field in the request.

engine

(Json) The engine connection properties (servers, credentials, and index).

{
     "engineType": String,
     "servers": List<ConnectionInfo>,
     "credentials": AuthenticationCredentials,
     "index": String
}

      engineType (String) The main engine to use (Options are OPENSEARCH, ELASTICSEARCH). Defaults to OpenSearch.

      servers (ConnectionInfo array) The search engine servers

      credentials (AuthenticationCredentials) The search engine authentication

      index (String) The document index for user information in the engine

issuerUrl

(Optional, String) The URL for validating that the token is still valid against a JWK Provider. Defaults to null.

publicAcl

(Optional, String) The public acl. Defaults to "PUBLIC::ALL".

hashParameter

(Optional, String) The user hash from the parameter. Defaults to "hash".

addFilter

(Optional, Boolean) Whether to create the filter query. Defaults to true.

addToRequest

(Optional, Boolean) Whether to add permissions to the request and build a filter with them. Defaults to false.

Endpoint API

The endpoint API allows to define and manage endpoints which can then be used in the API controller.

  • POST /admin/endpoint - Create an endpoint

  • GET /admin/endpoint - Get all the available endpoints

  • GET /admin/endpoint/<endpoint ID> - Get a single endpoint

  • PUT /admin/endpoint/<endpoint ID> - Update an endpoint

  • DELETE /admin/endpoint/<endpoint ID> - Delete an endpoint

The endpoint ID is generated by using a combination between the endpoint's HTTP method and its path. This ID is required for CRUD operations. However, the HTTP Method and the configured path are to be used when executing the endpoint through the API controller.

Different types of endpoints are available:

Simple Endpoint

Allows you to create an endpoint containing a chain of processors to run when hitting the endpoint. This is the default type.

{
  "uri": <String>,
  "httpMethod": HTTP Method,
  "processors": List<Processors IDs>,
  "continueOnError": Boolean = false,
  "fallbacksCriteria": {
    "field": "{JsonPath}",
    "relation": "EQ|LT|LTE|GT|GTE",
    "value": "{Number}",
    "maxCount": "{Number}"
  }
}
Query Fallbacks

The fallbacksCriteria allows you to set up query fallbacks based on the given criteria set in the endpoint. When this criteria is satisfied every single processor on this endpoint will be rerun. It is recommended to use a script processor as the first step in the endpoint pipeline to programmatically change the request that is going to be re-run.

In order to run query fallbacks you need to set the fallbacks parameter to true in the request sent to the Discovery API.

Configuration

field

(JsonPath) The path for fetching a numeric field containing the number of results coming as the response from search.

relation

(String) The operator used to compare the value from field with the value value.

value

(Integer) The value to compare against the number of records coming from search. Defaults to 0.

maxCount

(Integer) The maximum number of fallback runs allowed per endpoint. Defaults to 3.

Finite-State Machine Endpoint

Allows you to create a Finite-State Machine that represents the path to follow while executing an endpoint.

{
  "uri": <String>,
  "httpMethod": HTTP Method,
  "type": "states",
  "initialState": "stateA",
  "states": {
    "stateA": {
      "type": "processor",
      "processors": <Processor ID>,
      "next": "stateB"
    },
    
    "stateB": {
      "type": "switch",
      "options": [
        {
          "condition": {
            "equals": {
              "field": "lang",
              "source": "requestHeaders",
              "value": "english"
            }
          },
          "next": "EnglishState"
        },
        {
          "condition": {
            "equals": {
              "field": "$.lang",
              "source": "responseBody",
              "value": "french"
            }
          },
          "next": "FrenchState"
        }
      ],
      "default": "EnglishState"
    },
    
    "EnglishState": {
      "type": "processor",
      "processors": [
        <Processor ID>,
        <Processor ID>
      ]
    },
    
    "FrenchState": {
      "type": "processor",
      "processors": [
        <Processor ID>,
        <Processor ID>
      ]
    }
  },
  "timeout": "{Duration}"
}

Note that the configuration requires an initial state, and all states are defined by name (which means there can't be duplicates).

If a state has no next state, it is assumed as the final state. An endpoint can potentially have multiple final states.

All endpoints have an implicit defaultError state, of type Error that shows all exceptions with a 500 status code. This default state can be overridden by a state with the same name in the configuration of the endpoint.

State Types
Processor

Executes a single processor, or multiple processors in sequence:

"EnglishState": {
  "type": "processor",
  "processors": <Processor ID/List of Processor IDs>,
  "next": <State Name>,
  "onError": <State Name> = "defaultError",
  "onTerminate": <State Name>
}
  • If the next state is undefined, this will be considered as a terminal state.
  • If the onError field is explicitly undefined (i.e. set to null), the state will execute all processors despite any error. Otherwise, the execution of the state stops and the FSM will continue with the given state.
  • If one of the processors sends a terminate signal and onTerminate is defined, it will be selected as the next state. Otherwise, the default next will be used.
Switch

Controls the flow of the execution given the first matching condition:

{
  "type": "switch"
  "options": [
    {
      "condition": {
        "equals": {
          "field": "lang",
          "source": "requestHeaders",
          "value": "english"
        }
      },
      "next": "EnglishState"
    },
    {
      "condition": {
        "equals": {
          "field": "lang",
          "source": "requestHeaders",
          "value": "french"
        }
      },
      "next": "FrenchState"
    }
  ],
  "default": "EnglishState"
}

Note that the condition is expressed using the Core DSL for filters. The available sources are:

  • requestBody - JSON Path to search in the payload of the request.
  • requestHeaders - Key to search in the headers of the request.
  • requestParams - Key to search in the request parameters.
  • responseBody - JSON Path to search in the payload of the response.
  • responseHeaders - Key to search in the headers of the response.
  • context - Key to search in the context of the response.

The default state is optional. If not provided and no condition is met, it is assumed as the final state.

Error

Terminal state that returns an error message.

"ErrorState": {
  "type": "error",
  "statusCode": <HTTP Status Code> = 500,
  "message": <String>
}

If no message is given, the response will contain a list of all the exception messages that were thrown during the execution of the endpoint (if any).

Composite Endpoint

Allows you to create an endpoint that combines a list of other endpoints and executes them in parallel.

{
  "uri": <String>,
  "httpMethod": HTTP Method,
  "type": "composite",
  "endpoints": [
    {
      "id": <Endpoint ID>,
      "tag": <String>
    }
  ],
  "timeout": "{Duration}"
}

API

Endpoint

<HttpMethod> /api/<uri>

Allows you to run queries through the Discovery API depending on the configured endpoints set up.

  • No labels