Yes, you should be able to use the same session ID when switching to a different language in the same Dialogflow agent.
When sending a detectIntent request to your agent, simply specify your desired session ID in the detectIntent request and specify your desired “languageCode” in the “queryInput.languageCode” field of your request body.
Here’s a sample detectIntent request for REST API:
Sample URL for detect intent API:
POST https://dialogflow.googleapis.com/v3/projects/project-id/locations/location-id/agents/agent-id/sessions/session-id:detectIntent
Make the following replacements for the URL:
project-id: your GCP project ID
agent-id: your agent ID
location-id: your agent’s location ID
session-id: your desired session ID
Sample JSON Request Body should look like this:
{
"queryInput": {
“text": {
"text": "hello"
},
"languageCode": "en" // desired language code
--
© 2021 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Dialogflow CX Edition Discussion Google Group (dialogflow-cx...@googlegroups.com) to participate in discussions with other members of the Dialogflow community and the Dialogflow Team.
---
You received this message because you are subscribed to the Google Groups "Dialogflow CX Edition users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dialogflow-cx-editi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dialogflow-cx-edition-users/2e527f66-09d2-4628-bdfb-172596901950n%40googlegroups.com.