Get App Menu and Permission


Get the list of application menus and permissions that the user has been assigned.

Prerequisites


  • The user has logged in to Application Portal and entered an OU. You can log in to Application Portal through the Log In API and select the OU through the Choose Organization API.

  • The OU has obtained the application, or the application is a self-built application in the OU.

  • The user has access permission for the permissions and menus corresponding to the application, otherwise the return result is empty.

Request Format


GET https://{apigw-address}/app-portal-service/v2.2/user/app/resource/info

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

accessKey

Query

Required

String

The application’s accessKey, used for authentication to obtain the data that the application is authorized to access. How to obtain accessKey information >>

Request Parameters (Header)


Name

Required/Optional

Data Type

Description

Authorization

Required

String

The access token generated after the user logs in and selects the OU, represented by Bearer Token, is in the form of Bearer {your token}. You can call the Log In or Refresh Access Token API to obtain the access token.

Response Parameters


Name

Data Type

Description

permissions

Permission Struct

The list of permissions. Permission Struct >>

menus

Menu Struct

The list of menus. Menu Struct >>

Permission Struct


Name

Data Type

Description

id

String

The permission ID.

identifier

String

The unique code of the permission.

name

String

The permission name.

nameJson

I18nString

The permission name in multiple languages.

Error Codes


Code

Description

31400

AccessKey is required

31401

Access Token is invalid

31403

No access to the application

31404

The application does not exist, or is not acquired

31512

Selecting an OU is required

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.2/user/app/resource/info?accessKey=app_1

method: GET

headers: {"Authorization":"Bearer your_token"}

Return Sample


{
  "code": 0,
  "message": "",
  "data": {
    "permissions": [
{
  "id": "permissionKey",
  "identifier": "permission",
  "name": "permission",
  "nameJson":{"default":"permission","en_Us":"permission", "zh_CN":"permission"},
}
],
    "menus": [
      {
        "id": "accessKey",
        "identifier": "menu",
        "name": "menu",
        "nameJson":{"default":"defName","en_Us":"enName", "zh_CN":"zhName"},
        "url": "/a",
        "displayOrder": 1,
        "parentId": "",
        "children": []
      },
      {
        "id": "accessKey",
        "identifier": "menu2",
        "name": "menu2",
        "nameJson":{"default":"defName","en_Us":"enName", "zh_CN":"zhName"},
        "url": "/eos-wind-map/assetOverview.html",
        "displayOrder": 2,
        "parentId": "",
        "children": []
      }
    ]
  }
}