Updated on 2022-09-23 GMT+08:00

Debugging an API

Scenarios

You can debug an API on the management console by adding HTTP header parameters and body parameters.

  • APIs whose backend paths contain environment variables cannot be debugged.
  • APIs bound to a signature key cannot be debugged.
  • If a request throttling policy has been bound to an API, the policy does not take effect when you debug the API.

Prerequisites

  • An API has been created.
  • The backend service has been set up.

Procedure

  1. On the DataArts Studio console, locate an instance and click Access. On the displayed page, locate a workspace and click DataArts DataService.
  1. In the left navigation pane, choose an edition, for example, Exclusive Edition. The Overview page is displayed.
  2. Choose API Development > APIs.
  3. Use either of the following methods to debug an API:
    • Locate the row that contains the target API, and choose More > Debug.
    • Click the name of the target API, and click Test on the displayed API details page.

      You can configure API request parameters in the left pane. See Table 1 for parameter details. The request information sent by the API and the returned result after the API request is invoked are displayed on the right.

      Table 1 Debugging APIs

      Parameter

      Description

      Parameters

      Query parameters and their values.

      Cluster Settings

      Supported only by Exclusive Edition. Select the instance where the API to be debugged resides.

      The information displayed on the debugging page varies according to the request type.

  4. After request parameters are added, click Debug.

    The API calling response information is displayed in the command output area in the right pane.

    • If the API is successfully called, HTTP status code 200 and response information are returned.
    • If the debugging fails, the HTTP status code 4xx or 5xx is returned.
  5. You can send different requests using varied parameters and values to verify the API.

    To modify the API parameters, click Edit in the upper right corner. The API editing page is displayed.

Follow-up Procedures

After an API is debugged, you can publish the API. See Publishing an API for details.