0

I'm working with Dialogflow CX and need to access analytics data from outside Google Cloud, such as from Postman or a backend service.

While inspecting the Dialogflow CX Console network traffic, I found the following request being made:

https://europe-west3-dialogflow.clients6.google.com/v3alpha1/projects/{projectId}/locations/{location}/agents/{agentId}/analytics?endTime=2025年05月18日T07%3A00%3A00.000Z&pageSize=1680&startTime=2025年05月06日T07%3A00%3A00.000Z&trimOutputFields=true&key={key}

I tried replicating this request by generating a service account and using its credentials to obtain an access token. However, when I make the request (including the API key), I receive the following error:

{
"error": {
"code": 400,
"message": "The API key and the authentication credential are from different projects"
}
}

It seems the problem is related to the key parameter and that this endpoint may be restricted to use only from the Dialogflow Console.

My questions are:

Is there a supported way to access Dialogflow CX Analytics programmatically from outside Google Cloud (for example, using service account credentials)?

Can I get the same analytics data from BigQuery instead, and if so, how do I set that up?

Is there any configuration I need to adjust (like permissions) to make this work?

Thanks in advance for any guidance!

asked May 19, 2025 at 12:01

1 Answer 1

0

To answer your questions:

  • Is there a supported way to access Dialogflow CX Analytics programmatically from outside Google Cloud (for example, using service account credentials)?

    No, there is no official, publicly documented API for directly accessing the aggregated analytics metrics shown in the Dialogflow CX console. The request URL you found is using v3alpha1 that can only be used by allowlisted projects.

  • Can I get the same analytics data from BigQuery instead, and if so, how do I set that up?

    Yes, exporting Dialogflow CX interaction logs to Google BigQuery is the recommended and supported method. This provides raw, detailed conversation data (including full request/response JSONs) for custom analysis.

    See this link for more details on how to set up.

  • Is there any configuration I need to adjust (like permissions) to make this work?

    Yes, here are the permission you need:

    • For Dialogflow CX to export: The Dialogflow CX service agent needs the Dialogflow Service Agent role (roles/dialogflow.serviceAgent).

    • For your external application to query BigQuery: Your service account needs BigQuery Data Viewer and BigQuery Job User roles. Ensure billing is enabled for your project.

    • You may also try using a different version of the Dialogflow CX API since v3alpha1 only works in allowlisted projects.

answered May 22, 2025 at 13:08
Sign up to request clarification or add additional context in comments.

1 Comment

Is there a way to see (maybe git) the SQL query used by an API endpoint ?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.