Reputation: 417
I'm using dialogflow v2 using npm https://github.com/googleapis/nodejs-dialogflow.
Then I have a task to call API to get the number of messages in analytics.
https://dialogflow.cloud.google.com/#/agent//analytics
use this API
https://api.dialogflow.com/api/interactions/analytics/messages?timeInterval=1.
So anyone can suggest to me how to call that API in dialogflow npm. I can not get
Upvotes: 1
Views: 208
Reputation: 50701
See https://developers.google.com/identity/protocols/oauth2 for more about generating the auth token for a REST request using a service account. But that isn't the problem.
The real issue is that you're trying to access an internal API, and your project likely isn't permitted to this API.
The library itself doesn't have access to that portion of the API as well, so even if you were permitted (and, I should emphasize, you're probably not), you would need to make the REST calls directly without a library.
Upvotes: 2