# WebHooks

## Returns test slot values.

> Currently available test slots are:\<ul>\<li>\`\`\`number\`\`\`: integer numbers between 1 and 10\</li>\<li>\`\`\`letter\`\`\`: uppercase letters between A and Z\</li>\<li>\`\`\`greek\_letter\`\`\`: capitalized Greek letters between Alpha and Omega\</li>\</ul>

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/TestSlot":{"post":{"tags":["WebHooks"],"summary":"Returns test slot values.","description":"Currently available test slots are:<ul><li>```number```: integer numbers between 1 and 10</li><li>```letter```: uppercase letters between A and Z</li><li>```greek_letter```: capitalized Greek letters between Alpha and Omega</li></ul>","operationId":"WebHooks-TestSlot","requestBody":{"description":"Slot request","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/SlotWebHookRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/SlotWebHookRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SlotWebHookRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SlotWebHookRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlotWebHookResponse"}}}}}}}},"components":{"schemas":{"SlotWebHookRequest":{"type":"object","properties":{"slotName":{"type":"string","description":"Name of the slot.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request. It is NOT a unique number, since it is reset each time the Server is restarted, but together with <code>RequestDateTime</code> (and optionally <code>MemoriID</code>) they form a reasonably unique identifier. <br> This property is not used to match a request with cached responses of the same request, i.e.: two requests with identical properties but different <code>RequestID</code> are considered identical.","format":"int64","readOnly":true},"requestDateTime":{"type":"string","description":"Timestamp of the request in UTC time zone. <br> This property is not used to match a request with cached responses of the same request, i.e.: two requests with identical properties but different <code>RequestDateTime</code> are considered identical.","format":"date-time","readOnly":true},"requestValidityMinutes":{"type":"number","description":"Validity of the request, expressed in minutes, i.e. the time the response will be cached and considered valid. After this time the response will be automatically discarded. <br> Two requests are considered identical (and the cached response of the first may be used for the second) if ALL of their parameters are identical EXCEPT <code>RequestID</code>, <code>RequestDateTime</code> and <code>RequestValidityMinutes</code>, and additionally <code>SessionID</code> for IntentWebHookRequest.","format":"double","readOnly":true},"memoriID":{"type":"string","description":"ID of the Memori performing the request.","nullable":true},"culture":{"type":"string","description":"Culture of the request, expressed as a combination of\r\nan ISO-639 language code and an ISO-3166 country code.\r\nE.g. ```it-IT``` or ```en-US```.","nullable":true}},"additionalProperties":false,"description":"Specifications for a Slot Web Hook request."},"SlotWebHookResponse":{"type":"object","properties":{"slotValues":{"type":"array","items":{"type":"string"},"description":"Values of the request slot.\r\nIf the intent slot has any preset value in its configuration,\r\nvalues returned by the hook are added to preset ones.\r\nDuplicated values are discarded.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the original request this response refers to.\r\nRequired.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the original request this response refers to, in UTC time zone.\r\nRequired.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code of the request. Must be set to ```0``` if the request\r\nsucceeded. Any other value will be considered a failure, but the value\r\nwill be logged for subsequent diagnosis.\r\nRequired.","format":"int32"},"resultMessage":{"type":"string","description":"Result message of the request. Must be set to ```Ok``` if the request\r\nsucceeded. Any other value will be considered a failure, but the value\r\nwill be logged for subsequent diagnosis.\r\nRequired.","nullable":true}},"additionalProperties":false,"description":"Specifications for a Slot Web Hook response."}}}}
````

## Returns test intent results.

> Currently available test intents are:\<ul>\<li>\`\`\`ECHO\`\`\`: emits the intent utterance as-is.\</li>\<li>\`\`\`TUNNELING\_ECHO\`\`\`: emits the intent utterance as-is&#x20;> \
> &#x20;   and sets the Tunneling flag to true until an utterance> \
> &#x20;   with "END" is received.\</li>\<li>\`\`\`HISTORY\_ECHO\`\`\`: emits the latest transition history line,&#x20;> \
> &#x20;   the current utterance and a follow up greek letter, and sets the Tunneling flag to true> \
> &#x20;   until an utterance with "END" is received\</li>\<li>\`\`\`COMBINE\_LETTER\_AND\_NUMBER\`\`\`: requires a letter slot and a number slot,> \
> &#x20;   emits the content of the two slots in juxtaposition, e.g. "A10".\</li>\<li>\`\`\`DATE\_RANGE\`\`\`: requires a date slot, emits the date range indicated> \
> &#x20;   by the date slot in the format "yyyy/MM/dd - yyyy/MM/dd".\</li>\<li>\`\`\`AUTOINCREMENT\`\`\`: returns a progressive number that increments by 1> \
> &#x20;   each time the intent is called.\</li>\<li>\`\`\`FIBONACCI\`\`\`: returns the next element of the Fibonacci series, using> \
> &#x20;   context variables to store the series progression.\</li>\</ul>

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/TestIntent":{"post":{"tags":["WebHooks"],"summary":"Returns test intent results.","description":"Currently available test intents are:<ul><li>```ECHO```: emits the intent utterance as-is.</li><li>```TUNNELING_ECHO```: emits the intent utterance as-is \r\n    and sets the Tunneling flag to true until an utterance\r\n    with \"END\" is received.</li><li>```HISTORY_ECHO```: emits the latest transition history line, \r\n    the current utterance and a follow up greek letter, and sets the Tunneling flag to true\r\n    until an utterance with \"END\" is received</li><li>```COMBINE_LETTER_AND_NUMBER```: requires a letter slot and a number slot,\r\n    emits the content of the two slots in juxtaposition, e.g. \"A10\".</li><li>```DATE_RANGE```: requires a date slot, emits the date range indicated\r\n    by the date slot in the format \"yyyy/MM/dd - yyyy/MM/dd\".</li><li>```AUTOINCREMENT```: returns a progressive number that increments by 1\r\n    each time the intent is called.</li><li>```FIBONACCI```: returns the next element of the Fibonacci series, using\r\n    context variables to store the series progression.</li></ul>","operationId":"WebHooks-TestIntent","requestBody":{"description":"Intent request","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/IntentWebHookRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/IntentWebHookRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/IntentWebHookRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/IntentWebHookRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentWebHookResponse"}}}}}}}},"components":{"schemas":{"IntentWebHookRequest":{"type":"object","properties":{"intentName":{"type":"string","description":"Name of the intent.","nullable":true},"utterance":{"type":"string","description":"Intent utterance as received by the Dialog State Machine.\r\nIf ```Null``` the Intent is being called on a Timeout event.","nullable":true},"slotValues":{"type":"object","additionalProperties":{"type":"string"},"description":"Values of intent slots extracted from the utterance.","nullable":true},"sessionID":{"type":"string","description":"ID of the session where the request is being performed. <br> This property is not used to match a request with cached responses of the same request, i.e.: two requests with identical properties but different <code>SessionID</code> are considered identical.","nullable":true},"media":{"type":"array","items":{"$ref":"#/components/schemas/WebHookMediumSpecs"},"description":"List of Medium objects added with previous Medium Selected events\r\nand to be used in intent execution.","nullable":true},"currentTag":{"type":"string","description":"Latest tag set with a Tag Changed event. May be ```Null```\r\nif the Memori session is currently anonymous.","nullable":true},"currentTagAuthenticated":{"type":"boolean","description":"```True``` if the CurrentTag refers to a person and they have\r\n            been authenticated through their PIN. ```False``` otherwise."},"currentDateUTC":{"type":"string","description":"Latest date/time set with a Date Changed event. May be ```Null```\r\nif the Memori session has no date/time set.","format":"date-time","nullable":true},"currentPlace":{"$ref":"#/components/schemas/WebHookLocationSpecs"},"timeZone":{"type":"string","description":"Time zone of the request, expressed as a TZ database name.\r\nE.g. ```Europe/Rome``` or ```America/Los_Angeles```.\r\nShould be considered when the request depends on a date/time,\r\nsince they are always specified in the UTC time zone.","nullable":true},"beginUTC":{"type":"string","description":"Beginning of the date/time range the request refers to. If the\r\nintent uses the ```date``` slot, this corresponds to the\r\ninitial timestamp of the date range. E.g. for \"today\" it is set\r\nto the instant of midnight of the current day, in the UTC time zone.\r\nIf the intent does not use the ```date``` slot, ```BeginUTC```\r\nand ```EndUTC``` are set by default to the date range of today.","format":"date-time"},"endUTC":{"type":"string","description":"Ending of the date/time range the request refers to. If the\r\nintent uses the ```date``` slot, this corresponds to the\r\nfinal timestamp of the date range. E.g. for \"today\" it is set\r\nto the instant of midnight of the next day, in the UTC time zone.\r\nIf the intent does not use the ```date``` slot, ```BeginUTC```\r\nand ```EndUTC``` are set by default to the date range of today.","format":"date-time"},"contextVars":{"type":"object","additionalProperties":{"type":"string"},"description":"Values of context variables accumulated so far by the Dialog State Machine.","nullable":true},"transitionHistory":{"type":"array","items":{"$ref":"#/components/schemas/WebHookTransitionSpecs"},"description":"List of previous transitions that have been performed by the Dialog State Machine.\r\nMay be empty.","nullable":true},"userEmail":{"type":"string","description":"E-mail address of the current user, if available.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request. It is NOT a unique number, since it is reset each time the Server is restarted, but together with <code>RequestDateTime</code> (and optionally <code>MemoriID</code>) they form a reasonably unique identifier. <br> This property is not used to match a request with cached responses of the same request, i.e.: two requests with identical properties but different <code>RequestID</code> are considered identical.","format":"int64","readOnly":true},"requestDateTime":{"type":"string","description":"Timestamp of the request in UTC time zone. <br> This property is not used to match a request with cached responses of the same request, i.e.: two requests with identical properties but different <code>RequestDateTime</code> are considered identical.","format":"date-time","readOnly":true},"requestValidityMinutes":{"type":"number","description":"Validity of the request, expressed in minutes, i.e. the time the response will be cached and considered valid. After this time the response will be automatically discarded. <br> Two requests are considered identical (and the cached response of the first may be used for the second) if ALL of their parameters are identical EXCEPT <code>RequestID</code>, <code>RequestDateTime</code> and <code>RequestValidityMinutes</code>, and additionally <code>SessionID</code> for IntentWebHookRequest.","format":"double","readOnly":true},"memoriID":{"type":"string","description":"ID of the Memori performing the request.","nullable":true},"culture":{"type":"string","description":"Culture of the request, expressed as a combination of\r\nan ISO-639 language code and an ISO-3166 country code.\r\nE.g. ```it-IT``` or ```en-US```.","nullable":true}},"additionalProperties":false,"description":"Specifications for an Intent Web Hook request."},"WebHookMediumSpecs":{"type":"object","properties":{"mediumID":{"type":"string","description":"Medium object ID.\r\nRequired.","nullable":true},"title":{"type":"string","description":"Title of the Medium.","nullable":true},"url":{"type":"string","description":"URL of the Medium. If specified, the Content property must be ```Null```.\r\nUse this property to link large amounts of data stored externally.\r\nIf the amount of data is modest the Content property may be used as an alternative.","nullable":true},"content":{"type":"string","description":"Content of the Medium. If specified, the URL property must be ```Null```.\r\nDon't use this property to store large amounts of data. Can be used to store limited \r\ntext for a maximum of 10 KiB. For larger amounts store the data externally and link it\r\nvia the URL property.","nullable":true},"mimeType":{"type":"string","description":"MIME type of the Medium.\r\nRequired.","nullable":true},"properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Key-value pairs for additional structured content storage.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Web Hook Medium object."},"WebHookLocationSpecs":{"type":"object","properties":{"placeName":{"type":"string","description":"Name of the place. May be ```Null``` if the place has\r\nbeen specified only by coordinates and uncertainty.","nullable":true},"latitude":{"type":"number","description":"Latitude of the place.\r\nRequired.","format":"double"},"longitude":{"type":"number","description":"Longitude of the place.\r\nRequired.","format":"double"},"uncertaintyKm":{"type":"number","description":"Uncertainty of the place, expressed in kilometers.\r\nRequired.","format":"double"}},"additionalProperties":false,"description":"Specifications of a Web Hook Location object."},"WebHookTransitionSpecs":{"type":"object","properties":{"enteredText":{"type":"string","description":"Text value of the TextEntered event that triggered the transition.\r\nMay be ```Null``` if the transition was triggered by a Timeout event.","nullable":true},"enteredMedia":{"type":"array","items":{"$ref":"#/components/schemas/WebHookMediumSpecs"},"description":"List of Medium objects attached to the TextEntered event.\r\nMay be ```Null``` if the transition was triggered by a Timeout event.","nullable":true},"emission":{"type":"string","description":"Text of the emission resulting from the transition.\r\nMay be ```Null``` if the transition event was ignored.","nullable":true},"emittedMedia":{"type":"array","items":{"$ref":"#/components/schemas/WebHookMediumSpecs"},"description":"List of Medium objects emitted with the transition together with the Emission text.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Web Hook Transition object."},"IntentWebHookResponse":{"type":"object","properties":{"emission":{"type":"string","description":"Text to be used as the Emission of the Dialog State Machine.\r\nIf ```Null``` the Dialog State Machine will try to provide an\r\nanswer by other means. This also applies during tunneling in T2 state\r\n(see ```Tunneling```).","nullable":true},"preformatted":{"type":"boolean","description":"If ```True```, when this response is emitted no reformatting is applied."},"conclusive":{"type":"boolean","description":"If ```True```, when this response is emitted it is NOT followed by a continuation prompt,\r\nsuch as \"Is there anything else you want to know?\"."},"media":{"type":"array","items":{"$ref":"#/components/schemas/WebHookMediumSpecs"},"description":"List of Medium objects associated with this response.\r\nMay be empty.","nullable":true},"hints":{"type":"array","items":{"type":"string"},"description":"List of hints to be suggested together with the Emission.","nullable":true},"minTimeout":{"type":"number","description":"Minimum idle timeout, in seconds. If not specified, by default it is set to 20 seconds. <br> The idle timeout is the time after which the client sends a Timeout event and, typically, a random question or story is picked up and proposed to the user, or a timeout intent is invoked. The actual idle timeout is computed as a random number between <code>MinTimeout</code> and <code>MaxTimeout</code> plus the reading time, where the reading time is in turn computed as the time it would take to read the <code>Emission</code> at 150 words per minute.","format":"double","nullable":true},"maxTimeout":{"type":"number","description":"Maximum idle timeout, in seconds. If not specified, by default it is set to 40 seconds. <br> The idle timeout is the time after which the client sends a TimedOut event and, typically, a random question or story is picked up and proposed to the user, or a timeout intent is invoked. The actual idle timeout is computed as a random number between <code>MinTimeout</code> and <code>MaxTimeout</code> plus the reading time, where the reading time is in turn computed as the time it would take to read the <code>Emission</code> at 150 words per minute.","format":"double","nullable":true},"contextVarsToSet":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"List of variable-value pairs to be used to alter the context when this response is emitted.\r\nUse the special value ```-``` (a single dash character) to clear a context variable.","nullable":true},"memoryTags":{"type":"array","items":{"type":"string"},"description":"Optional list of memory tags to be associated with this response.","nullable":true},"tunneling":{"type":"boolean","description":"If ```True``` the Dialog State Machine enters the special T2 state\r\nand will send any subsequent entered text to the Intent Web Hook. When set to\r\n```False``` the Dialog State Machine will return to the R1 state."},"requestID":{"type":"integer","description":"Progressive number of the original request this response refers to.\r\nRequired.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the original request this response refers to, in UTC time zone.\r\nRequired.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code of the request. Must be set to ```0``` if the request\r\nsucceeded. Any other value will be considered a failure, but the value\r\nwill be logged for subsequent diagnosis.\r\nRequired.","format":"int32"},"resultMessage":{"type":"string","description":"Result message of the request. Must be set to ```Ok``` if the request\r\nsucceeded. Any other value will be considered a failure, but the value\r\nwill be logged for subsequent diagnosis.\r\nRequired.","nullable":true}},"additionalProperties":false,"description":"Specifications for an Intent Web Hook response."}}}}
````

## GET /memori/v2/TestFunctions/RandomNumber

> Test function: returns a random number between 0 and 999999.

```json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/TestFunctions/RandomNumber":{"get":{"tags":["WebHooks"],"summary":"Test function: returns a random number between 0 and 999999.","operationId":"WebHooks-TestFunctionRandomNumber","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```

## POST /memori/v2/TestFunctions/EchoHeaders

> Test function: echoes back the received headers, query string, and body for testing parameter substitution.

```json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/TestFunctions/EchoHeaders":{"post":{"tags":["WebHooks"],"summary":"Test function: echoes back the received headers, query string, and body for testing parameter substitution.","operationId":"WebHooks-TestFunctionEchoHeaders","responses":{"200":{"description":"Success"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisuru.com/api/engine/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
