Retrieve users of all enterprises via API
This query should retrieve users of all enterprises in the user's scope if the user is the cloud admin. The privilege required is "Manage users of all enterprises", which is the API role:Â USERS_MANAGE_OTHER_ENTERPRISES.
Here we have used a limit parameter with a value of 2 because there are 144 users!
cURL:
curl -X GET http://example.com/api/admin/enterprises/_/users?limit=2 \
-H 'Accept:application/vnd.abiquo.users+json; version=4.6' \
-u user:password --verbose
Success status code: 200
Request payload:
--none--
Response payload:
{
"totalSize": 144,
"links": [
{
"rel": "first",
"href": "https://example.com:443/api/admin/enterprises/_/users?limit=2&by=name&asc=true"
},
{
"rel": "next",
"href": "https://example.com:443/api/admin/enterprises/_/users?startwith=2&limit=2&by=name&asc=true"
},
{
"rel": "last",
"href": "https://example.com:443/api/admin/enterprises/_/users?startwith=142&limit=2&by=name&asc=true"
}
],
"collection": [
{
"id": 32,
"nick": "0000",
"name": "0000",
"surname": "0000",
"email": "aa.bbb@cc.com",
"locale": "en_US",
"authType": "ABIQUO",
"active": true,
"firstLogin": false,
"locked": false,
"links": [
{
"title": "4.2.0_Snapshot Enterprise testing",
"rel": "enterprise",
"type": "application/vnd.abiquo.enterprise+json",
"href": "https://example.com:443/api/admin/enterprises/49"
},
{
"title": "USER",
"rel": "role",
"type": "application/vnd.abiquo.role+json",
"href": "https://example.com:443/api/admin/roles/2"
},
{
"title": "0000",
"rel": "edit",
"type": "application/vnd.abiquo.user+json",
"href": "https://example.com:443/api/admin/enterprises/49/users/32"
},
{
"title": "Global scope",
"rel": "scope",
"type": "application/vnd.abiquo.scope+json",
"href": "https://example.com:443/api/admin/scopes/1"
},
{
"title": "virtual machines",
"rel": "virtualmachines",
"type": "application/vnd.abiquo.virtualmachines+json",
"href": "https://example.com:443/api/admin/enterprises/49/users/32/action/virtualmachines"
},
{
"title": "pending tasks",
"rel": "pendingtasks",
"type": "application/vnd.abiquo.tasks+json",
"href": "https://example.com:443/api/admin/enterprises/49/users/32/action/pendingtasks"
},
{
"title": "applications",
"rel": "applications",
"type": "application/vnd.abiquo.applications+json",
"href": "https://example.com:443/api/admin/enterprises/49/users/32/applications"
},
{
"title": "disable two factor authentication",
"rel": "disable2fa",
"type": "",
"href": "https://example.com:443/api/admin/enterprises/49/users/32/action/disable2fa"
},
{
"title": "async tasks",
"rel": "asynctasks",
"type": "application/vnd.abiquo.asynctasks+json",
"href": "https://example.com:443/api/admin/enterprises/49/users/32/asynctasks"
}
]
},
{
"id": 106,
"nick": "00festivaladmin",
"name": "00festivaladmin",
"surname": "QA",
"email": "festival@example.com",
"locale": "en_US",
"authType": "ABIQUO",
"active": true,
"firstLogin": false,
"locked": false,
"links": [
{
"title": "00enterprisefestival",
"rel": "enterprise",
"type": "application/vnd.abiquo.enterprise+json",
"href": "https://example.com:443/api/admin/enterprises/121"
},
{
"title": "CLOUD_ADMIN",
"rel": "role",
"type": "application/vnd.abiquo.role+json",
"href": "https://example.com:443/api/admin/roles/1"
},
{
"title": "00festivaladmin",
"rel": "edit",
"type": "application/vnd.abiquo.user+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106"
},
{
"title": "00scopefestival",
"rel": "scope",
"type": "application/vnd.abiquo.scope+json",
"href": "https://example.com:443/api/admin/scopes/57"
},
{
"title": "virtual machines",
"rel": "virtualmachines",
"type": "application/vnd.abiquo.virtualmachines+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106/action/virtualmachines"
},
{
"title": "pending tasks",
"rel": "pendingtasks",
"type": "application/vnd.abiquo.tasks+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106/action/pendingtasks"
},
{
"title": "applications",
"rel": "applications",
"type": "application/vnd.abiquo.applications+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106/applications"
},
{
"title": "enable two factor authentication",
"rel": "enable2fa",
"type": "application/vnd.abiquo.twofactorauthcredentials+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106/action/enable2fa"
},
{
"title": "async tasks",
"rel": "asynctasks",
"type": "application/vnd.abiquo.asynctasks+json",
"href": "https://example.com:443/api/admin/enterprises/121/users/106/asynctasks"
}
]
}
]
}
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved