other-emerald
other-emerald2y ago

Knowledge base API query

I am following the documentation here to access the KB API https://developer.voiceflow.com/reference/post_knowledge-base-query I keep getting a 400 server error. I chacked that I am using the right API Key from the KB. This keep happening even when I am trying to test it on the documentation site (see screenshot). Any suggestions?
No description
3 Replies
Tico | Voiceflow Assistant
Based on the information you've provided, it seems like you're encountering a 400 server error when trying to access the Knowledge Base API. This error typically indicates that there's something wrong with the request you're sending. Since you've mentioned that you're using the correct API Key, the issue might be related to the structure of your request. Please ensure that your request matches the format outlined in the documentation. For instance, the request should include a question, a chunk limit, and tags. Here's an example of a properly formatted request:
{
"question": "Suggest a woodworking project idea and how it would be built.",
"chunkLimit": 2,
"tags": {
"include": {
"items": ["beginner", "small_scale"],
"operator": "and"
}
}
}
{
"question": "Suggest a woodworking project idea and how it would be built.",
"chunkLimit": 2,
"tags": {
"include": {
"items": ["beginner", "small_scale"],
"operator": "and"
}
}
}
If you're still encountering issues, it might be helpful to compare your request with the example provided in the documentation. Sources: - Knowledge Base Query API Documentation
vicious-gold
vicious-gold2y ago
It doesnt look like you're including a question with it - if you scroll down on the left you'll see a required question field
W. Williams (SFT)
Try this one:
{
"chunkLimit": 3,
"synthesis": true,
"question": "test"
}
{
"chunkLimit": 3,
"synthesis": true,
"question": "test"
}

Did you find this page helpful?