[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThe IntegrationCallout policy, applicable to Apigee and Apigee hybrid, allows running an Application Integration with an API trigger within an API proxy flow, but requires the SetIntegrationRequest policy to first create a necessary request object.\u003c/p\u003e\n"],["\u003cp\u003eThis policy is an Extensible policy which has potential cost or utilization implications depending on your license.\u003c/p\u003e\n"],["\u003cp\u003eThe IntegrationCallout policy needs a service account with the required IAM roles for authentication, although it doesn't have an explicit \u003ccode\u003eAuthentication\u003c/code\u003e element in its definition.\u003c/p\u003e\n"],["\u003cp\u003eThe policy can run integrations either synchronously, with a 2-minute execution limit, or asynchronously, allowing up to 50 minutes for completion.\u003c/p\u003e\n"],["\u003cp\u003eThe IntegrationCallout policy utilizes \u003ccode\u003e<Request>\u003c/code\u003e and \u003ccode\u003e<Response>\u003c/code\u003e elements to manage the integration request and store the response in specified flow variables, and common errors include issues with variable resolution, service account permissions, and request object configuration.\u003c/p\u003e\n"]]],[],null,["# IntegrationCallout policy\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nOverview\n--------\n\nThe IntegrationCallout policy lets you run an Application Integration that has an API\ntrigger. However, before running an integration, you must run the\n[SetIntegrationRequest policy](/apigee/docs/api-platform/reference/policies/set-integration-request-policy).\nThe SetIntegrationRequest policy creates a request object and makes the object\navailable to the IntegrationCallout policy as a flow variable. The request object has the\nintegration details such as the API trigger name, integration project ID, integration name,\nand other details configured in the SetIntegrationRequest policy. The IntegrationCallout\npolicy uses the flow variable of the request object to run the integration. You can configure\nthe IntegrationCallout policy to save the integration run response in a flow variable.\n\nThe IntegrationCallout policy is helpful if you want to run integration in the middle of your\nproxy flow. Alternately, instead of configuring the IntegrationCallout policy,\nyou can also run an integration by specifying an integration endpoint as your target\nendpoint. For more information, see [IntegrationEndpoint](/apigee/docs/api-platform/reference/api-proxy-configuration-reference#integrationendpoint).\n\nThis policy is an *Extensible policy* and use of this policy might have cost or\nutilization implications, depending on your Apigee license. For information on policy types\nand usage implications, see\n[Policy types](/apigee/docs/api-platform/reference/policies/reference-overview-policy#policy-types).\n| **Note** : You need an authentication token to run the IntegrationCallout policy. However, there is no explicit `Authentication` element in the policy definition. Apigee adds an authentication token to the request under the hood. For the IntegrationCallout policy to successfully authenticate, you must deploy your API proxy with a service account that has the required IAM roles to run an integration. For information about the required roles, see [IAM roles for integrations](/application-integration/docs/predefined-iam-roles-permissions). For more details on deploying an API proxy, see [Deploy on Apigee](/apigee/docs/api-platform/security/google-auth/overview#deploy-on-apigee-x).\n\n`\u003cIntegrationCallout\u003e`\n----------------------\n\nSpecifies the IntegrationCallout policy.\n\nThe following table provides a high-level description of the child elements of [`\u003cIntegrationCallout\u003e`](/apigee/docs/api-platform/reference/policies/integration-callout-policy#integrationcallout):\n\nThe `\u003cIntegrationCallout\u003e` element uses the following syntax: \n\n### Syntax\n\n```gdscript\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?\u003e\n\u003cIntegrationCallout continueOnError=\"[true|false]\" enabled=\"[true|false]\" name=POLICY_NAME\u003e\n \u003cDisplayName\u003e\u003cvar translate=\"no\"\u003ePOLICY_DISPLAY_NAME\u003c/var\u003e\u003c/DisplayName\u003e\n \u003cAsyncExecution\u003e\u003cvar translate=\"no\"\u003eBOOLEAN_ASYNC_EXECUTION\u003c/var\u003e\u003c/AsyncExecution\u003e\n \u003cRequest clearPayload=\"[true|false]\"\u003eREQUEST_FLOW_VARIABLE_NAME\u003c/Request\u003e\n \u003cResponse\u003e\u003cvar translate=\"no\"\u003eRESPONSE_FLOW_VARIABLE_NAME\u003c/var\u003e\u003c/Response\u003e\n\u003c/IntegrationCallout\u003e\n```\n\n### Example\n\nThe following example shows the IntegrationCallout policy definition: \n\n```gdscript\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?\u003e\n\u003cIntegrationCallout continueOnError=\"false\" enabled=\"true\" name=\"Integration-Callout\"\u003e\n \u003cDisplayName\u003eIntegration-Callout-1\u003c/DisplayName\u003e\n \u003cAsyncExecution\u003etrue\u003c/AsyncExecution\u003e\n \u003cRequest clearPayload=\"true\"\u003emy_request_flow_var\u003c/Request\u003e\n \u003cResponse\u003emy_response_flow_var\u003c/Response\u003e\n\u003c/IntegrationCallout\u003e\n```\n\nThis element has the following attributes that are common to all policies:\n\nChild element reference\n-----------------------\n\nThis section describes the child elements of [`\u003cIntegrationCallout\u003e`](/apigee/docs/api-platform/reference/policies/integration-callout-policy#integrationcallout).\n\n### `\u003cDisplayName\u003e`\n\nUse in addition to the `name` attribute to label the policy in the\nmanagement UI proxy editor with a different, more natural-sounding name.\n\nThe `\u003cDisplayName\u003e` element is common to all policies.\n\nThe `\u003cDisplayName\u003e` element uses the following syntax: \n\n### Syntax\n\n```scdoc\n\u003cPolicyElement\u003e\n \u003cDisplayName\u003e\u003cvar translate=\"no\"\u003ePOLICY_DISPLAY_NAME\u003c/var\u003e\u003c/DisplayName\u003e\n ...\n\u003c/PolicyElement\u003e\n```\n\n### Example\n\n```text\n\u003cPolicyElement\u003e\n \u003cDisplayName\u003eMy Validation Policy\u003c/DisplayName\u003e\n\u003c/PolicyElement\u003e\n```\n\nThe `\u003cDisplayName\u003e` element has no attributes or child elements.\n\n### `\u003cAsyncExecution\u003e`\n\nSpecifies the mode to run the integration. You can run the integration either\nsynchronously or asynchronously.\n\nIf set to `true`, the integration runs asynchronously. And if set to\n`false`, the integration runs synchronously.\n\n- **Asynchronous mode** : When the request to run the integration reaches the endpoint, the endpoint immediately returns the integration execution IDs, but starts the execution of integration at the time specified by the `\u003cScheduleTime\u003e` element. If you have not set the `\u003cScheduleTime\u003e` element, the integration is scheduled to run immediately. Even though the integration is scheduled to run immediately, its execution may start after a few seconds. When the integration starts to execute, the following two things happen:\n - The integration returns the HTTP `200 OK` status code so that the caller can continue processing.\n - The IntegrationCallout policy completes.\n Once started, the integration will have a maximum time limit of 50 minutes to complete the execution.\n- **Synchronous mode**: When the request to run the integration reaches the endpoint, the endpoint immediately starts the execution of the integration and waits for the response. The maximum time limit to complete the execution is 2 minutes. After finishing the execution, the endpoint returns a response with the execution IDs and other response data.\n\nThe `\u003cAsyncExecution\u003e` element uses the following syntax: \n\n#### Syntax\n\n```text\n\u003cAsyncExecution\u003eBOOLEAN\u003c/AsyncExecution\u003e\n```\n\n#### Example\n\nThe following example sets asynchronous execution to `true`: \n\n```text\n\u003cAsyncExecution\u003etrue\u003c/AsyncExecution\u003e\n```\n\n### `\u003cRequest\u003e`\n\nSpecifies the flow variable having the request object created by the SetIntegrationRequest policy.\nThe IntegrationCallout policy sends this request object to Application Integration for running the integration.\n\nThe `\u003cRequest\u003e` element uses the following syntax: \n\n#### Syntax\n\n```gdscript\n\u003cRequest clearPayload=\"true\"\u003eFLOW_VARIABLE_NAME\u003c/Request\u003e\n```\n\n#### Example\n\nThe following example specifies that the request object is available in the\n`my_request_flow_var` flow variable: \n\n```gdscript\n\u003cRequest clearPayload=\"true\"\u003emy_request_flow_var\u003c/Request\u003e\n```\n\nThe following table describes the attributes of `\u003cRequest\u003e`:\n\n### `\u003cResponse\u003e`\n\nSpecifies the flow variable for saving the integration's response.\n\nIf you don't specify this element, the policy saves the response in the\n`integration.response` flow variable.\n\nThe output of the integration can be accessed by `integration.response.content` or `flow_variable.content`. The `\u003cResponse\u003e` element uses the following syntax: \n\n#### Syntax\n\n```scdoc\n\u003cResponse\u003eFLOW_VARIABLE_NAME\u003c/Response\u003e\n```\n\n#### Example\n\nThe following example saves the response of the integration run in the\n`my_response_flow_var` flow variable: \n\n```gdscript\n\u003cResponse\u003emy_response_flow_var\u003c/Response\u003e\n```\n\nError codes\n-----------\n\nThis section describes the fault codes, error messages, and the fault variables\nset by Apigee when this policy triggers an error. This information is essential if you are developing fault rules to\nhandle faults. To learn more, see [What you need to know\nabout policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors) and [Handling\nfaults](/apigee/docs/api-platform/fundamentals/fault-handling).\n\n### Runtime errors\n\nThese errors can occur when the policy executes.\n\n### Fault variables\n\nWhenever there are execution errors in a policy, Apigee generates error messages. You can view\nthese error messages in the error response. Many a time, system generated error messages might not be relevant\nin the context of your product. You might want to customize the error messages based on the\ntype of error to make the messages more meaningful.\n\nTo customize the error messages, you can use either fault rules or the RaiseFault policy. For\ninformation about differences between fault rules and the RaiseFault policy, see\n[FaultRules vs. the RaiseFault policy](/apigee/docs/api-platform/fundamentals/fault-handling#rulesvraisefault).\nYou must check for conditions using the `Condition` element in both the fault rules and the RaiseFault policy.\nApigee provides fault variables unique to each policy and the values of the fault variables are set when a policy triggers runtime errors.\nBy using these variables, you can check for specific error conditions and take appropriate actions. For more information about checking error\nconditions, see [Building conditions](/apigee/docs/api-platform/fundamentals/fault-handling#buildingconditions).\n\nThe following table describes the fault variables specific to this policy.\n\nFor more information about policy errors, see [What you\nneed to know about policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors).\n\nRelated topics\n--------------\n\nIf you want to learn more about Application Integration feature, see\n[Application Integration overview](/application-integration/docs/overview)"]]