Invocation examples

更新时间: 2026-06-04 00:05:28

Function Compute APIs released on or after 2021-04-06 are compliant with the Alibaba Cloud OpenAPI specification. You can use OpenAPI Explorer to explore and debug APIs and SDKs. This topic describes how to use OpenAPI Explorer to invoke Function Compute APIs and generate SDK sample code.

Prerequisites

Create a function

Invoke API

  1. Log on to OpenAPI Explorer.

  2. In the top navigation bar, click Cloud Products. In the search box, enter Function Compute, and then select Function Compute 3.0 from the search results.

  3. In the left-side navigation pane, find InvokeFunction.

  4. Configure the following parameters and click Initiate Call. The result appears on the Response tab.

    For a successful asynchronous invocation, the Response tab displays a status code of 202, which means the request was accepted.

    The following table describes the parameters.

    Parameter

    Description

    Region

    The region where the function is located.

    X-Fc-Invocation-Type

    The invocation type of the function. Valid values:

    • Sync: Synchronous invocation.

    • Async: Asynchronous invocation.

    functionName

    The name of the function.

Invoke SDK

  1. Log on to OpenAPI Explorer.

  2. In the top navigation bar, click Cloud Products. In the search box, enter Function Compute, and then select Function Compute 3.0 from the search results.

  3. In the left-side navigation pane, find InvokeFunction.

  4. Configure the required parameters, select a programming language on the SDK Sample Code tab to generate the sample code, and then click Run Example.

    The following table describes the parameters.

    Parameter

    Description

    Region

    The region where the function is located.

    X-Fc-Invocation-Type

    The invocation type of the function. Valid values:

    • Sync: Synchronous invocation.

    • Async: Asynchronous invocation.

    functionName

    The name of the function.

The result appears in the Alibaba Cloud Cloud Shell section below.

上一篇: Use an HTTP trigger to invoke a function 下一篇: Configure a retry mechanism
阿里云首页 函数计算 相关技术圈