Call examples

Updated at: 2024-06-07 07:44

Function Compute API of the 2021-04-06 version and later versions comply with the Alibaba Cloud OpenAPI specifications. This allows you to view and call the API or an SDK in Alibaba Cloud OpenAPI Explorer. This topic describes how to call the API and an SDK of Function Compute in OpenAPI Explorer.

Before you start

Create a function

Call the API

  1. Log on to OpenAPI Explorer.

  2. Move the pointer over Cloud Products in the top navigation bar. Enter Function Compute in the search box and select Function Compute 3.0 from the search results.

  3. In the left-side navigation pane, choose Function > InvokeFunction.

  4. Specify the following parameters and click Initiate Call. After the call is complete, you can view the execution result on the Response tab.

    image

    Parameter

    Description

    Parameter

    Description

    Region

    The region in which the function that you want to invoke resides.

    X-Fc-Invocation-Type

    The function invocation mode. Valid values:

    • Sync: synchronous invocation

    • Async: asynchronous invocation

    functionName

    The name of the function.

Call an SDK

  1. Log on to OpenAPI Explorer.

  2. Move the pointer over Cloud Products in the top navigation bar. Enter Function Compute in the search box and select Function Compute 3.0 from the search results.

  3. In the left-side navigation pane, choose Function > InvokeFunction.

  4. Specify the following parameters and then select a programming language on the SDK Sample Code tab. The system automatically generates sample code. Click Example.

    image

    Parameter

    Description

    Parameter

    Description

    Region

    The region in which the function that you want to invoke resides.

    X-Fc-Invocation-Type

    The function invocation mode. Valid values:

    • Sync: synchronous invocation

    • Async: asynchronous invocation

    functionName

    The name of the function.

After the execution is complete, view the execution result in the Alibaba Cloud Cloud Shell section.

  • On this page (1, T)
  • Before you start
  • Call the API
  • Call an SDK
Feedback