I'm not sure if this will help with your API, but I was having a similar problem using node JS.
This is because knowledge base isn't supported in V1 or V2 but only in the v2beta1. I found this link as a starting point from this thread but I think the sample code is out of date because I had to make a few changes before it started to work.
When declaring dialogFlow
I used
const dialogflow = require('dialogflow').v2beta1;
From package.json
:
"dependencies": {
"dialogflow": "^0.7.0"
}
And instead of:
const sessionPath = sessionClient.projectAgentSessionPath(
projectId,
sessionId
);
I used:
const sessionPath = sessionClient.sessionPath(
projectId,
sessionId
);
because .projectAgentSessionPath
was not defined as a function when I tried it.
Hope that helps!