Send Context to Conversation
curl --request POST \
--url https://api.bey.dev/v1/conversations/{id}/context \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "The user is now on page 3: Retail Installment Contract.",
"respond": true
}
'import requests
url = "https://api.bey.dev/v1/conversations/{id}/context"
payload = {
"text": "The user is now on page 3: Retail Installment Contract.",
"respond": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'The user is now on page 3: Retail Installment Contract.', respond: true})
};
fetch('https://api.bey.dev/v1/conversations/{id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Agent Conversations
Send Context to Conversation
Send context to the agent of an ongoing conversation.
Use it to tell the agent what is happening in your application, such as
the page or document the user has opened. With respond, the agent
speaks about it right away, without waiting for the user.
Available from the Growth Plan onwards.
POST
/
v1
/
conversations
/
{id}
/
context
Send Context to Conversation
curl --request POST \
--url https://api.bey.dev/v1/conversations/{id}/context \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "The user is now on page 3: Retail Installment Contract.",
"respond": true
}
'import requests
url = "https://api.bey.dev/v1/conversations/{id}/context"
payload = {
"text": "The user is now on page 3: Retail Installment Contract.",
"respond": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'The user is now on page 3: Retail Installment Contract.', respond: true})
};
fetch('https://api.bey.dev/v1/conversations/{id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Body
application/json
Request body to send context to the agent of an ongoing conversation.
Context for the agent, such as what the user is looking at. It stays in the conversation, so later answers use it too.
Required string length:
1 - 3000Pattern:
^[^\x00-\x08\x0b\x0c\x0e-\x1f\x7f]*$Example:
"The user is now on page 3: Retail Installment Contract."
Response
Successful Response
Was this page helpful?