Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Query Parameters Passed via DetectIntent Request Aren't Being Used in Headers in OpenAPI Tool

I've set up a generative ai conversational agent using playbooks and am attempting to pass custom parameters in to the chatbot session from our integrated frontend. I am passing in an active user session token to use as a bearer token to use in the auth headers of an OpenAPI tool. However, when I open a session, despite the fact that I can see the parameter being passed it does not appear that the authorization header is being used because every response is returning as 'Unauthorized'. Thus I wanted to ask if this is being passed in correctly or if I have configured this incorrectly?

Passing Parameters via JavaScript.png

 Session Parameter as Header in Tool.png

 

Solved Solved
0 1 195
1 ACCEPTED SOLUTION

Hi @ce-pbc,

Welcome to Google Cloud Community!

Here are several suggestions that may help resolve the issue:

  • Even though the parameter is being passed, it's possible that the OpenAPI tool isn't properly handling it due to a mismatch between its expected configuration and the nested structure of the frontend request. Ensure that the tool’s configuration aligns with the nested structure used to pass the session parameter from your frontend. You can refer to the relevant documentation for reference.
  • Ensure the token is valid and not expired.
  • For best practice, ensure you're not  hitting any OpenAPI tool limitation.
  • To further troubleshoot your issue, check Cloud Logging to analyze for deeper diagnostics and examine logs related to the error.
  • For other methods of authentication using the OpenAPI tool, you can check this documentation.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

1 REPLY 1

Hi @ce-pbc,

Welcome to Google Cloud Community!

Here are several suggestions that may help resolve the issue:

  • Even though the parameter is being passed, it's possible that the OpenAPI tool isn't properly handling it due to a mismatch between its expected configuration and the nested structure of the frontend request. Ensure that the tool’s configuration aligns with the nested structure used to pass the session parameter from your frontend. You can refer to the relevant documentation for reference.
  • Ensure the token is valid and not expired.
  • For best practice, ensure you're not  hitting any OpenAPI tool limitation.
  • To further troubleshoot your issue, check Cloud Logging to analyze for deeper diagnostics and examine logs related to the error.
  • For other methods of authentication using the OpenAPI tool, you can check this documentation.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.