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

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

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

リクエスト

application/json

クエリパラメータ

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

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

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

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

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

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

応答が開始される項目のオフセット。

レスポンス

application/jsonGroups

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

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

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

リクエストの例

cURL
curl -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('Group "{0}" has ID "{1}"'.format(group.name, group.id))
Node
client.groups.getAll()
	.then(groups => {
		/* groups -> {
			total_count: 1,
			entries: [ { type: 'group', id: '1786931', name: 'friends' } ],
			limit: 100,
			offset: 0 }
		*/
	});
iOS
client.groups.listForEnterprise() { results in
    switch results {
    case let .success(iterator):
        for i in 1 ... 10 {
            iterator.next { result in
                switch result {
                case let .success(group):
                    print("Group with name \(group.name) retrieved")
                case let .failure(error):
                    print(error)
                }
            }
        }
    case let .failure(error):
        print(error)
    }
}