deep-jade•2y ago
Error Querying Knowledge Base via API
Hi everyone, I'm new to VoiceFlow and was trying to query my knowledge base via the API, the query is successful from the API doc website (https://developer.voiceflow.com/reference/post_knowledge-base-query).
But when I copy the JSON body and send a test request with the API block, I get a "message : Invalid value" that I have attached here. Does anyone have any idea what I could be doing wrong?
And this is my JSON body
{
"question": "Test"
}

8 Replies
It sounds like you're encountering an issue with querying your knowledge base via the API after transferring the JSON body from the API documentation to the API block in Voiceflow. This error could be due to several factors, but let's address some common areas that might help resolve the issue:
- Ensure that the JSON body is correctly formatted and matches the structure expected by the API endpoint you're targeting.
- Double-check that all required fields in the JSON body are included and correctly spelled.
- Verify that your Dialog Manager API Key is correctly included in the header of your request. This key is essential for all requests to any Knowledge Base APIs.
- Make sure that the endpoint URL you're querying is correct and matches the one provided in the API documentation.
Remember, all requests to Knowledge Base APIs require a Dialog Manager API Key, which can be obtained from the Integration tab on the project you uploaded data sources to. Click the "Copy API key" button to use this key in your API requests.
If you've checked these areas and are still facing issues, it might be helpful to review the API documentation again to ensure that the request is being sent as expected. Here are some resources that might be useful:
- Knowledge Base API Documentation
- API Key and Integration Details
These links provide detailed information on how to structure your API requests and ensure that your Dialog Manager API Key is correctly utilized.
Can you provide a screenshot of the API step?
deep-jadeOP•2y ago
Yeah of course

try this:
Also, you might change content-type to Content-Type
deep-jadeOP•2y ago
Just tested and getting the same error

deep-jadeOP•2y ago
Do you have any other recommendations? I have tried the same call in Postman and it was successful so I'm not sure why it's not working in my assistant
I would need to take a look. DM me.
Do you also have an error when testing in the KB preview?