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

# 管理者の連絡先権限スコープを取得

> 指定した管理者の連絡先権限スコープを取得し、その管理権限の操作可能範囲を把握できます

本インターフェースを呼び出して、管理者の連絡先権限スコープを取得します。

## リクエスト

| **基本情報**      |                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------ |
| HTTP URL      | [https://api.dingtalk.io/topapi/user/get\_admin\_scope](https://api.dingtalk.io/topapi/user/get_admin_scope) |
| HTTP Method   | POST                                                                                                         |
| サポートされるアプリタイプ | appType-社内アプリappType-サードパーティ社内アプリ                                                                            |
| 権限要件          | permission-qyapi\_get\_member-ユーザー情報読み取り権限                                                                   |

### クエリパラメータ

| 名前            | タイプ    | 必須 | 例        | 説明                                                                                                                                                                                         |
| ------------- | ------ | -- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| access\_token | String | はい | bE74xxxx | この API を呼び出すためのアプリ認証情報。   - 社内アプリの場合、[社内アプリの access\_token を取得する](/ja/open/development/obtain-orgapp-token)インターフェースで取得します。 - サードパーティ社内アプリの場合、サードパーティ企業の access\_token を取得するインターフェースで取得します。 |

### リクエストボディ

| 名前     | タイプ    | 必須 | 例         | 説明                                                                                                               |
| ------ | ------ | -- | --------- | ---------------------------------------------------------------------------------------------------------------- |
| userid | String | はい | manger123 | 管理者の userid。[管理者リストを取得](/ja/open/development/query-the-administrator-list) インターフェースを呼び出して、現在の企業内の管理者 ID を取得できます。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/user/get_admin_scope" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=f928c8b2-5f41-4c92-908a-01fee1f20450' \
-d 'userid=manager7078'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/get_admin_scope");
OapiUserGetAdminScopeRequest req = new OapiUserGetAdminScopeRequest();
req.setUserid("manger123");
OapiUserGetAdminScopeResponse 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.OapiUserGetAdminScopeRequest("https://api.dingtalk.io/topapi/user/get_admin_scope")

req.userid="manager7078"
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_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiUserGetAdminScopeRequest;
$req->setUserid("manager7078");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/user/get_admin_scope");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/user/get_admin_scope");
OapiUserGetAdminScopeRequest req = new OapiUserGetAdminScopeRequest();
req.Userid = "manager7078";
OapiUserGetAdminScopeResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前          | タイプ       | 例            | 説明              |
| ----------- | --------- | ------------ | --------------- |
| request\_id | String    | zpucraudovy0 | リクエスト ID。       |
| errcode     | Number    | 0            | リターンコード。        |
| errmsg      | String    | ok           | リターンコードの説明。     |
| dept\_ids   | Number\[] | \[1]         | 管理可能な部門 ID リスト。 |

### レスポンスボディ例

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "dept_ids": [
    1
  ],
  "errcode": 0,
  "errmsg": "ok",
  "request_id": "zpucraudovy0"
}
```

### エラーコード

本インターフェースの呼び出しでエラーが発生した場合、エラーメッセージをもとに [グローバルエラーコード](/ja/open/development/server-api-error-codes-1) ドキュメントで解決策を検索できます。

| エラーコード（errcode） | エラーコード説明（errmsg） | 解決策                         |
| --------------- | ---------------- | --------------------------- |
| 60121           | 社員が見つかりません       | userId が正しいかご確認ください         |
| 40036           | パラメータが空です        | 必須パラメータが漏れなく入力されているかご確認ください |
| 400001          | システムエラー          | 後でもう一度お試しください               |
