Updated on 2024-12-30 GMT+08:00

Querying the Application Organization List

Function

This API is used to query the list of organizations that are authorized to access an application.

Constraints

null

URI

GET /api/v2/tenant/applications/{application_id}/organizations

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

application_id

Yes

String

Application ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Page number.

limit

Yes

Integer

Number of data records on each page.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Authentication credential. The value is "Bearer {access_token}". access_token is obtained by calling the API for obtaining an access credential.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Long

Total number of application organizations.

organizations

Array of ApplicationOrg objects

Organization list.

Table 5 ApplicationOrg

Parameter

Type

Description

org_id

String

Application organization ID.

org_code

String

Application organization code.

name

String

Application organization name.

parent_id

String

Parent organization ID.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error details.

Example Requests

Query the organization list in an application by application ID in the pagination mode. The first 100 data records are returned. If the number of data records is less than 100, all data records are returned.

GET https://{domain_name}/api/v2/tenant/applications/{application_id}/organizations?offset=0&limit=100

Authorization: Bearer 334963fc-1e4a-473b-9096-52a929140...

Example Responses

Status code: 200

Request successful.

{
  "total" : 1,
  "organizations" : [ {
    "org_id" : "20210623103520050-C5AF-DD1A97...",
    "org_code" : "10000",
    "name" : "Headquarter",
    "parent_id" : null
  }, {
    "org_id" : "20210619175409400-BFA4-63FA63...",
    "org_code" : "10001",
    "name" : "Development Group",
    "parent_id" : "20210623103520050-C5AF-DD1A97..."
  } ]
}

Status Codes

Status Code

Description

200

Request successful.

400

Invalid parameter.

Error Codes

See Error Codes.