獲取使用者所屬的組織

information

本頁面使用機器翻譯而成。
機器翻譯免責聲明 (External link)

目錄

獲取使用者所屬的組織

獲取使用者所屬的組織以及使用者在該組織中的職務。

有關導出CSV檔的API的更多資訊,請參閱以下頁面。
匯出使用者所屬的組織

URL

https://sample.cybozu.com/v1/user/organizations.json

HTTP 方法

GET

所需存取權限

請求

參數
參數名稱 類型 必須 說明
code 字串 必須 用戶的登入名稱
示例請求
URL

https://sample.cybozu.com/v1/user/organizations.json?code=sato-noboru

標頭

使用 API 權杖時,不管哪個級別的權限範圍,都可以執行。

1
2
3
{
  "Authorization": "Bearer API_TOKEN"
}

有關請求頭的更多資訊,請參閱以下頁面。
User API 通用規範

回應

屬性
屬性名稱 類型 說明
organizationTitles 陣列 用戶所屬的組織和職務清單。
詳情請參閱以下頁面。
OrganizationTitle型
示例回應
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "organizationTitles": [
    {
      "organization": {
        "code": "Sales01",
        "description": "國內銷售部",
        "id": "2",
        "localName": "Domestic Sales Department",
        "localNameLocale": "en",
        "name": "國內銷售部",
        "parentCode": "A"
      },
      "title": {
        "code": "Manager",
        "description": "マネージャー",
        "id": "1",
        "name": "マネージャー"
      }
    }
  ]
}

示例代碼

使用 curl 的請求

根據您的環境,curl 的格式可能會有所不同。
有關說明,請參閱以下頁面。
使用curl命令執行kintone REST API/3.執行API

1
2
curl -X GET 'https://sample.cybozu.com/v1/user/organizations.json?code=sato-noboru' \
  -H 'Authorization: Bearer API_TOKEN'

限制事項

  • 無法獲取kintone訪客使用者。