This topic describes how to authorize access to an API, view the APIs that you are authorized to access, and view the APIs that you authorize others to access.

Prerequisites

APIs are published. You can unpublish, authorize access to, or change the protocols of APIs only after the APIs are published. For more information, see Publish an API.

Go to the Manage APIs page

  1. Log on to the DataWorks console.
  2. In the left-side navigation pane, click Workspaces.
  3. In the top navigation bar, select the region where the target workspace resides. Find the target workspace and click DataService Studio in the Actions column.
  4. On the Service Development tab, click Service Management in the upper-right corner. The Manage APIs page appears by default.
    Service Management button

Authorize access to an API

  1. On the APIs of Published tab, find the target API and click Authorize in the Actions column.
  2. In the API Authorization dialog box, set the parameters as required.
    API Authorization dialog box
    Parameter Description
    API Name The name of the API that you want to authorize others to access. You cannot change the value.
    Tenant Account ID The ID of the Alibaba Cloud account to which you want to grant the permission to call the API. The owner of the Alibaba Cloud account can view the account ID on the Security Settings page in .
    Authorized Workspace The name of the workspace to which you want to grant the permission to call the API.
    Validity Period The validity period of the permission to call the API. Valid values:
    • Limited: specifies that the authorized user has the permission to call the API before the specified expiration date.
    • Unlimited: specifies that the authorized user can permanently call the API.
  3. Click OK.
    On the APIs of Published tab, you can also perform the following operations:
    • Find the target API and click Unpublish in the Actions column. In the Unpublish API message, click OK to unpublish the API.
      Note
      • If you unpublish or delete an API after you authorize access of a specified workspace to the API, the API can no longer be called in the workspace.
      • If you publish an API again after you unpublish or modify the API, you must authorize access to the API again.
    • Find the target API and click Test in the Actions column to test the API on the Test APIs page. For more information, see Test an API.
    • Find the target API, move the pointer over More in the Actions column, and then click Change Protocol. In the Change Protocol dialog box, change the protocol used by the API and click OK.
      Note
      • If you deselect a protocol, the API can no longer be called by using this protocol. Use caution when you change the protocol for an API.
      • The protocol change takes effect in real time.

View the APIs that you are authorized to access

On the Manage APIs page, click the Authorized to Use tab to view the APIs that you are authorized to access.

You can perform the following operations on the APIs that you are authorized to access:
  • Find the target API and click Test in the Actions column to test the API on the Test APIs page. For more information, see Test an API.
  • Find the target API and click Delete in the Actions column. In the Delete authorized message, click OK to revoke your permission on the API.

View the APIs that you authorize others to access

On the Manage APIs page, click the Authorize Others to Use tab to view the APIs that you authorize others to access.

You can perform the following operations on the APIs that you authorize others to access:
  • Find the target API and click Test in the Actions column to test the API on the Test APIs page. For more information, see Test an API.
  • Find the target API and click Manage in the Actions column. In the Authorization dialog box, revoke or modify the permission of a workspace on the API.