cheezymcsquibble
02/27/2025, 9:24 PMVapi Support Bot
02/27/2025, 9:25 PMGET https://api.vapi.ai/assistant
Ensure you include the necessary headers, especially the Authorization header with your Bearer token.
2. **Process the Response**: Once you receive the data, you can use the SayHook
feature to read out the items. This feature allows you to specify the text that the assistant will speak.
Here’s a simple example using JavaScript's Fetch API to get the list and read it out:
javascript
async function getAssistants() {
const response = await fetch('https://api.vapi.ai/assistant', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
const items = data.items; // Assuming the response has an 'items' array
// Use SayHook to read out the items
items.forEach(item => {
// Here you would implement the SayHook to read each item
console.log(item); // Replace this with the SayHook implementation
});
}
getAssistants().catch(console.error);
3. **Implement SayHook**: You can intercept the text that your assistant speaks by using the exact
or prompt
properties in the SayHook to customize the output.
Make sure to handle any errors and ensure your API requests are authenticated properly. If you have any more questions or need further assistance, feel free to ask! 😊
Sources:
- [API Reference for Listing Assistants](https://docs.vapi.ai/api-reference/assistants/list)
- [JWT Authentication Documentation](https://docs.vapi.ai/customization/jwt-authentication)
- [Changelog for SayHook](https://docs.vapi.ai/changelog)cheezymcsquibble
02/27/2025, 9:28 PMPraveen
03/01/2025, 4:35 PMPraveen
03/01/2025, 4:36 PM