L'attività Chiama endpoint REST consente di chiamare qualsiasi API REST di terze parti dalla tua integrazione. La risposta della chiamata dell'API REST sarà disponibile
in una variabile di integrazione e potrà essere utilizzata in altre attività downstream.
Prima di iniziare
Per connetterti a un endpoint di autenticazione per la chiamata API REST, assicurati di aver creato
un profilo OAuth 2.0 o di aver collegato un service account gestito dall'utente alla tua integrazione. Se la tua API non richiede l'autenticazione, il campo Profilo di autenticazione nel riquadro di configurazione dell'attività può essere lasciato vuoto. Per visualizzare un elenco delle configurazioni, consulta Proprietà di configurazione.
Se la tua integrazione ha configurato sia il profilo OAuth 2.0 sia un account di servizio gestito dall'utente, per impostazione predefinita viene utilizzato il profilo OAuth 2.0 per l'autenticazione. Se non è configurato né il profilo OAuth 2.0 né il account di servizio gestito dall'utente, l'esecuzione non va a buon fine.
Se la tua integrazione ha un account di servizio collegato, in base all'URL dell'endpoint REST, concedi il ruolo IAM richiesto a questo account di servizio. Ad esempio, se l'URL dell'endpoint REST chiama un servizio Cloud Storage, concedi il ruolo IAM richiesto per il servizio Cloud Storage.
Nel menu di navigazione, fai clic su Integrazioni.
Viene visualizzata la pagina Integrazioni, che elenca tutte le integrazioni disponibili nel progetto Google Cloud.
Seleziona un'integrazione esistente o fai clic su Crea integrazione per crearne una nuova.
Se stai creando una nuova integrazione:
Inserisci un nome e una descrizione nel riquadro Crea integrazione.
Seleziona una regione per l'integrazione.
Seleziona un account di servizio per l'integrazione. Puoi modificare o aggiornare i dettagli dell'account di servizio di un'integrazione in qualsiasi momento dal riquadro Riepilogo integrazione nella barra degli strumenti dell'integrazione.info
Fai clic su Crea. L'integrazione appena creata si apre nell'editor integrazioni.
Nella barra di navigazione dell'Editor integrazioni, fai clic su Attività per visualizzare l'elenco delle attività e dei connettori disponibili.
Fai clic sull'elemento Chiamata endpoint REST e posizionalo nell'Editor integrazioni.
Fai clic sull'elemento Chiamata endpoint REST nel designer per visualizzare il riquadro di configurazione dell'attività Chiamata endpoint REST.
Configura i campi visualizzati utilizzando le proprietà di configurazione dell'attività, come descritto in dettaglio nella tabella seguente.
Le modifiche alle proprietà vengono salvate automaticamente.
Proprietà di configurazione
La tabella seguente descrive le proprietà di configurazione dell'attività Chiamata endpoint REST.
URL dell'endpoint REST senza i parametri di ricerca.
Metodo HTTP
NA
Metodo HTTP da utilizzare.
Puoi selezionare uno dei seguenti metodi HTTP:
ELIMINA
GET
HEAD
PATCH
POST
PUT
Parametri stringa di query dell'URL
Chiave stringa di query : Stringa
Valore: Stringa
Parametri di query richiesti per la chiamata API REST.
I parametri di ricerca sono sotto forma di coppie chiave-valore in cui la chiave è il nome della chiave
e il valore è il valore della chiave corrispondente. Puoi inserire più di una coppia chiave-valore
facendo clic sull'icona Più.
Intestazioni HTTP
Chiave dell'intestazione HTTP: String
Valore: Stringa
Intestazioni HTTP richieste per la chiamata API REST.
Le intestazioni HTTP sono sotto forma di coppie chiave-valore in cui la chiave è il nome della chiave e il valore è il valore della chiave corrispondente. Puoi inserire più di una coppia chiave-valore
facendo clic sull'icona Più.
Segui i reindirizzamenti
Booleano
Segui i reindirizzamenti URL.
Puoi selezionare uno dei seguenti valori:
True : chiama l'URL reindirizzato se l'URL di base dell'endpoint
viene inoltrato a un altro URL.
False: non chiama l'URL reindirizzato se l'URL di base dell'endpoint
viene inoltrato a un altro URL.
L'attività deve non riuscire a causa di un errore HTTP
Booleano
Strategia di gestione delle eccezioni quando la chiamata API REST non va a buon fine.
L'endpoint REST di chiamata non riesce se il codice di risposta HTTP è 4xx o 5xx. Per un elenco dei codici di errore, consulta la sezione Codici di errore. Per gli altri codici di risposta HTTP, restituisci il codice di errore e il messaggio di errore nella risposta.
Puoi selezionare uno dei seguenti valori:
True : genera un'eccezione.
False: non genera un'eccezione. ma restituisce il
codice di errore e il messaggio di errore nella risposta.
Intestazione della risposta (<Nome dell'attività>)
Stringa
Intestazione della risposta non compressa dalla risposta delle API REST.
Corpo della risposta (<nome dell'attività>)
Stringa
Corpo della risposta non compresso dalla risposta delle API REST.
Stato risposta (<nome attività>)
Stringa
Codice di risposta HTTP e testo del codice corrispondente dalla risposta delle API REST.
Best practice
Per informazioni sui limiti di utilizzo che si applicano all'attività Chiama endpoint REST, consulta Limiti di utilizzo.
Strategia di gestione degli errori
Una strategia di gestione degli errori per un'attività specifica l'azione da intraprendere se l'attività non riesce a causa di un errore temporaneo. Per informazioni su come utilizzare una strategia di gestione degli errori e sui diversi tipi di strategie di gestione degli errori, consulta Strategie di gestione degli errori.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-03 UTC."],[[["\u003cp\u003eThe \u003cstrong\u003eCall REST Endpoint\u003c/strong\u003e task enables integrations to interact with any third-party REST API, with the response data being accessible for use in subsequent tasks.\u003c/p\u003e\n"],["\u003cp\u003eThis task is restricted to calling endpoints accessible over the public internet and cannot connect to resources within private networks like VPCs.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for REST API calls requires either a pre-configured OAuth 2.0 profile or an attached user-managed service account, however, authentication isn't needed if it's not required by the API.\u003c/p\u003e\n"],["\u003cp\u003eThe task supports various HTTP methods (DELETE, GET, HEAD, PATCH, POST, PUT) and allows for the configuration of URL query string parameters and HTTP headers.\u003c/p\u003e\n"],["\u003cp\u003eThe task has a response limit of 50 MB, and you can manage error handling, with the ability to throw exceptions or return error codes and messages based on HTTP status codes.\u003c/p\u003e\n"]]],[],null,["# Call REST Endpoint task\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nCall REST Endpoint task\n=======================\n\nThe **Call REST Endpoint** task lets you call any third-party REST\nAPI from your integration. The response from the REST API call will be available to\nyou in an integration variable and can be used in other down-stream tasks.\n| **Note:**\n|\n| - The network configuration of the **Call REST Endpoint** task allows it to call endpoints only available over the public internet. Hence, the task can't connect to hosts or IPs that reside only within a private network such as a VPC, even if that VPC is peered with your other Google Cloud services such as Apigee X.\n| - This task can process a maximum of 50 MB of REST response.\n\nBefore you begin\n----------------\n\n- To connect to an authentication endpoint for the REST API call, ensure that you have either [created\n an OAuth 2.0 profile](/application-integration/docs/configuring-auth-profile#createAuthProfile) or [attached a user-managed service account](/application-integration/docs/access-control#add-service-account) to your integration. If your API does not require authentication, then the **Authentication profile** field in the task configuration pane can be left empty. To see a list of configurations, see [Configuration properties](#params).\n\n If your integration has both OAuth 2.0 profile and a user-managed service account configured, then by default the OAuth 2.0 profile is used for authentication. If neither OAuth 2.0 profile nor user-managed service account is configured, then the execution fails.\n- If your integration has a service account attached, then based on the REST endpoint URL, grant the required IAM role to that service account. For example, if your REST endpoint URL calls a Cloud Storage service, then grant the required IAM role for the Cloud Storage service. For information about granting roles to a service account, see [Manage access to service accounts](/iam/docs/manage-access-service-accounts).\n\n- Ensure that [VPC Service Controls](/application-integration/docs/vpc-service-controls) is **NOT** setup for Application Integration in your Google Cloud project. **Warning:** **Cloud Function** does not function or stops functioning if [VPC Service Controls](/application-integration/docs/vpc-service-controls) is setup for Application Integration in your Google Cloud project.\n\nConfigure the Call REST Endpoint task\n-------------------------------------\n\nTo configure the **Call REST Endpoint** task:\n\n1. In the Google Cloud console, go to the **Application Integration** page.\n\n [Go to Application Integration](https://console.cloud.google.com/integrations)\n2. In the navigation menu, click **Integrations** .\n\n\n The **Integrations** page appears listing all the integrations available in the Google Cloud project.\n3. Select an existing integration or click **Create integration** to create a new one.\n\n\n If you are creating a new integration:\n 1. Enter a name and description in the **Create Integration** pane.\n 2. Select a region for the integration. **Note:** The **Regions** dropdown only lists the regions provisioned in your Google Cloud project. To provision a new region, click **Enable Region** . See [Enable new region](/application-integration/docs/enable-new-region) for more information.\n 3. Select a service account for the integration. You can change or update the service account details of an integration any time from the info **Integration summary** pane in the integration toolbar. **Note:** The option to select a service account is displayed only if you have enabled integration governance for the selected region.\n 4. Click **Create** . The newly created integration opens in the *integration editor*.\n\n\n4. In the *integration editor* navigation bar, click **Tasks** to view the list of available tasks and connectors.\n5. Click and place the **Call REST Endpoint** element in the integration editor.\n6. Click the **Call REST Endpoint** element on the designer to view the **Call REST Endpoint** task configuration pane.\n7. Configure the displayed fields using the [configuration properties](#params) of the task as detailed in the table below.\n\n\n Changes to the properties are saved automatically.\n | **Note:** If you update the authentication profile for a **Call REST Endpoint** task, and test the integration without publishing the changes, the integration uses the old authentication profile. To ensure that the integration uses the updated authentication profile, you must [publish the integration](https://cloud.google.com/application-integration/docs/test-publish-integrations) before testing.\n\nConfiguration properties\n------------------------\n\n\nThe following table describes the configuration properties of the **Call REST Endpoint** task.\n\nBest practices\n--------------\n\nFor information about the usage limits that apply to the **Call REST Endpoint** task, see [Usage limits](/application-integration/docs/quotas#usage-limits).\n\nError handling strategy\n-----------------------\n\n\nAn error handling strategy for a task specifies the action to take if the task fails due to a [temporary error](/application-integration/docs/error-handling). For information about how to use an error handling strategy, and to know about the different types of error handling strategies, see [Error handling strategies](/application-integration/docs/error-handling-strategy).\n\nTo learn how to handle retry strategies for `4xx` or `5xx` errors, see the [How to retry Rest Caller Task based on Response Status](https://www.googlecloudcommunity.com/gc/Integration-Services/How-to-retry-Rest-Caller-Task-based-on-Response-Status/m-p/618079) blog.\n\nQuotas and limits\n-----------------\n\nFor information about quotas and limits, see [Quotas and limits](/application-integration/docs/quotas).\n\nWhat's next\n-----------\n\n- Learn about [all tasks and triggers](/application-integration/docs/all-triggers-tasks).\n- Learn how to [test and publish an integration](/application-integration/docs/test-publish-integrations).\n- Learn about [error handling](/application-integration/docs/error-handling-strategy).\n- Learn about [integration execution logs](/application-integration/docs/introduction-logs)."]]