POST
/
generativeagent
/
v1
/
analyze
curl --request POST \
  --url https://api.sandbox.asapp.com/generativeagent/v1/analyze \
  --header 'Content-Type: application/json' \
  --header 'asapp-api-id: <api-key>' \
  --header 'asapp-api-secret: <api-key>' \
  --data '{
  "conversationId": "01BX5ZZKBKACTAV9WEVGEMMVS0",
  "message": {
    "text": "Hello, I would like to upgrade my internet plan to GOLD.",
    "sender": {
      "role": "agent",
      "externalId": 123
    },
    "timestamp": "2021-11-23T12:13:14.555Z"
  },
  "taskName": "UpgradePlan",
  "inputVariables": {
    "context": "Customer called to upgrade their current plan to GOLD",
    "customer_info": {
      "current_plan": "SILVER",
      "customer_since": "2020-01-01"
    }
  },
  "channelType": "digital"
}'
{
  "conversationId": "01BX5ZZKBKACTAV9WEVGEMMVS0",
  "messageId": "01BX5ZZKBKACTAV9WEVGEMMVS1"
}

Authorizations

asapp-api-id
string
header
required
asapp-api-secret
string
header
required

Body

application/json

The parameters for triggering the analysis and response to a conversation

conversationId
string
required

Internal conversation identifier from ASAPP

Example:

"01BX5ZZKBKACTAV9WEVGEMMVS0"

streamId
string

The id associated with the connection where the responses should be sent to.

Example:

"97555020-0276-435f-8104-c378221ba292"

taskName
string

Name of the task to be used in the analysis

Example:

"UpgradePlan"

inputVariables
object

Input variables to be used as context in the analysis.

Example:
{
  "call_context": "Customer called to upgrade their current plan to GOLD",
  "customer_info": {
    "current_plan": "SILVER",
    "customer_since": "2020-01-01"
  }
}
message
object

Represents a single message within a conversation.

Example:
{
  "text": "Hello, I would like to upgrade my internet plan to GOLD.",
  "sender": { "role": "agent", "externalId": 123 },
  "timestamp": "2021-11-23T12:13:14.555Z"
}
channelType
enum<string>

Channel type used by the current request (digital or voice)

Available options:
digital,
voice
Example:

"digital"

Response

200
application/json
Successfully triggered the bot to analyze and respond to a conversation

Conversation identifier and message identifier if passed in the request

conversationId
string

Internal conversation identifier from ASAPP

Example:

"01BX5ZZKBKACTAV9WEVGEMMVS0"

messageId
string

Internal message identifier from ASAPP

Example:

"01BX5ZZKBKACTAV9WEVGEMMVS1"