Service Integration Guide

Configuring technical aspects for optimal analytics gathering

URL Configuration

To process requests sent by Parloa, you'll need to define an HTTPS endpoint.

Authentication

Protect your endpoint against unauthorized access by choosing between HTTP Basic Auth and Bearer token authentication. Configure these in the Configuration tab.

Optionally, employ a custom header, such as x-api-key, for an additional layer of security.

Authentication MethodsRequired Input

Authorization token

Token

Basic authorization

Username, password

Headers

Custom headers that will accompany your request can be specified as needed.

Cache Service Response

By enabling the cache for a particular service, you cache responses for the current version. The cache is keyed based on the release, input parameters, and the service URL.

Retry Mechanism

Parloa will attempt a retry if:

  • A timeout occurs.

  • The status code is within the range of 502 to 504 or equals 429.

  • The error code is deemed retryable according to is-retry-allowed.

Retries will persist until they are exhausted, after which standard error procedures take over.

Service Timeout

Customize Parloa's timeout settings between 0ms to 20,000ms by toggling the Override Service Timeout switch on the Service screen.

  • The default timeout is 4000ms if none is specified.

  • A specified timeout will take precedence and replace the default setting.

In a timeout scenario, calculate the duration using the formula: service timeout + retries * (service timeout + 50ms), where 50ms accounts for the retry delay.

Service Request

Parloa sends requests in JSON format via HTTP POST, which includes context and input data tailored to the platform.

You are not obliged to process all provided information.

Request Body

The request body sent to your endpoint contains a predefined set of properties, as illustrated below:

Key

Type

Description

context

object

Contains an object with context information.

context.releaseId

string

The Parloa ID of the release which initiated the request.

context.userContextId

string

An internal Parloa ID representing a conversation by mapping the user ID with the release ID.

context.platform

string

The platform interacting with the release. Possible values: -phoneV1- phoneV2 - alexa- dialogflow

context.request

object

The raw request received by Parloa from the platform.

context.conversationId

string

The unique conversation identifier of the current conversation between the user and your bot. You can use it to retrieve the corresponding conversation history.

input

object

Contains the key-value pairs representing the input parameters defined in the correspondingService block.

Be aware that these properties are exclusive to a service call and should not be mistaken for context variables.

Example Request Bodies

The structure of the request body differs based on the platform. Here are examples for phoneV2 and Alexa:

{
    "input": {
        "addressInput": "MÃŧnz straße 5 in Berlin"
    },
    "context": {
        "releaseId": "60f6dab0adb66dce7fac1d7a",
        "userContextId": "60f6e59699712c59611f39df",
        "conversationId": "5e68aa33-e0a3-4d3a-b263-10540ef03d21",
        "dialogId": "60f6dab0adb66dce7fac1d7a",
        "dialogVersion": "1",
        "fovConversationId": "+4917612345678-60f6dab0adb66dce7fac1d7a--default",
        "platform": "phoneV2",
        "request": {
            "callMeta": {
                "callId": "54cb5639-6e40-123a-4ba8-d094667acbd8",
                "callerId": "+4917612345678",
                "instanceId": "60f6dab0adb66dce7fac1d7a"
            },
            "intent": {
                "id": -6487798570032697000,
                "name": "TellAddress",
                "confidence": 0.9999997615814209
            },
            "intentRanking": [
                {
                    "id": -6487798570032697000,
                    "name": "TellAddress",
                    "confidence": 0.9999997615814209
                },
                {
                    "id": 4374073288754445300,
                    "name": "CancelIntent",
                    "confidence": 2.335296192534919e-11
                }
            ],
            "slots": [
                {
                    "extractor": "DIETClassifier",
                    "entity": "Address",
                    "confidenceEntity": 0.7132492661476135,
                    "value": "MÃŧnz straße 5 in Berlin",
                    "start": 0,
                    "end": 23,
                    "processors": [],
                    "text": ""
                },
                {
                    "extractor": "DucklingEntityExtractor",
                    "value": 5,
                    "confidence": 1,
                    "entity": "number",
                    "additionalInfo": {
                        "value": 5,
                        "type": "value"
                    },
                    "start": 12,
                    "end": 13,
                    "processors": [],
                    "text": "86"
                }
            ],
            "text": "MÃŧnz straße 5 in Berlin"
        }
    }
}

Service Response

Parloa anticipates a 200 HTTP status response in JSON format.

Response Body

Parloa expects to receive a response body structured as follows:

KeyRequiredTypeDescription

choice

Yes

string

The name of the branch that should be followed after the Service block.

output

Yes

object

An object containing key-value pairs that match the output defined in the code output configuration.

responseOverwrites

No

object

An object which can contain key-value pairs where the key is the platform name and the value is an object representing a partial response for the platform which will be merged with the response generated by Parloa. Please take into account that no deep-merging will be performed and high-level keys defined in the response will overwrite those set by Parloa. Possible platform keys: - alexa

- phoneV1 - dialogflow.

dynamicEntityOverwrites.alexa

No

UpdateDynamicEntities[]

A list of UpdateDynamicEntities directives. They are expected in the Alexa specific format. If provided they will be written into the Parloa generated Alexa response.

ℹī¸ The uploaded dynamic entities time out after 30 minutes on Alexa.

dynamicEntityOverwrites.<dialogflowPlatform>

No

SessionEntityType[]

A list of SessionEntityType. They are expected in the Dialogflow specific format. If provided they will be written into the Parloa generated Dialogflow response.

Possible Dialogflow platform keys: - dialogflow

- phoneV1 - whatsapp

speechToTextHints

No

string[]

An array of words of phrases to be used as hints during speech recognition of phoneV2 releases.

Response Timeout

An external service must respond within a given timeout with a successful status code, otherwise, Parloa will delegate the control to the error branch. For more information, please refer to Parloa Errors.

Release TypesResponse Timeout

Dialogflow

4 Seconds

Whatsapp

4 Seconds

PhoneV1

4 Seconds

PhoneV2

9.5 Seconds

Example Responses

Here you can find a sample response for the basic return of data, responseOverwrites and for dynamicEntityOverwrites:

{
  "choice": "success",
  "output": {
    "formattedAddress": "MÃŧnzstraße 5, 10178 Berlin"
  }
}

Last updated