Skip to content

Intents

Overview

The /intents endpoint is used to create, retrieve, update, and delete intent objects.

See the glossary for detailed informations about intents.

Reminder : The base URL of proximity community API is api.prisme.ai/v1/

GET /intents

Retrieves a list of all intents.

curl -X GET \
  https://api.prisme.ai/v1/intents \
  -H 'Authorization: Bearer Prisme_Developer_Token' \
  -H 'Content-Type: application/json' \

Headers

Provide the following headers with values.

Key Value
Content-Type application/json
Authorization Bearer Prisme_Developer_Token

POST /intents

The intents endpoint is used to post a new intent.

URL : api.prisme.ai/v1/intents

Method : POST

Request example

curl -X POST \
  https://api.prisme.ai/v1/intents \
  -H 'Authorization: Bearer Prisme_Developer_Token' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Welcome Intent",
    "disambiguationSentence": {
        "en": "",
        "fr": ""
    },
    "isWelcome": true,
    "outputContexts": [],
    "events": [],
    "utterances": {
        "en": [
            {
                "data": [
                    {
                        "text": "Hi"
                    }
                ]
            },
            {
                "data": [
                    {
                        "text": "Hello"
                    }
                ]
            },
            {
                "data": [
                    {
                        "text": "hey"
                    }
                ]
            },
            {
                "data": [
                    {
                        "text": "Hola"
                    }
                ]
            }
        ],
        "fr": [
            {
                "data": [
                    {
                        "text": "hello"
                    }
                ]
            },
            {
                "data": [
                    {
                        "text": "salut"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "en": [],
        "fr": []
    },
    "conditionalResponses": {
        "en": {
            "default": {
                "default": [
                    {
                        "text": [
                            "Welcome"
                        ],
                        "type": "text"
                    },
                    {
                        "type": "link",
                        "value": "https://console.prisme.ai",
                        "openInPanel": false,
                        "text": "Pricing"
                    }
                ]
            },
            "if": [
                {
                    "fulfillment": {
                        "default": [
                            {
                                "text": [
                                    "An agent is connecting. Please wait...",
                                    "An agent is connecting. Please wait few seconds."
                                ],
                                "type": "text"
                            }
                        ]
                    },
                    "conditions": [
                        [
                            "system.isAgentAvailable",
                            "exists",
                            ""
                        ]
                    ]
                }
            ]
        },
        "fr": {
            "default": {
                "default": [
                    {
                        "text": [
                            "salut"
                        ],
                        "type": "text"
                    }
                ]
            },
            "if": []
        }
    }
}
'

Headers

In the request URL, provide the following headers with values.

Key Value
Content-Type application/json
Authorization Bearer Prisme_Developer_Token

Request body

The following parameters are used as JSON keys in the POST body.

Parameter Type Description Required
name String Name of the intent Optional
isWelcome boolean welcome intent Optional
isFallback boolean fallback intent Optional
events Array of string [ array of event Optional
disambiguationSentence object of string by language it allows generating FAQ page Optional
inputContexts Array of string array of context Optional
outputContexts Array of object by language array of context Optional
utterances object of Array by language List of the different training sentences (utterance) for the Virtual Agent Optional
parameters Array of object by language array of object Optional
conditionalResponses object of Array by language By condition and channel you may add Stream of responses in text/Web/Cards ... Optional
settings object of object by language Configure some behaviours by intent (settings). Optional

Utterance

Parameter Type Description
data Array List of sentence part that form a sentence together

Sentence Part

Parameter Type Description
text String What the user says
entity String Name of the entity that is present on the sentence part. Do not specify it if your Sentence Part doesn't include an Entity
slot_name String Name of the slot that is present on the sentence part. Can be different of the entity parameter, if you have two times the same entity in the sentence for instance

Stream

A stream is an Array that contains Arrays with equivalent response to communicate to the user in a precise order.

Settings

Settings is an object which allow configuration of different behaviours.

Parameter Type Description Default
placeholder String Set a custom placeholder text for the user text input while using a Prisme connector (webchat, portal, mobile app). "How can I help you?"
disableInput Boolean Disable the user text input when this specific intent is triggered. Usually that means there is an other way to progress in the conversation rather than natural language (buttons, events...). false

Success Response

Condition : No required parameter missing and Prisme_Developer_Token is known by the platform.

Code : 200

GET /intents

Get all intents

GET /intents/:id

Get a specific intent :id is the ID of the intent to get.

POST /intents/:id

Update an intent :id is the ID of the intent to update.

DELETE /intents/:id

Deletes the specified intent. :id is the ID of the intent to delete.

curl -X DELETE \
  https://api.prisme.ai/v1/intents/EmVtF3qBXM \
  -H 'Authorization: Bearer Prisme_Developer_Token' \
  -H 'Content-Type: application/json' \

Headers

Provide the following headers with values.

Key Value
Content-Type application/json
Authorization Bearer Prisme_Developer_Token