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

Compare with Current View Page History

« Previous Version 13 Next »

This REST Handler contains:

  • Endpoints that return Saga configuration and build information
  • Endpoints to process text and return the interpretation graph

POST saga/api/v2/processText

  • Will return a Saga interpretation graph in the format specified
  • By default, it returns the graph in HTML format which is used by the UI.
  • It also can return JSON or plain text

Parameters

  • q ( type=string | required ) - This is the text to process
  • tags ( type=string array | required ) - List of tags to use to process the text
  • splitRegex ( type=string | default=[\r |\n ]+ | optional ) - Specifies the regex to use to split text into TEXT_BLOCKs
  • type ( type=string | default=ux | optional ) - Specifies the format of the results. It could be one of these values: "ux", "text" or "json"
    • text - Returns a "line" with the highest confidence route and a text representation of the graph.
    • ux - Returns an output useful for Saga to show the graph on a web display.
    • json - Returns all the semantic tags on the graph.
  • pretty ( type=boolean | default=false | optional ) - Used to pretty format the JSON result

Request Examples

curl -X POST \
  http://localhost:8080/saga/api/v2/processText \
  -H 'Content-Type: application/json' \
  -d '
{
    "q": "I like traveling with Air Paris",
	"tags": ["airline"],
	"splitRegex": "[\r|\n]+",
	"type": "text",
	"pretty": true
}'

Response

$action.getHelper().renderConfluenceMacro("$codeS$body$codeE")

GET saga/api/v2/solution

  • Returns the information of the solution currently being used.
  • A solution is basically the set of Elasticsearch indices in use

Request Examples

curl -X GET \
  http://localhost:8080/saga/api/v2/solution \
  -H 'Content-Type: application/json' \
  -d '
{
}'

Response

$action.getHelper().renderConfluenceMacro("$codeS$body$codeE")



GET saga/api/v2/info

  • Returns build-specific and configuration information about Saga
  • Build information contains title, vendor, version, build revision and date
  • Configuration information contains the solution (Elastic index) and providers configured at the moment

Request Examples

curl -X GET \
  http://localhost:8080/saga/api/v2/info \
  -H 'Content-Type: application/json' \
  -d '
{
}'


Response

$action.getHelper().renderConfluenceMacro("$codeS$body$codeE")



  • No labels