Help Center/ DataArts Studio/ API Reference/ Data Lake Mall APIs/ API Management/ Performing API Authorization Operations
Updated on 2022-09-15 GMT+08:00

Performing API Authorization Operations

Description

  • Authorizing an API to an app: The API reviewer can initiate a request to authorize an API. After the authorization is successful, the app can access the API within the validity period. API authorization includes authorization and renewal.
    • Authorization: The authorized app can access the API within the validity period.
    • Renewal: You can extend the validity period.
  • Canceling API authorization (by the API reviewer): The API reviewer can initiate a request to cancel API authorization to an app. After the API authorization is canceled, the app can no longer call the API. Before performing this operation, reserve at least two days for the app to make preparations.
  • Canceling API authorization (by the app owner): The app owner can initiate a request to cancel API authorization to an app. After the API authorization is canceled, the app can no longer call the API. This operation requires no preparation time.
  • Applying for authorization: The app owner can initiate a request to access an API. After the request is approved by the API reviewer, the app can access the API within the validity period.
  • Renewing the validity period: The app owner can initiate a renewal request for extending the validity period. After the request is approved by the API reviewer, the validity period will be updated.
  • A request for authorizing or renewing your own API does not need to be reviewed.
  • If you want to cancel API authorization to your own app, you are advised to initiate a request from your app, rather than have the API reviewer initiate a request. In this way, you do not need to reserve preparation time.

URL

  • URI format

    POST /v1/{project_id}/service/apis/authorize/action

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

Request Message

  • Example request
    {
      "api_id": "47046fe7830c1be77cb0dc23bd86afa5",
      "instance_id": "APIG",
      "app_id": "908489209a320df61607355c57c82882",
      "apply_type": "APPLY_TYPE_AUTHORIZE",
      "time": "2021-01-01T10:00:00.000Z"
    }
  • Request parameter description

Parameter

Mandatory

Type

Description

api_id

Yes

String

API ID

instance_id

Yes

String

Cluster ID

app_id

Yes

String

App ID

apply_type

Yes

String

Operation type. Available values include:

APPLY_TYPE_AUTHORIZE: authorizing an API to an app

APPLY_TYPE_API_CANCEL_AUTHORIZE: canceling API authorization (by the API reviewer)

APPLY_TYPE_APP_CANCEL_AUTHORIZE: canceling API authorization (by the app owner)

APPLY_TYPE_APPLY: applying for authorization

APPLY_TYPE_RENEW: renewing the validity period

time

No

String

End time. The value is in ISO format (+0 time zone) and is accurate to hour. This parameter is not required for canceling API authorization (by the app owner).

Response

  • Example response

    None

Status Code

Status Code

Description

204

The API operation is successful.

For details about status codes, see Status Codes.