Help Center/ ModelArts/ API Reference/ App Authentication Management/ Canceling the Authorization of an API to an App
Updated on 2024-05-30 GMT+08:00

Canceling the Authorization of an API to an App

Function

This API is used to cancel the authorization of a specified API to an app. The request user must have the update permission on the service to which the API belongs.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

DELETE /v1/{project_id}/services/{service_id}/app-auth-apis/{api_id}/app-auth-api

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

service_id

Yes

String

ID of the service to which the API belongs

api_id

Yes

String

API ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

workspace_id

No

String

Workspace ID.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

apps

Yes

Array of Apps objects

App list

workspace_id

No

String

Workspace ID.

Table 5 Apps

Parameter

Mandatory

Type

Description

app_id

No

String

App ID, which can be obtained by querying apps

Response Parameters

Status code: 200

Table 6 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID

Table 7 Response body parameters

Parameter

Type

Description

unauth_result

Array of AppAuthResultInfo objects

Authorization cancellation result

Table 8 AppAuthResultInfo

Parameter

Type

Description

api_id

String

API ID

app_id

String

App ID, which can be obtained by querying apps

auth_id

String

Authorization ID, which is empty if the authorization fails

reason

String

Authorization or authorization cancellation failure reason, which is empty if the authorization is successful

success

Boolean

Whether authorization or authorization cancellation is successful

Status code: 401

Table 9 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error codes of ModelArts.

error_msg

String

Error message.

Status code: 403

Table 11 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Link trace ID

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error codes of ModelArts.

error_msg

String

Error message.

Example Requests

Canceling the authorization of a specified API to an App

DELETE https://{endpoint}/v1/{project_id}/services/{service_id}/app-auth-apis/{api_id}/app-auth-api

{
  "apps" : [ {
    "app_id" : "fb1a9eadd87b48abbd74b8ba1755dffd"
  } ]
}

Example Responses

Status code: 200

OK

{
  "unauth_result" : [ {
    "api_id" : "logic-api-fe84e858-49ec-41c6-80d7-a34fc22435c2",
    "app_id" : "logic-app-9b9acb40-6df6-4623-9f87-e0dae781d867",
    "success" : true
  } ]
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

Error Codes

See Error Codes.