Skip to main content
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 > Third-party enterprise app.
  • Before calling this API, you can call the Query the admin list API to get the admin IDs of the current organization.

Request

Basic information
HTTP URLhttps://oapi.dingtalk.io/user/can_access_microapp
HTTP MethodGET
Supported app typeappType-Third-party enterprise app
Permission requirementpermission-qyapi_get_member-Read permission for user information

Query parameters

NameTypeRequiredExampleDescription
access_tokenStringYes6d1bxxxxThe app credential for calling this API. Obtained through the API for getting the access_token of a third-party enterprise.
appIdNumberYes2000121xxxxThe app ID. Get the AppID on the app details page of DingTalk Developer Backend > Third-party enterprise app.
userIdStringYes2000121xxxxThe user ID of the admin to query. Call the Query the admin list API to get the value of the userid parameter.

Request example

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
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
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
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#
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

NameTypeExampleDescription
request_idString4f9md9obopn2The request ID.
errcodeNumber0The return code.
errmsgStringsystem errorThe description of the return code.
canAccessBooleantrueWhether the user has management permissions: - true: has management permissions. - false: does not have management permissions.

Response body example

{
  "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 document based on the error message.