プログラミング知識0が挑むLINE WORKS API2.0 part6（ユーザー登録編）

# 今回のテーマ
[前回](https://qiita.com/tnk-tty/items/ce4e138c6bae40ed23a7)は利用権限タイプの作成と設定を行いました。

>　~~1.組織を作る~~
>　~~2.役職を作る~~
>　~~3.利用権限タイプを作る~~
>　4.ユーザーを作る
>　5.設定した利用権限タイプで動作するかチェック！

さぁいよいよユーザーを登録します！
まず、[以前設定した条件](https://qiita.com/tnk-tty/items/b16bd06f5cb1301fefa0#%E5%89%8D%E6%8F%90)でユーザー登録に関する部分をおさらいです。

>* 各部・課にはそれぞれ部長・課長がいる
>* 部署によってはアルバイトや派遣社員がいる
>* 社長は特定の組織に所属しない

## 実際にどれだけのユーザーを登録するのか？
作成した組織とも照らし合わせて、以下のように考えました。

|  部 |  課  | ユーザー|
| ---- | ---- | ---- |
|  営業部  |  1課<br>2課  | 営業部長<br>1課課長<br>1課一般職<br>1課派遣社員<br>2課課長<br>2課一般職 |
|  開発部  |  A課<br>B課  | 開発部長<br>開発課長（A課・B課の課長を兼務）<br>A課一般職<br>A課派遣社員<br>B課一般職 |
|総務部　|　-　| 総務部長<br>一般職（内勤）<br>派遣社員（内勤） |
|情報システム部　|　-　| 情報システム部長<br>一般職<br>アルバイト（内勤）|
|部署に所属しないユーザー | - | 社長 |

また、以下の条件を追加します.
* 部長は部の組織長となり、課長は課の組織長となる

### 利用権限タイプのパターンが不足していました....(;_;)
上記のユーザー登録の構想だと、派遣社員（内勤）やアルバイト（内勤）があります。

>* アルバイトや派遣社員は所属している組織以外の組織・メンバーを確認できない
>* 内勤の職員はモバイルアプリを使用しない

[前回のサービス利用設定](https://qiita.com/tnk-tty/items/ce4e138c6bae40ed23a7#%E5%88%A9%E7%94%A8%E6%A8%A9%E9%99%90%E3%82%BF%E3%82%A4%E3%83%97%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%9F%E8%A8%AD%E5%AE%9A%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E5%88%A9%E7%94%A8%E8%A8%AD%E5%AE%9A)では利用権限タイプ「内勤」にしかモバイルの制限を設定していません。

#### 現在の設定の問題点
利用権限タイプは1ユーザーに対して1つしか設定できません。

利用権限タイプは以下の二つがあります。
* 派遣社員/アルバイト
* 内勤

「派遣社員/アルバイト」は[組織図の閲覧制限](https://qiita.com/tnk-tty/items/ce4e138c6bae40ed23a7#%E5%88%A9%E7%94%A8%E6%A8%A9%E9%99%90%E3%82%BF%E3%82%A4%E3%83%97%E3%81%AE%E7%B5%84%E7%B9%94%E5%9B%B3%E9%96%B2%E8%A6%A7%E5%88%B6%E9%99%90%E3%81%AE%E7%99%BB%E9%8C%B2)に使用しました。

「内勤」は[サービス利用設定](https://qiita.com/tnk-tty/items/ce4e138c6bae40ed23a7#%E5%88%A9%E7%94%A8%E6%A8%A9%E9%99%90%E3%82%BF%E3%82%A4%E3%83%97%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%9F%E8%A8%AD%E5%AE%9A%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E5%88%A9%E7%94%A8%E8%A8%AD%E5%AE%9A)に使用しました。

 **「内勤 かつ 派遣社員/アルバイト」** だった場合、どちらの利用権限タイプを設定するか迷ってしまいます。

* 「派遣社員/アルバイト」を選んだ場合
組織図の閲覧制限は機能して、自分の所属以外の組織が見れないようになりますが、サービス利用設定が機能せず、 **モバイルアプリが使用できてしまいます。**  

* 「内勤」を選んだ場合
サービス利用設定が機能して、モバイルアプリは使用できなくなりますが、組織図の閲覧制限が機能せず、 **自分の所属以外の組織を閲覧できてしまいます。** 

### 利用権限タイプを追加します
「内勤(派遣社員/アルバイト)」という利用権限タイプを作成し、サービス利用設定と組織図の閲覧制限に「内勤(派遣社員/アルバイト)を追加しました。

![02.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/d897fa12-54af-e277-1abb-ad6f856cbab3.png)

![03.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/21f11fea-2e6c-66e4-6c1f-6d69092d1660.png)



### 登録するユーザーのパターンを考えました
ユーザーの登録を進めるにあたってなるべく楽したい！と思ったので、あらかじめ登録のパターンを考えました。

* 1.特定の部署には所属しないユーザー
* 2.単一の部署に所属する部長/課長（部長は部の組織長/課長は課の組織長）
* 3.複数の部署に所属する課長
* 4.単一の部署に所属する一般職
* 5.　〃　一般職（内勤) & 派遣社員/アルバイト　 <font color=red> *利用権限タイプの設定が必要*</font>  


ではユーザーを登録していきましょう！

今回はRequest Bodyや実行結果の表示が多いのでサクサク行きますよ～！！！

## ユーザー登録
[ユーザーの登録](https://developers.worksmobile.com/jp/reference/user-create?lang=ja)ドキュメントを参照して登録していきます。

 **パスワードは管理者が初期パスワードを設定する** というシナリオです。

### 1.特定の部署には所属しないユーザー
まず、社長を作成します。
特定の組織には所属しないので、設定する項目は以下の通りです。
* domainId
* email
* userName
* userName.lastName
* userName.firstName
* passwordConfig
* passwordConfig.passwordCreationType
* passwordConfig.password
* cellPhone

<details><summary>Request Body</summary>

~~~
{
    "domainId":{{DOMAIN_ID}},
    "email":"president@xxxxxxxx.com",
    "userName": {
        "lastName":"会社の",
        "firstName":"社長"
    },
    "passwordConfig": {
        "passwordCreationType":"ADMIN",
        "password":"xxxxxxxxxxx"
    },
    "cellPhone":"080-1234-5678"
}
~~~
</details>

<details><summary>実行結果</summary>

~~~
{
    "domainId": xxxxxxxx,
    "userExternalKey": null,
    "email": "president@xxxxxxxxx.com",
    "userName": {
        "lastName": "会社の",
        "firstName": "社長",
        "phoneticLastName": "",
        "phoneticFirstName": ""
    },
    "i18nNames": [],
    "nickName": null,
    "privateEmail": null,
    "aliasEmails": [],
    "employmentTypeId": null,
    "searchable": true,
    "organizations": [
        {
            "domainId": xxxxxxxx,
            "primary": true,
            "userExternalKey": null,
            "email": "president@xxxxxxxxx.com",
            "levelId": null,
            "executive": false,
            "orgUnits": [],
            "organizationName": "demodemo",
            "levelExternalKey": null,
            "levelName": null
        }
    ],
    "telephone": null,
    "cellPhone": "080-1234-5678",
    "fax": null,
    "location": null,
    "task": null,
    "messenger": null,
    "birthdayCalendarType": null,
    "birthday": null,
    "hiredDate": null,
    "locale": "ja_JP",
    "timeZone": "Asia/Tokyo",
    "customFields": [],
    "relations": [],
    "userId": "qxrxsxt-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
    "isAdministrator": false,
    "isPending": true,
    "isSuspended": false,
    "leaveOfAbsence": {
        "startTime": null,
        "endTime": null,
        "isLeaveOfAbsence": false
    },
    "isDeleted": false,
    "suspendedReason": null,
    "employmentTypeExternalKey": null,
    "employmentTypeName": null
}
~~~
</details>

### 2.単一の部署に所属する部長/課長（部長は部の組織長/課長は課の組織長）
次は部長/課長です。
社長と重複するところは割愛して、以下を追加して設定します。

* organizations
* organizations.domainId
* organizations.primary
* organizations.orgUnit.orgUnitId
* organizations.orgUnit.primary
* organizations.orgUnit.positionId(役職）
* organizations.orgUnit.isManager(組織長フラグ）

<details><summary>Request Body</summary>

~~~
{
    "domainId":{{DOMAIN_ID}},
    "email":"eigyo_bucho@clownscrown.tokyo",
    "userName": {
        "lastName":"営業",
        "firstName":"部長"
    },
    "passwordConfig": {
        "passwordCreationType":"ADMIN",
        "password":"xxxxxxxxxxx"
    },
    "organizations":[
        {
            "domainId":{{DOMAIN_ID}},
            "primary":true,
            "orgUnits":[
                {
                    "orgUnitId":"aaaaaaaa-bbbb-cccc-dddd-xxxxxxxxxxxx",
                    "primary":true,
                    "positionId":"89898989-7676-5454-3232-987654321098",
                    "isManager":true
                }
            ]
        }
    ],
    "cellPhone":"080-1234-5678"
}
~~~
</details>

<details><summary>実行結果</summary>

~~~
{
    "domainId": xxxxxxxx,
    "userExternalKey": null,
    "email": "eigyo_bucho@xxxxxxxxx.com",
    "userName": {
        "lastName": "営業",
        "firstName": "部長",
        "phoneticLastName": "",
        "phoneticFirstName": ""
    },
    "i18nNames": [],
    "nickName": null,
    "privateEmail": null,
    "aliasEmails": [],
    "employmentTypeId": null,
    "searchable": true,
    "organizations": [
        {
            "domainId": xxxxxxxx,
            "primary": true,
            "userExternalKey": null,
            "email": "eigyo_bucho@xxxxxxxxx.com",
            "levelId": null,
            "executive": false,
            "orgUnits": [
                {
                    "orgUnitId": "aaaaaaaa-bbbb-cccc-dddd-xxxxxxxxxxxx",
                    "primary": true,
                    "positionId": "89898989-7676-5454-3232-987654321098",
                    "isManager": true,
                    "visible": true,
                    "useTeamFeature": true,
                    "positionName": "部長",
                    "orgUnitExternalKey": null,
                    "orgUnitName": "営業部",
                    "orgUnitEmail": "t_403hb@xxxxxxxxx.com",
                    "positionExternalKey": null
                }
            ],
            "organizationName": "demodemo",
            "levelExternalKey": null,
            "levelName": null
        }
    ],
    "telephone": null,
    "cellPhone": "080-1234-5678",
    "fax": null,
    "location": null,
    "task": null,
    "messenger": null,
    "birthdayCalendarType": null,
    "birthday": null,
    "hiredDate": null,
    "locale": "ja_JP",
    "timeZone": "Asia/Tokyo",
    "customFields": [],
    "relations": [],
    "userId": "mxnxoxp-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
    "isAdministrator": false,
    "isPending": true,
    "isSuspended": false,
    "leaveOfAbsence": {
        "startTime": null,
        "endTime": null,
        "isLeaveOfAbsence": false
    },
    "isDeleted": false,
    "suspendedReason": null,
    "employmentTypeExternalKey": null,
    "employmentTypeName": null
}
~~~
</details>

### 3.複数の部署に所属する課長
 **兼務** となっているので、<font color=red>organizations.orgUnitを2つ</font>記述しています。

<details><summary>Request Body</summary>

~~~
{
    "domainId":{{DOMAIN_ID}},
    "email":"kaihatsu_kacho@clownscrown.tokyo",
    "userName": {
        "lastName":"開発部",
        "firstName":"課長（兼務）"
    },
    "passwordConfig": {
        "passwordCreationType":"ADMIN",
        "password":"xxxxxxxxxxx"
    },
    "organizations":[
        {
            "domainId":{{DOMAIN_ID}},
            "primary":true,
            "orgUnits":[
                {
                    "orgUnitId":"oioiuiui-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary":true,
                    "positionId":"89898989-7676-5454-3232-123456789012",
                    "isManager":true
                },
                {
                    "orgUnitId":"rererere-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary":false,
                    "positionId":"89898989-7676-5454-3232-123456789012",
                    "isManager":true
                }                
            ]
        }
    ],
    "cellPhone":"080-1234-5678"
}

~~~
</details>

<details><summary>実行結果</summary>

~~~
{
    "domainId": xxxxxxxx,
    "userExternalKey": null,
    "email": "kaihatsu_kacho@xxxxxxxxx.com",
    "userName": {
        "lastName": "開発部",
        "firstName": "課長（兼務）",
        "phoneticLastName": "",
        "phoneticFirstName": ""
    },
    "i18nNames": [],
    "nickName": null,
    "privateEmail": null,
    "aliasEmails": [],
    "employmentTypeId": null,
    "searchable": true,
    "organizations": [
        {
            "domainId": xxxxxxxx,
            "primary": true,
            "userExternalKey": null,
            "email": "kaihatsu_kacho@xxxxxxxxx.com",
            "levelId": null,
            "executive": false,
            "orgUnits": [
                {
                    "orgUnitId": "oioiuiui-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary": true,
                    "positionId": "89898989-7676-5454-3232-123456789012",
                    "isManager": true,
                    "visible": true,
                    "useTeamFeature": true,
                    "positionName": "課長",
                    "orgUnitExternalKey": null,
                    "orgUnitName": "A課",
                    "orgUnitEmail": "t_778af@xxxxxxxxx.com",
                    "positionExternalKey": null
                },
                {
                    "orgUnitId": "rererere-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary": false,
                    "positionId": "89898989-7676-5454-3232-123456789012",
                    "isManager": true,
                    "visible": true,
                    "useTeamFeature": true,
                    "positionName": "課長",
                    "orgUnitExternalKey": null,
                    "orgUnitName": "B課",
                    "orgUnitEmail": "t_221nn@xxxxxxxxx.com",
                    "positionExternalKey": null
                }
            ],
            "organizationName": "demodemo",
            "levelExternalKey": null,
            "levelName": null
        }
    ],
    "telephone": null,
    "cellPhone": "080-1234-5678",
    "fax": null,
    "location": null,
    "task": null,
    "messenger": null,
    "birthdayCalendarType": null,
    "birthday": null,
    "hiredDate": null,
    "locale": "ja_JP",
    "timeZone": "Asia/Tokyo",
    "customFields": [],
    "relations": [],
    "userId": "uxvxwxx-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
    "isAdministrator": false,
    "isPending": true,
    "isSuspended": false,
    "leaveOfAbsence": {
        "startTime": null,
        "endTime": null,
        "isLeaveOfAbsence": false
    },
    "isDeleted": false,
    "suspendedReason": null,
    "employmentTypeExternalKey": null,
    "employmentTypeName": null
}
~~~

</details>

### 4.単一の部署に所属する一般職
部長/課長の設定からisManagerの設定を除いただけでOKです。

<details><summary>Request Body</summary>

~~~
{
    "domainId":{{DOMAIN_ID}},
    "email":"eigyou1_ippan@clownscrown.tokyo",
    "userName": {
        "lastName":"営業1課",
        "firstName":"一般職"
    },
    "passwordConfig": {
        "passwordCreationType":"ADMIN",
        "password":"xxxxxxxxxxx"
    },
    "organizations":[
        {
            "domainId":{{DOMAIN_ID}},
            "primary":true,
            "orgUnits":[
                {
                    "orgUnitId":"fefefefe-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary":true,
                    "positionId":"010101-7676-5454-3232-1234567890999"
                }
            ]
        }
    ],
    "cellPhone":"080-1234-5678"
}
~~~

</details>

<details><summary>実行結果</summary>

~~~
{
    "domainId": xxxxxxxx,
    "userExternalKey": null,
    "email": "eigyou1_ippan@xxxxxxxxx.com",
    "userName": {
        "lastName": "営業1課",
        "firstName": "一般職",
        "phoneticLastName": "",
        "phoneticFirstName": ""
    },
    "i18nNames": [],
    "nickName": null,
    "privateEmail": null,
    "aliasEmails": [],
    "employmentTypeId": null,
    "searchable": true,
    "organizations": [
        {
            "domainId": xxxxxxxx,
            "primary": true,
            "userExternalKey": null,
            "email": "eigyou1_ippan@xxxxxxxxx.com",
            "levelId": null,
            "executive": false,
            "orgUnits": [
                {
                    "orgUnitId": "fefefefe-cdcd-efef-ghgh-abcdefghmmmm",
                    "primary": true,
                    "positionId": "010101-7676-5454-3232-1234567890999",
                    "isManager": false,
                    "visible": true,
                    "useTeamFeature": true,
                    "positionName": "一般職",
                    "orgUnitExternalKey": null,
                    "orgUnitName": "1課",
                    "orgUnitEmail": "t_580ig@xxxxxxxxx.com",
                    "positionExternalKey": null
                }
            ],
            "organizationName": "demodemo",
            "levelExternalKey": null,
            "levelName": null
        }
    ],
    "telephone": null,
    "cellPhone": "080-1234-5678",
    "fax": null,
    "location": null,
    "task": null,
    "messenger": null,
    "birthdayCalendarType": null,
    "birthday": null,
    "hiredDate": null,
    "locale": "ja_JP",
    "timeZone": "Asia/Tokyo",
    "customFields": [],
    "relations": [],
    "userId": "5x4x3x2-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
    "isAdministrator": false,
    "isPending": true,
    "isSuspended": false,
    "leaveOfAbsence": {
        "startTime": null,
        "endTime": null,
        "isLeaveOfAbsence": false
    },
    "isDeleted": false,
    "suspendedReason": null,
    "employmentTypeExternalKey": null,
    "employmentTypeName": null
}
~~~

</details>

### 5.単一の部署に所属する一般職（内勤）
内勤者は[利用権限タイプによって、制限を設定](https://qiita.com/tnk-tty/items/ce4e138c6bae40ed23a7)していました。

そのため、 **employmentTypeId** を追加します。
<details><summary>Request Body</summary>

~~~
{
    "domainId":{{DOMAIN_ID}},
    "email":"soumu_ippan@clownscrown.tokyo",
    "userName": {
        "lastName":"総務",
        "firstName":"一般職（内勤）"
    },
    "passwordConfig": {
        "passwordCreationType":"ADMIN",
        "password":"xxxxxxxxxxx"
    },
    "organizations":[
        {
            "domainId":{{DOMAIN_ID}},
            "primary":true,
            "orgUnits":[
                {
                    "orgUnitId":"xyxyxyxyxyxy-cdcd-efef-ghgh-abcdefghijkl",
                    "primary":true,
                    "positionId":"010101-7676-5454-3232-1234567890999"
                }
            ]
        }
    ],
    "cellPhone":"080-1234-5678",
    "employmentTypeId":"75395112-cdcd-efef-ghgh-785421963741"
}

~~~
</details>

<details><summary>実行結果</summary>

~~~
{
    "domainId": xxxxxxxx,
    "userExternalKey": null,
    "email": "soumu_ippan@xxxxxxxxx.com",
    "userName": {
        "lastName": "総務",
        "firstName": "一般職（内勤）",
        "phoneticLastName": "",
        "phoneticFirstName": ""
    },
    "i18nNames": [],
    "nickName": null,
    "privateEmail": null,
    "aliasEmails": [],
    "employmentTypeId": "75395112-cdcd-efef-ghgh-785421963741",
    "searchable": true,
    "organizations": [
        {
            "domainId": xxxxxxxx,
            "primary": true,
            "userExternalKey": null,
            "email": "soumu_ippan@xxxxxxxxx.com",
            "levelId": null,
            "executive": false,
            "orgUnits": [
                {
                    "orgUnitId": "xyxyxyxyxyxy-cdcd-efef-ghgh-abcdefghijkl",
                    "primary": true,
                    "positionId": "010101-7676-5454-3232-1234567890999",
                    "isManager": false,
                    "visible": true,
                    "useTeamFeature": true,
                    "positionName": "一般職",
                    "orgUnitExternalKey": null,
                    "orgUnitName": "総務部",
                    "orgUnitEmail": "t_910hg@xxxxxxxxx.com",
                    "positionExternalKey": null
                }
            ],
            "organizationName": "demodemo",
            "levelExternalKey": null,
            "levelName": null
        }
    ],
    "telephone": null,
    "cellPhone": "080-1234-5678",
    "fax": null,
    "location": null,
    "task": null,
    "messenger": null,
    "birthdayCalendarType": null,
    "birthday": null,
    "hiredDate": null,
    "locale": "ja_JP",
    "timeZone": "Asia/Tokyo",
    "customFields": [],
    "relations": [],
    "userId": "sxwx3xs-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
    "isAdministrator": false,
    "isPending": true,
    "isSuspended": false,
    "leaveOfAbsence": {
        "startTime": null,
        "endTime": null,
        "isLeaveOfAbsence": false
    },
    "isDeleted": false,
    "suspendedReason": null,
    "employmentTypeExternalKey": null,
    "employmentTypeName": "内勤"
}
~~~

</details>

### 出来上がったものがこちらです
[ユーザーリストの取得](https://developers.worksmobile.com/jp/reference/user-list?lang=ja)を使用して、すべてのユーザーの情報を取得しました。

![04.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/3ed4f9ad-a85b-1ef8-a27e-d9310ed32dbb.png)

<details><summary>実行結果（メチャクチャ長いです。）</summary>

~~~
{
    "responseMetaData": {
        "nextCursor": null
    },
    "users": [
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "president@xxxxxxxxx.com",
            "userName": {
                "lastName": "会社の",
                "firstName": "社長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "president@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "qxrxsxt-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyo_bucho@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業",
                "firstName": "部長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyo_bucho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "aaaaaaaa-bbbb-cccc-dddd-xxxxxxxxxxxx",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-987654321098",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "部長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "営業部",
                            "orgUnitEmail": "t_403hb@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "mxnxoxp-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "kaihatsu_bucho@xxxxxxxxx.com",
            "userName": {
                "lastName": "開発",
                "firstName": "部長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "kaihatsu_bucho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "abababababab-cdcd-efef-ghgh-abcdefghijkl",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-987654321098",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "部長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "開発部",
                            "orgUnitEmail": "t_890oh@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "ixjxkxl-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "soumu_bucho@xxxxxxxxx.com",
            "userName": {
                "lastName": "総務",
                "firstName": "部長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "soumu_bucho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "xyxyxyxyxyxy-cdcd-efef-ghgh-abcdefghijkl",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-987654321098",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "部長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "総務部",
                            "orgUnitEmail": "t_910hg@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "exfxgxh-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "jyousys_bucho@xxxxxxxxx.com",
            "userName": {
                "lastName": "情報システム部",
                "firstName": "部長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "jyousys_bucho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "zjzjzjzjzjzj-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-987654321098",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "部長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "情報システム部",
                            "orgUnitEmail": "t_217mh@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "axbxcxd-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyou1_kacho@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業1課",
                "firstName": "課長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyou1_kacho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "fefefefe-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-123456789012",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "課長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "1課",
                            "orgUnitEmail": "t_580ig@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "5x6x7x8-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyou2_kacho@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業2課",
                "firstName": "課長",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyou2_kacho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "pqpwpepr-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-123456789012",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "部長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "2課",
                            "orgUnitEmail": "t_705tw@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "1x2x3x4-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyou1_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業1課",
                "firstName": "一般職",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyou1_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "fefefefe-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "1課",
                            "orgUnitEmail": "t_580ig@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "5x4x3x2-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyou2_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業2課",
                "firstName": "一般職",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyou2_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "pqpwpepr-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "2課",
                            "orgUnitEmail": "t_705tw@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "7x7x7x7-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "kaihatsua_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "開発A課",
                "firstName": "一般職",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "kaihatsua_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "oioiuiui-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "A課",
                            "orgUnitEmail": "t_778af@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "sasasasa-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "kaihatsub_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "開発B課",
                "firstName": "一般職",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "kaihatsub_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "rererere-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "B課",
                            "orgUnitEmail": "t_221nn@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "kokokoko-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "jyousys_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "情報システム部",
                "firstName": "一般職",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "jyousys_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "zjzjzjzjzjzj-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "情報システム部",
                            "orgUnitEmail": "t_217mh@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "jgjgjgjg-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "soumu_ippan@xxxxxxxxx.com",
            "userName": {
                "lastName": "総務",
                "firstName": "一般職（内勤）",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": "75395112-cdcd-efef-ghgh-785421963741",
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "soumu_ippan@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "xyxyxyxyxyxy-cdcd-efef-ghgh-abcdefghijkl",
                            "primary": true,
                            "positionId": "010101-7676-5454-3232-1234567890999",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "一般職",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "総務部",
                            "orgUnitEmail": "t_910hg@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "sxwx3xs-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": "内勤"
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "eigyo1_haken@xxxxxxxxx.com",
            "userName": {
                "lastName": "営業1課",
                "firstName": "派遣社員",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": "852852-cdcd-efef-ghgh-785421963741",
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "eigyo1_haken@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "fefefefe-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-8787-5454-3232-123456789098",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "派遣社員",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "1課",
                            "orgUnitEmail": "t_580ig@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "lx1x2xs-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": "派遣社員/アルバイト"
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "kaihatsua_haken@xxxxxxxxx.com",
            "userName": {
                "lastName": "開発A課",
                "firstName": "派遣社員",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": "852852-cdcd-efef-ghgh-785421963741",
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "kaihatsua_haken@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "oioiuiui-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-8787-5454-3232-123456789098",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "派遣社員",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "A課",
                            "orgUnitEmail": "t_778af@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "txtxbxb-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": "派遣社員/アルバイト"
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "soumu_haken@xxxxxxxxx.com",
            "userName": {
                "lastName": "総務部",
                "firstName": "派遣社員",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": "963963-cdcd-efef-ghgh-785421963741",
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "soumu_haken@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "xyxyxyxyxyxy-cdcd-efef-ghgh-abcdefghijkl",
                            "primary": true,
                            "positionId": "010101-8787-5454-3232-123456789098",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "派遣社員",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "総務部",
                            "orgUnitEmail": "t_910hg@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "rxsxfxd-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": "内勤(派遣社員/アルバイト)"
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "jyousys_parttime@xxxxxxxxx.com",
            "userName": {
                "lastName": "情報システム部",
                "firstName": "アルバイト",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": "963963-cdcd-efef-ghgh-785421963741",
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "jyousys_parttime@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "zjzjzjzjzjzj-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "010101-8787-5454-3232-123456789098",
                            "isManager": false,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "派遣社員",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "情報システム部",
                            "orgUnitEmail": "t_217mh@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userId": "yxzx1x2-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": "内勤(派遣社員/アルバイト)"
        },
        {
            "domainId": xxxxxxxx,
            "userExternalKey": null,
            "email": "kaihatsu_kacho@xxxxxxxxx.com",
            "userName": {
                "lastName": "開発部",
                "firstName": "課長（兼務）",
                "phoneticLastName": "",
                "phoneticFirstName": ""
            },
            "i18nNames": [],
            "nickName": null,
            "privateEmail": null,
            "aliasEmails": [],
            "employmentTypeId": null,
            "searchable": true,
            "organizations": [
                {
                    "domainId": xxxxxxxx,
                    "primary": true,
                    "userExternalKey": null,
                    "email": "kaihatsu_kacho@xxxxxxxxx.com",
                    "levelId": null,
                    "executive": false,
                    "orgUnits": [
                        {
                            "orgUnitId": "oioiuiui-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": true,
                            "positionId": "89898989-7676-5454-3232-123456789012",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "課長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "A課",
                            "orgUnitEmail": "t_778af@xxxxxxxxx.com",
                            "positionExternalKey": null
                        },
                        {
                            "orgUnitId": "rererere-cdcd-efef-ghgh-abcdefghmmmm",
                            "primary": false,
                            "positionId": "89898989-7676-5454-3232-123456789012",
                            "isManager": true,
                            "visible": true,
                            "useTeamFeature": true,
                            "positionName": "課長",
                            "orgUnitExternalKey": null,
                            "orgUnitName": "B課",
                            "orgUnitEmail": "t_221nn@xxxxxxxxx.com",
                            "positionExternalKey": null
                        }
                    ],
                    "organizationName": "demodemo",
                    "levelExternalKey": null,
                    "levelName": null
                }
            ],
            "telephone": null,
            "cellPhone": "080-1234-5678",
            "fax": null,
            "location": null,
            "task": null,
            "messenger": null,
            "birthdayCalendarType": null,
            "birthday": null,
            "hiredDate": null,
            "locale": "ja_JP",
            "timeZone": "Asia/Tokyo",
            "customFields": [],
            "relations": [],
            "userIde": "uxvxwxx-8x8x-9x9x-0z0z-1a1a1z1z1s1s",
            "isAdministrator": false,
            "isPending": true,
            "isSuspended": false,
            "leaveOfAbsence": {
                "startTime": null,
                "endTime": null,
                "isLeaveOfAbsence": false
            },
            "isDeleted": false,
            "suspendedReason": null,
            "employmentTypeExternalKey": null,
            "employmentTypeName": null
        }
    ]
}
~~~
</details>

ブラウザの管理者画面ではこのように表示されています。

<details><summary>管理者画面</summary>
* 総務部

![総務.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/596db83b-ba2b-5453-75d7-4a6628fd4e70.png)

* 情報システム部
![情シス.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/c4e13435-71d1-d7de-5e51-0a56a15406a6.png)

* 営業部 ・ 1課 ・ 2課

![営業部.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/4dc7bf31-5a16-5dbc-d891-5b70856be3f9.png)

![1課.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/6269be0c-d344-c4ed-4abb-a82e4a9dc1b4.png)

![2課.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/b6906f0e-5537-ed54-9502-7307453ce9d8.png)

* 開発部 ・ A課 ・ B課
![開発部.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/5992666e-ea71-5b12-ab1a-19117a0f0c12.png)

![A課.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/8b30e6bc-0d10-3c24-52c3-7b6728e8cbad.png)

![B課.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/7a628f42-3c8e-b55f-5e76-73dd8173630f.png)


</details>

### 管理者権限の設定
[以前設定した条件](https://qiita.com/tnk-tty/items/b16bd06f5cb1301fefa0#%E5%89%8D%E6%8F%90)では以下の条件もありました。

>* LINE WORKSの管理者画面にアクセスできる権限を持っているのは情報システム部に所属するメンバーのみとして、他部署の役職者や社長であっても管理者画面へのアクセス権は持たせない

管理者画面へのアクセス権限はAPIでは設定できない為、ブラウザの管理者画面で設定します。

管理者権限はデフォルトで権限が作成されています。
※それぞれの権限の詳細はこちらの[ガイド]((https://guide.worksmobile.com/jp/admin/admin-guide/security/administrator-authorities/manage-administrator-authorities/))をご覧下さい。
![admin01.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/d006d3ee-422c-c6aa-4d4d-60f33b6171a2.png)

デフォルトの権限以外にカスタマイズした権限を作成する事が可能です。
「権限の作成」をクリックします。
![admin01.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/8ce78d01-a776-15f8-13ae-8a57602dfdda.png)

任意の名称を設定します。

![admin02.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/d3330c83-c0a9-76e8-8361-4ae0fe75e18b.png)

アルバイトのユーザーに全体の権限を渡すのもちょっとなぁ。。。という気がするので、
アルバイトのユーザーはパスワードの失念に対する対応などメンバーや組織・グループに関する情報にアクセスできる権限を付与しようと思います。

「メンバー」の項目以外はすべてチェックを外して、「保存」をクリックします。

![admin03.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/198679a4-2267-ca7c-160a-5045998e4cce.png)

「管理者」タブへ移動し、「管理者の追加」をクリックして...

![admin04.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/55b9d7b8-d2c8-9b20-b613-e3a205186a80.png)

アルバイトのユーザーを選択して、「OK」です。

![admin05.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/00d42d8f-171c-9cf4-1ead-6bb6271d2cb0.png)
![admin06.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/1c238a60-935a-da3a-1646-932159282b53.png)

情報システム部の部長と一般職員はすべての機能にアクセスする必要があると想定しているので、デフォルトの「副管理者」権限に設定しました。

![admin09.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2740500/444b1050-da5b-a357-c71c-917733906e80.png)

# まとめ
* LINE WORKSの以下のドキュメントを参照しました。
[ユーザーの登録](https://developers.worksmobile.com/jp/reference/user-create?lang=ja)
[ユーザーリストの取得](https://developers.worksmobile.com/jp/reference/user-list?lang=ja)

* 管理者画面の機能については[ガイド](https://guide.worksmobile.com/jp/admin/admin-guide/)もご覧ください。

個人的には現時点で「う～ん。。。イケてない」と思うところがあったりするのですが、
まぁとりあえず作成したユーザーで設定状況の確認をしてみようと思います！