Updated on 2025-11-27 GMT+08:00

Querying APIs and Apps

Function

This API is used to query information about APIs and apps authorized by a service.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer. Obtain its CLI example hcloud ModelArts GetServiceAppAuthApiAuthInfo.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v1/{project_id}/services/{service_id}/api-auths

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

service_id

Yes

String

Service ID

project_id

Yes

String

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

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

workspace_id

No

String

Definition: Workspace ID. .

Constraints: There must be a workspace in use.

Range: N/A

Default Value: 0

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header.

Constraints: N/A

Range: N/A

Default Value: N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

enable_app_auth

Boolean

Indicates whether the app has been authorized.

app_auth_api

AppAuthApiAuthInfo object

Basic information about the app to which the API has been authorized

Table 5 AppAuthApiAuthInfo

Parameter

Type

Description

api_id

String

API ID

authed_apps

Array of ApigAppDetailInfo objects

Basic information about the app to which the API has been authorized

Table 6 ApigAppDetailInfo

Parameter

Type

Description

app_codes

Array of strings

App code list. When app_type is APIC, this parameter is left blank.

app_id

String

App ID

app_key

String

App key

app_name

String

App name

app_remark

String

App description, which is left blank by default. The value contains a maximum of 200 characters.

app_secret

String

App secret key

app_type

String

App type. Enums:

  • APIC: This App is registered with the ROMA Connect gateway.

  • APIG: This App is registered with the shared API gateway.

  • DEDICATE_APIG: This App is registered with the dedicated API gateway.

bounded_api_count

Integer

Number of APIs bound to the app

created_at

Long

Time when an app is created

project_id

String

Project ID

updated_at

Long

App update time

user_id

String

ID of the user who creates the app

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

GET https://{endpoint}/v1/{project_id}/services/{service_id}/api-auths

Example Responses

Status code: 200

OK

{
  "enable_app_auth" : true,
  "app_auth_api" : {
    "api_id" : "string",
    "authed_apps" : [ {
      "app_codes" : [ "1f5f6cb703864cc580d1ba2cdfd77a271a74eee8e5a242e8b5adc009f77a8b2a" ],
      "app_id" : "54d9104db9e7418f9138980da63a857f",
      "app_key" : "151f1f4dfb20445b97326bde3db0c515",
      "app_name" : "app_for_9332aab245ea4d56871e75d6966aa274",
      "app_remark" : "app for user op_svc_modelarts_container0",
      "app_secret" : "0080fa74e6214d0c8d1b2cb01d9d7708",
      "app_type" : "APIG",
      "bounded_api_count" : 0,
      "created_at" : 1574946998167,
      "project_id" : "string",
      "updated_at" : 1574946998167,
      "user_id" : "9332aab245ea4d56871e75d6966aa274"
    } ]
  }
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.