Hi,
I am using the user API with https://docs.espocrm.com/development/api-client-php/
However I am not able to retrieve all users filtered on a certain role name.
The user id: 65e98f9b2baf8b39e is linked to a role "Adviseur"
"id": "65e98f9b2baf8b39e",
"name": "adviseur_bouw",
"userName": "adviseur_bouw",
"type": "regular",
"isActive": true,
"rolesIds": [
"660e7aa619df793c4",
"660e7bc19d7f005ec"
],
"rolesNames": {
"660e7aa619df793c4": "Adviseur",
"660e7bc19d7f005ec": "Werelds beheerder"
},
Now I like to filter on all users which are linked to the role "Adviseur"
I tried a lot of things but this is the latest trial:
...
$where = [
[
'type' => 'arrayAnyOf',
'attribute' => 'rolesNames',
'value' => ['Adviseur'],
],
[
'type' => 'equals',
'attribute' => 'id',
'value' => '65e98f9b2baf8b39e',
],
];
$response = $client->request( Client::METHOD_GET, 'user', [
'offset' => 0
,'select' => 'rolesNames'
,'maxSize' => 100
,'where' => $where
] );
$parsedBody = $response->getParsedBody();
var_dump($parsedBody);die();
..
But now response
(note: If I remove the filter on roleNames I get the user)
Does anyone have an idea how I can filter on rolename?
Thanks
I am using the user API with https://docs.espocrm.com/development/api-client-php/
However I am not able to retrieve all users filtered on a certain role name.
The user id: 65e98f9b2baf8b39e is linked to a role "Adviseur"
"id": "65e98f9b2baf8b39e",
"name": "adviseur_bouw",
"userName": "adviseur_bouw",
"type": "regular",
"isActive": true,
"rolesIds": [
"660e7aa619df793c4",
"660e7bc19d7f005ec"
],
"rolesNames": {
"660e7aa619df793c4": "Adviseur",
"660e7bc19d7f005ec": "Werelds beheerder"
},
Now I like to filter on all users which are linked to the role "Adviseur"
I tried a lot of things but this is the latest trial:
...
$where = [
[
'type' => 'arrayAnyOf',
'attribute' => 'rolesNames',
'value' => ['Adviseur'],
],
[
'type' => 'equals',
'attribute' => 'id',
'value' => '65e98f9b2baf8b39e',
],
];
$response = $client->request( Client::METHOD_GET, 'user', [
'offset' => 0
,'select' => 'rolesNames'
,'maxSize' => 100
,'where' => $where
] );
$parsedBody = $response->getParsedBody();
var_dump($parsedBody);die();
..
But now response
(note: If I remove the filter on roleNames I get the user)
Does anyone have an idea how I can filter on rolename?
Thanks
Comment