会社のグループのリストを取得

get
https://api.box.com/2.0
/groups

指定した会社のすべてのグループを取得します。会社のグループを調べるには、管理者権限が必要です。

リクエスト

bearer [ACCESS_TOKEN]
application/json

クエリパラメータ

string arrayクエリ内省略可能
id,type,name

レスポンスに含める属性のコンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。

このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。

stringクエリ内省略可能
Engineering

nameが検索語で始まるグループのみに結果を絞り込みます。

integer / int64クエリ内省略可能
10001000

返す項目の1ページあたりの最大数。

integer / int64クエリ内省略可能
10000

レスポンスが開始される項目のオフセット。

オフセットパラメータ値が10,000を超えているクエリは拒否され、400レスポンスが返されます。

レスポンス

application/jsonGroups

グループオブジェクトのコレクションを返します。グループが存在しない場合は、空のコレクションが返されます。

予期しないクライアントエラー。

get
会社のグループのリストを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/groups" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollection<BoxGroup> groups = await client.GroupsManager.GetAllGroupsAsync();
Java
Iterable<BoxGroup.Info> groups = BoxGroup.getAllGroups(api);
for (BoxGroup.Info groupInfo : groups) {
    // Do something with the group.
}
Python
groups = client.get_groups()
for group in groups:
    print(f'Group "{group.name}" has ID "{group.id}"')
Node
client.groups.getAll()
	.then(groups => {
		/* groups -> {
			total_count: 1,
			entries: [ { type: 'group', id: '1786931', name: 'friends' } ],
			limit: 100,
			offset: 0 }
		*/
	});
iOS
let iterator = client.groups.listForEnterprise()
iterator.next { results in
    switch results {
    case let .success(page):
        for group in page.entries {
            print("Group with name \(group.name) retrieved")
        }

    case let .failure(error):
        print(error)
    }
}

レスポンスの例

{
  "entries": [
    {
      "id": "11446498",
      "type": "group",
      "name": "Support",
      "group_type": "managed_group",
      "created_at": "2012-12-12T10:53:43-08:00",
      "modified_at": "2012-12-12T10:53:43-08:00",
      "provenance": "Active Directory",
      "external_sync_identifier": "AD:123456",
      "description": "Support Group - as imported from Active Directory",
      "invitability_level": "admins_only",
      "member_viewability_level": "admins_only",
      "permissions": {
        "can_invite_as_collaborator": true
      }
    }
  ],
  "limit": 1000,
  "offset": 2000,
  "order": [
    {
      "by": "type",
      "direction": "ASC"
    }
  ],
  "total_count": 5000
}