La tâche Appeler un point de terminaison REST vous permet d'appeler n'importe quelle API REST tierce à partir de votre intégration. La réponse de l'appel d'API REST est disponible dans une variable d'intégration et peut être utilisée dans d'autres tâches en aval.
Avant de commencer
Pour vous connecter à un point de terminaison d'authentification pour l'appel d'API REST, assurez-vous d'avoir créé un profil OAuth 2.0 ou d'avoir associé un compte de service géré par l'utilisateur à votre intégration. Si votre API ne nécessite pas d'authentification, le champ de profil d'authentification du volet de configuration des tâches peut être vide. Pour afficher la liste des configurations, consultez la section Propriétés de configuration.
Si le profil OAuth 2.0 et un compte de service géré par l'utilisateur sont tous deux configurés pour votre intégration, le profil OAuth 2.0 est utilisé par défaut pour l'authentification. Lorsqu'aucun des deux n'est configuré, l'exécution échoue.
Si un compte de service est associé à votre intégration, attribuez le rôle IAM requis à ce compte de service en fonction de l'URL du point de terminaison REST. Par exemple, si votre URL de point de terminaison REST appelle un service Cloud Storage, attribuez le rôle IAM requis pour le service Cloud Storage.
Dans le menu de navigation, cliquez sur Intégrations.
La page Intégrations s'affiche et liste toutes les intégrations disponibles dans le projet Google Cloud.
Sélectionnez une intégration existante ou cliquez sur Créer une intégration pour en créer une.
Si vous créez une intégration :
Saisissez un nom et une description dans le volet Créer une intégration.
Sélectionnez une région pour l'intégration.
Sélectionnez un compte de service pour l'intégration. Vous pouvez modifier ou mettre à jour les informations du compte de service d'une intégration à tout moment depuis le volet infoRésumé de l'intégration de la barre d'outils d'intégration.
Cliquez sur Créer. L'intégration que vous venez de créer s'ouvre dans l'éditeur d'intégration.
Dans la barre de navigation de l'éditeur d'intégrations, cliquez sur Tâches pour afficher la liste des tâches et des connecteurs disponibles.
Cliquez sur l'élément Appeler un point de terminaison REST et placez-le dans l'éditeur d'intégration.
Cliquez sur l'élément Call REST Endpoint dans l'éditeur pour ouvrir le volet de configuration de la tâche Call REST Endpoint (Appeler un point de terminaison REST).
Configurez les champs affichés à l'aide des propriétés de configuration de la tâche, comme indiqué dans le tableau ci-dessous.
Les modifications que vous avez apportées aux propriétés sont enregistrées automatiquement.
Propriétés de configuration
Le tableau suivant décrit les propriétés de configuration de la tâche Call REST Endpoint (Appeler un point de terminaison REST).
Endpoint base URL (URL de base du point de terminaison)
Chaîne
URL du point de terminaison REST sans les paramètres de requête.
Méthode HTTP
N/A
Méthode HTTP à utiliser.
Vous pouvez sélectionner l'une des méthodes HTTP suivantes :
DELETE
GET
HEAD
PATCH
POST
PUT
URL query string parameters (paramètres de la chaîne de requête de l'URL)
Clé de la chaîne de requête : Chaîne
Valeur : Chaîne
Paramètres de requête requis pour l'appel de l'API REST.
Les paramètres de requête se présentent sous la forme de paires clé/valeur, où la clé correspond au nom de la clé et la valeur est la valeur de clé correspondante. Vous pouvez saisir plusieurs paires clé-valeur en cliquant sur l'icône plus.
En-têtes HTTP
Clé d'en-tête HTTP : Chaîne
Valeur : Chaîne
En-têtes HTTP requis pour l'appel de l'API REST.
Les en-têtes HTTP se présentent sous la forme de paires clé/valeur, où la clé correspond au nom de la clé et la valeur est la valeur de clé correspondante. Vous pouvez saisir plusieurs paires clé-valeur en cliquant sur l'icône plus.
Suivre les redirections
Booléen
Suit les redirections d'URL.
Vous pouvez sélectionner l'une des valeurs suivantes :
True : appelle l'URL redirigée si l'URL de base du point de terminaison est transférée à une autre URL.
False : n'appelle pas l'URL redirigée si l'URL de base du point de terminaison est transférée à une autre URL.
La tâche doit échouer en cas d'erreur HTTP
Booléen
Stratégie de traitement des exceptions en cas d'échec de l'appel d'API REST.
La tâche d'appel de point de terminaison REST échoue si le code de réponse HTTP est 4xx ou 5xx. Pour obtenir la liste des codes d'erreur, consultez la section Codes d'erreur. Pour les autres codes de réponse HTTP, renvoyez le code d'erreur et le message d'erreur dans la réponse.
Vous pouvez sélectionner l'une des valeurs suivantes :
True : génère une exception.
False : ne génère pas d'exception. Cependant, renvoie le code d'erreur et le message d'erreur dans la réponse.
En-tête de réponse (<Nom de la tâche>)
String
En-tête de réponse non compressé de la réponse des API REST.
Corps de la réponse (<Nom de la tâche>)
String
Corps de réponse non compressé de la réponse des API REST.
État de la réponse (<Nom de la tâche>)
String
Code de réponse HTTP et texte de code correspondant de la réponse des API REST.
Bonnes pratiques
Pour en savoir plus sur les limites d'utilisation qui s'appliquent à la tâche Appeler le point de terminaison REST, consultez la section Limites d'utilisation.
Stratégie de traitement des erreurs
Une stratégie de traitement des erreurs d'une tâche spécifie l'action à effectuer si celle-ci échoue en raison d'une erreur temporaire. Pour en savoir plus sur l'utilisation et les différents types de stratégies de traitement des erreurs, consultez la page Stratégies de traitement des erreurs.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/03 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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)."]]