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

How to invoke REST API from Vertex Agent?

Hello,

I am building Agent using the Vertex Agent Builder. I would like to invoke REST API from it. How to do it?

0 3 1,326
3 REPLIES 3

Hi @Magulan,

Welcome to the Google Cloud Community!

Integrating REST APIs into agents built with Vertex AI Agent Builder helps expand their features and connect them with external systems, enabling smarter and more dynamic solutions.

Here’s general steps to invoke a REST API from an agent using Vertex AI Agent Builder: 

  1. Use REST API Integration -Interact with REST endpoints using the Discovery Engine API. This requires you to define the API requests and responses that will be managed by your agent.
  2. Authenticate to Vertex AI Agent - Ensure that your application is authenticated to use Vertex AI Agent Builder APIs.
  3. Programmatic Interaction - To interact with your agent programmatically, you can utilize client libraries or make direct calls to the REST API. For example, you can write Python code to send requests to your agent's endpoint and handle responses seamlessly.
  4. Test and Debug -After setting up your integration, test the API calls and debug any issues by checking the API responses and logs to ensure that they function as expected.

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.

@MJaneI went through them. It is confusing. I need help in the following

1. How to invoke Vertex Agent Builder via API from Postman? It works with the Chat Code Snippet. I would like to test it via REST API.

2. How to invoke 3rd party application APIs(For example, Salesforce REST API) from Vertex Agent Builder?