Last updated
Last updated
$client->application->users
$client->application->users->paginate(int $page = 1);
{
"object": "list",
"data": [
{
"object": "user",
"attributes": {
"id": 1,
"external_id": null,
"uuid": "6484c516-752a-44c3-9776-5359b0c0b394",
"username": "patryqhyper",
"email": "vizauerp@gmail.com",
"first_name": "Patryk",
"last_name": "Vizauer",
"language": "en",
"root_admin": true,
"2fa": false,
"created_at": "2021-12-17T23:49:47+00:00",
"updated_at": "2021-12-17T23:49:47+00:00"
}
}
],
"meta": {
"pagination": {
"total": 3,
"count": 3,
"per_page": 50,
"current_page": 1,
"total_pages": 1,
"links": {}
}
}
}
$client->application->users->find(int $userId);
$client->application->users->findByExternal('externalId');
{
"object": "user",
"attributes": {
"id": 4,
"external_id": null,
"uuid": "ae3277bb-29c3-43c4-8e24-2c5300862fb4",
"username": "test",
"email": "test@wp.pl",
"first_name": "sdk",
"last_name": "php",
"language": "en",
"root_admin": false,
"2fa": false,
"created_at": "2021-12-18T15:12:06+00:00",
"updated_at": "2021-12-18T15:12:06+00:00"
}
}
$client->application->users->create([
'email' => 'email@email.pl',
'username' => 'username',
'first_name' => 'sdk',
'last_name' => 'php'
]))
{
"object": "user",
"attributes": {
"id": 4,
"external_id": null,
"uuid": "ae3277bb-29c3-43c4-8e24-2c5300862fb4",
"username": "test",
"email": "test@wp.pl",
"first_name": "sdk",
"last_name": "php",
"language": "en",
"root_admin": false,
"2fa": false,
"created_at": "2021-12-18T15:12:06+00:00",
"updated_at": "2021-12-18T15:12:06+00:00"
},
"meta": {
"resource": "http:\/\/newptero.hyperapp.ovh\/api\/application\/users\/4"
}
}
$client->application->users->update(int $userId, array $data = [])
{
"object": "user",
"attributes": {
"id": 4,
"external_id": null,
"uuid": "ae3277bb-29c3-43c4-8e24-2c5300862fb4",
"username": "test",
"email": "test@wp.pl",
"first_name": "test",
"last_name": "t",
"language": "en",
"root_admin": false,
"2fa": false,
"created_at": "2021-12-18T15:12:06+00:00",
"updated_at": "2021-12-18T16:41:44+00:00"
}
}
$client->application->users->delete(int $userId);
true // requests, which return http code 204, return true on success.