Informationen zum Einstieg in API-Trigger finden Sie im Tutorial zur API-Auftragsausführung. In der Anleitung wird gezeigt, wie Sie eine Integration mit einem API-Trigger erstellen, der API-Anfragen zum Abrufen von Kundeninformationen empfängt.
API-Trigger hinzufügen
So fügen Sie Ihrer Integration einen API-Trigger hinzu:
Rufen Sie in der Google Cloud Console die Seite Application Integration auf.
Die Seite Liste der Integrationen wird angezeigt. Auf dieser Seite sind alle Integrationen aufgeführt, die im Google Cloud-Projekt verfügbar sind.
Wählen Sie eine vorhandene Integration aus oder klicken Sie auf Integration erstellen, um eine neue zu erstellen.
Wenn Sie eine neue Integration erstellen, gehen Sie so vor:
Geben Sie im Bereich Integration erstellen einen Namen und eine Beschreibung ein.
Wählen Sie eine Region für die Integration aus.
Wählen Sie ein Dienstkonto für die Integration aus. Sie können die Details des Dienstkontos einer Integration jederzeit im Bereich infoIntegrationsübersicht in der Symbolleiste für Integrationen ändern oder aktualisieren.
Klicken Sie auf Erstellen.
Die neu erstellte Integration wird im Integrationseditor geöffnet.
Klicken Sie in der Navigationsleiste des Integrationseditors auf Trigger, um eine Liste der verfügbaren Trigger aufzurufen.
Klicken Sie auf das Element API-Trigger und platzieren Sie es im Designer.
API-Trigger konfigurieren
Klicken Sie im Integrationseditor auf das Element API-Trigger, um einen API-Trigger zu konfigurieren. Der Bereich „API-Trigger-Konfiguration“ wird angezeigt. Er enthält die folgenden Felder:
Label:Der sichtbare Name des API-Triggers in Ihrer Integration. Sie können das Label in einen beliebigen Namen ändern.
Hinweise:Sie können dem API-Trigger Notizen hinzufügen, um zusätzliche Informationen dazu anzugeben.
Trigger-ID:Eine eindeutige ID, die dem API-Trigger im Format api_trigger/TRIGGER_NAME zugewiesen ist.
Eingabevariablen:Triggerspezifische Eingabevariablen, mit denen Sie die Anfragenutzlast für den API-Trigger festlegen können.
Wenn Sie dem API-Trigger vorhandene Integrationsvariablen hinzufügen oder daraus entfernen möchten, klicken Sie auf Ändern und wählen Sie die erforderlichen Variablen im Bereich API-Trigger-Eingabevariablen aus.
Wenn Sie eine neue Variable speziell für den ausgewählten API-Trigger hinzufügen möchten, klicken Sie auf Ändern und wählen Sie im Bereich API-Trigger-Eingabevariablen die Option + Neue Variable hinzufügen aus. Informationen zu den unterstützten Datentypen finden Sie unter Unterstützte Variablendatentypen.
Ausgabevariablen:Triggerspezifische Ausgabevariablen, mit denen Sie die Antwortnutzlast für den API-Trigger festlegen können.
Wenn Sie dem API-Trigger vorhandene Integrationsvariablen hinzufügen oder daraus entfernen möchten, klicken Sie auf Ändern und wählen Sie die erforderlichen Variablen im Bereich API-Trigger-Ausgabevariablen aus.
Wenn Sie eine neue Variable speziell für den ausgewählten API-Trigger hinzufügen möchten, klicken Sie auf Ändern und wählen Sie im Bereich API-Trigger-Ausgabevariablen die Option + Neue Variable hinzufügen aus. Informationen zu den unterstützten Datentypen finden Sie unter Unterstützte Variablendatentypen.
OpenAPI-Spezifikation für Ihren API-Trigger aufrufen
Mit der Anwendungsintegration können Sie die OpenAPI-Spezifikationen Ihrer veröffentlichten Integrationen, die mit einem oder mehreren API-Triggern konfiguriert sind, dynamisch generieren und aufrufen. Informationen zum Aufrufen der OpenAPI-Spezifikation finden Sie unter OpenAPI-Spezifikation für Ihre Integration aufrufen.
API-Trigger über einen API-Aufruf aufrufen
Nachdem Sie eine Integration veröffentlicht haben, für die ein API-Trigger konfiguriert ist, können Sie diesen Trigger mit der Methode projects.locations.integrations.execute von jeder Anwendung aus aufrufen. Mit dieser Methode wird die Ausführung im synchronen Modus ausgelöst.
Bei Verwendung des API-Triggers darf die kumulative Größe aller Eingabevariablen maximal 8 MB betragen. Wenn die Größe 8 MB überschreitet, führt Application Integration die Integration nicht aus und Sie erhalten einen Fehler.
Kontingente und Limits
Weitere Informationen zu allen Kontingenten und Limits finden Sie unter Kontingente und Limits.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (UTC)."],[[["\u003cp\u003eAPI triggers allow direct invocation of integration executions, enabling you to set request and response payloads via trigger-specific variables.\u003c/p\u003e\n"],["\u003cp\u003eYou can generate and view an OpenAPI Specification (OAS) for your integration when using an API trigger.\u003c/p\u003e\n"],["\u003cp\u003eAPI triggers can be invoked either synchronously or asynchronously, offering flexibility in how integrations are executed.\u003c/p\u003e\n"],["\u003cp\u003eEach API trigger is assigned a unique Trigger ID and supports customizable input and output variables for managing request and response data.\u003c/p\u003e\n"],["\u003cp\u003eAfter publishing an integration with an API trigger, you can invoke it using the \u003ccode\u003eprojects.locations.integrations.execute\u003c/code\u003e method, enabling triggering from any application, with the cumulative size of all input variables limited to 8 MB.\u003c/p\u003e\n"]]],[],null,["# API trigger\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nAPI trigger\n===========\n\nAPI triggers are used to directly invoke executions for integrations.\n\nConfiguring an API trigger in your integration enables you to do the following:\n\n- Set request and response payload using trigger specific input and output variables.\n- [Generate and view the OpenAPI Specification (OAS)](#view-openapi-spec) for your integration.\n- Invoke an integration [synchronously](/application-integration/docs/error-handling-strategy#synchronous-and-asynchronous-error-handling) or [asynchronously](/application-integration/docs/error-handling-strategy#synchronous-and-asynchronous-error-handling).\n\nTo help you get started with API triggers, see the [API fulfillment](/application-integration/docs/api-fulfilment) tutorial. The tutorial shows you how to create an integration with an API trigger that receives API requests for retrieving customer information.\n\n\u003cbr /\u003e\n\nAdd an API trigger\n------------------\n\nTo add an **API trigger** to your integration, perform the following steps:\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 List** 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**.\n\n\n The newly created integration opens in the *integration editor*.\n4. In the *integration editor* navigation bar, click **Triggers** to view the list of available triggers.\n5. Click and place the **API trigger** element to the designer.\n\nConfigure an API trigger\n------------------------\n\nTo configure an API trigger, click the **API trigger** element in the integration editor. The API trigger configuration pane appears showing the following fields:\n\n- **Label:** The visible name of the API trigger in your integration. You can change the label to a name of your choice.\n- **Notes:** You can add notes to the API trigger to provide additional information about the trigger.\n- **Trigger ID:** A unique ID that is assigned to the API trigger in the format `api_trigger/`\u003cvar translate=\"no\"\u003eTRIGGER_NAME\u003c/var\u003e. **Note** : You can have more than one API trigger in your integration. Each API trigger is assigned a unique **Trigger ID**.\n- **Input variables:** Trigger specific input variables that you can use to set the request payload for the API trigger.\n - To add or remove existing integration variables to the API trigger, click **Modify** and select the required variables from the **API trigger input variables** pane.\n - To add a new variable, specifically for the selected API trigger, click **Modify** and select **+ Add new variable** from the **API trigger input variables** pane. For information about the supported data types, see [Supported variable data types](/application-integration/docs/variables#datatype).\n- **Output variables:** Trigger specific output variables that you can use to set the response payload for the API trigger.\n - To add or remove existing integration variables to the API trigger, click **Modify** and select the required variables from the **API trigger output variables** pane.\n - To add a new variable, specifically for the selected API trigger, click **Modify** and select **+ Add new variable** from the **API trigger output variables** pane. For information about the supported data types, see [Supported variable data types](/application-integration/docs/variables#datatype).\n| **Note** : You can create input and output variables from both the [Variables pane](/application-integration/docs/variables#create-a-variable) and the API trigger configuration pane.\n|\n| - Application Integration automatically adds variables created from the API trigger configuration pane to that specific trigger as input or output variables.\n| - You can manually add variables from one API trigger to another as input or output variables.\n| - By default, all elements in your integration can access variables created from the Variables pane.\n| - Changing the **Variable type** of a variable affects all the elements in your integration that use that variable.\n\nView OpenAPI Specification for your API trigger\n-----------------------------------------------\n\nApplication Integration provides the ability to dynamically generate and view the OpenAPI Specifications of your published integrations that are configured with one or more API triggers. For information about how to view the OpenAPI Specification, see [View OpenAPI Specification for your integration](/application-integration/docs/view-openapi-spec).\n\nInvoke an API trigger using an API call\n---------------------------------------\n\nAfter you have published an integration that has an **API trigger** configured, you can use the [`projects.locations.integrations.execute`](/application-integration/docs/reference/rest/v1/projects.locations.integrations/execute) method to invoke that trigger from any application. This method triggers the execution in the [synchronous mode](/application-integration/docs/error-handling#error-handling-methods).\n\n### Syntax\n\n```\ncurl -X POST \\\n -H \"authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Server-Timeout: TIMEOUT_SECONDS\" \\\n -d '{\"trigger_id\":\"api_trigger/TRIGGER_NAME\"}' \\\n \"https://LOCATION-integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/-:execute\"\n```\n\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eTIMEOUT_SECONDS\u003c/var\u003e: The timeout in seconds for the API call. By default, the timeout is 120 seconds. For a list of pre-defined set of request parameters, see [System parameters](/apis/docs/system-parameters).\n- \u003cvar translate=\"no\"\u003eTRIGGER_NAME\u003c/var\u003e: The name of the **API trigger** in your integration.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The location of your Google Cloud project.\n\n### Example\n\nThe following example invokes an integration in `us-east1` region containing the `test_API_1` API trigger in the `demo-project` Google Cloud project: \n\n```\ncurl -X POST \\\n -H \"authorization: Bearer $(gcloud auth print-access-token)\"\n -H \"Content-Type: application/json\" \\\n -H \"X-Server-Timeout: 300\"\n -d '{\"trigger_id\":\"api_trigger/test_API_1\"}' \\\n \"https://us-east1-integrations.googleapis.com/v1/projects/demo-project/locations/us-central1/integrations/-:execute\"\n```\n\nConsiderations\n--------------\n\nWhen using the API trigger, the cumulative size of all the input variables can\nbe a maximum of 8 MB. If the size exceeds 8 MB, Application Integration doesn't run the\nintegration and you will get an error.\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\n- Learn about [error handling](/application-integration/docs/error-handling-strategy).\n- Learn about [integration execution logs](/application-integration/docs/introduction-logs)."]]