Querying Custom Authorizers

Function

This API is used to query all the custom authorizers under a gateway.

Debugging

You can use API Explorer to debug this API.

URI

GET /v2/{project_id}/apigw/instances/{instance_id}/authorizers

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see "Appendix" > "Obtaining a Project ID" in this document.

instance_id

Yes

String

Gateway ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Long

Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.

Default: 0

limit

No

Integer

Number of records displayed on each page.

Minimum: 1

Maximum: 500

Default: 20

id

No

String

ID.

name

No

String

Name.

type

No

String

Custom authorizer type.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

size

Integer

Length of the returned resource list.

total

Long

Number of resources that match the query conditions.

authorizer_list

Array of AuthorizerResp objects

Custom authorizers.

Table 5 AuthorizerResp

Parameter

Type

Description

name

String

Custom authorizer name. The name can contain 3 to 64 characters, starting with a letter. Only letters, digits, and underscores (_) are allowed.

type

String

Custom authorizer type.

  • FRONTEND

  • BACKEND

Modification is not allowed.

Enumeration values:

  • FRONTEND

  • BACKEND

authorizer_type

String

Value: FUNC.

Enumeration values:

  • FUNC

authorizer_uri

String

Function URN.

identities

Array of Identity objects

Identity source.

ttl

Integer

Maximum cache age.

user_data

String

User data.

ld_api_id

String

Custom backend ID.

This parameter is currently not supported.

need_body

Boolean

Indicates whether to send the body.

id

String

Custom authorizer ID

create_time

String

Creation time.

roma_app_id

String

ID of the application to which the custom authorizer belongs.

This parameter is currently not supported.

roma_app_name

String

Name of the application to which the custom authorizer belongs.

This parameter is currently not supported.

Table 6 Identity

Parameter

Type

Description

name

String

Parameter name.

location

String

Parameter location.

Enumeration values:

  • HEADER

  • QUERY

validation

String

Parameter verification expression. The default value is null, indicating that no verification is performed.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "total" : 1,
  "size" : 1,
  "authorizer_list" : [ {
    "name" : "Authorizer_demo",
    "type" : "FRONTEND",
    "authorizer_type" : "FUNC",
    "authorizer_uri" : "urn:fss:xx-xxx-4:106506b9a92342df9a5025fc12351cfc:function:defau:apigDemo_1592617458814",
    "identities" : [ {
      "name" : "header",
      "location" : "HEADER"
    } ],
    "ttl" : 0,
    "user_data" : "authorizer_test",
    "id" : "0d982c1ac3da493dae47627b6439fc5c",
    "create_time" : "2020-07-31T11:55:43Z"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "APIG.2011",
  "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3030",
  "error_msg" : "The instance does not exist;id:eddc4d25480b4cd6b512f270a1b8b341"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.