Your API key for authentication.Example web call usage (client side):import { BlandWebClient } from 'bland-client-js-sdk';
const agentId = 'YOUR-AGENT-ID';
const sessionToken = 'YOUR-SESSION-TOKEN';
document.addEventListener('DOMContentLoaded', async () => {
document.getElementById('btn').addEventListener('click', async () => {
const blandClient = new BlandWebClient(
agentId,
sessionToken
);
await blandClient.initConversation({
sampleRate: 44100,
});
});
});
Path
The web agent to authorize a call for.Special note: While in Beta, this request must be made to the api.bland.ai domain.
Body
Variables to be passed to this session.Example:
Response
The single-use session token that can be sent to the client.
A message saying whether the token creation succeeded, or a helpful message describing why it failed.
{
"token": "22480c52-0ff1-4214-bcb7-50649b508432"
}