> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the app management permissions of an admin

> Call this API to get the app management permissions granted to an admin, used for permission validation and admin console display.

Call this API to get the app management permissions of an admin.

## API call description

Before calling this API, make sure that:

* The app is developed by a product solution provider. Get the AppId on the app details page of [**DingTalk Developer Backend**](https://open-dev.dingtalk.io/#/appMgr/provider/eapp/53642/1) **> Third-party enterprise app**.
* Before calling this API, you can call the [Query the admin list](/open/development/query-the-administrator-list) API to get the admin IDs of the current organization.

## Request

| **Basic information**  |                                                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
| HTTP URL               | [https://oapi.dingtalk.io/user/can\_access\_microapp](https://oapi.dingtalk.io/user/can_access_microapp) |
| HTTP Method            | GET                                                                                                      |
| Supported app type     | appType-Third-party enterprise app                                                                       |
| Permission requirement | permission-qyapi\_get\_member-Read permission for user information                                       |

### Query parameters

| Name          | Type   | Required | Example     | Description                                                                                                                                                                          |
| ------------- | ------ | -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| access\_token | String | Yes      | 6d1bxxxx    | The app credential for calling this API. Obtained through the API for getting the access\_token of a third-party enterprise.                                                         |
| appId         | Number | Yes      | 2000121xxxx | The app ID. Get the AppID on the app details page of [**DingTalk Developer Backend**](https://open-dev.dingtalk.io/#/appMgr/provider/eapp/53642/1) **> Third-party enterprise app**. |
| userId        | String | Yes      | 2000121xxxx | The user ID of the admin to query. Call the [Query the admin list](/open/development/query-the-administrator-list) API to get the value of the userid parameter.                     |

### Request example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X GET "https://oapi.dingtalk.io/user/can_access_microapp" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=c54ee841-199a-459e-8146-3d08c1830a10' \
-d 'appId=1' \
-d 'userId=1'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.io/user/can_access_microapp");
OapiUserCanAccessMicroappRequest req = new OapiUserCanAccessMicroappRequest();
req.setAppId(1L);
req.setUserId("1");
req.setHttpMethod("GET");
OapiUserCanAccessMicroappResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiUserCanAccessMicroappRequest("https://oapi.dingtalk.io/user/can_access_microapp")

req.appId=1
req.userId="1"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_GET , DingTalkConstant::$FORMAT_JSON);
$req = new OapiUserCanAccessMicroappRequest;
$req->setAppId("1");
$req->setUserId("1");
$resp = $c->execute($req, $access_token, "https://oapi.dingtalk.io/user/can_access_microapp");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.io/user/can_access_microapp");
OapiUserCanAccessMicroappRequest req = new OapiUserCanAccessMicroappRequest();
req.AppId = 1L;
req.UserId = "1";
req.SetHttpMethod("GET");
OapiUserCanAccessMicroappResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response body

| Name        | Type    | Example      | Description                                                                                                                               |
| ----------- | ------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| request\_id | String  | 4f9md9obopn2 | The request ID.                                                                                                                           |
| errcode     | Number  | 0            | The return code.                                                                                                                          |
| errmsg      | String  | system error | The description of the return code.                                                                                                       |
| canAccess   | Boolean | true         | Whether the user has management permissions:   - **true**: has management permissions. - **false**: does not have management permissions. |

### Response body example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode":0,
  "canAccess":"true",
  "request_id":"4f9md9obopn2"
}
```

### Error codes

If an error is returned when calling this API, find the solution in the [Global error codes](/open/development/server-api-error-codes-1) document based on the error message.
