You are not logged in.
Hi,
Im trying to create users via api rest, i have cretated the user using the REST Api but now i need to add the email address.
I am doing all my tests with the superadmin user "GLPI" token but im getting the error:
[
"ERROR_GLPI_ADD",
"You don't have permission to perform this action."
]
Im testing with postman with the the following parameters:
Headers:
Content-Type application/json
Session-Token jsg8gjjb2e2bk32l2krg7qzti1 (Obtained using the glpi user token)
I want to add the email for the user 93:
URL: https://localhost/apirest.php/user/93/Useremail
Body payload:
{
"input": {
"user_id": "93",
"is_default": "1",
"is_dynamic": "0",
"email": "testest@test.com"
}
}
Then when i hit the send button i get the no permission error.
Is there any other permissions that i have to activate to add the email to the user?
Offline
The type names in the URL are case sensitive; They should be User and UserEmail. Also, the user ID property should be "users_id".
Otherwise, I was not able to recreate the issue. I suggest checking the /getActiveProfile endpoint to verify you are currently using the Super-Admin profile in case your user has more than one.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Hi @jlms77;
I'm facing the same issue.
Did you find the solution ?
I also open a issue in the github repo.
https /github.com/glpi-project/glpi/issues/15576
Last edited by renan.redel (2023-09-14 20:10:41)
Offline
In your case, it seems you were missing the "users_id" property.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
In your case, it seems you were missing the "users_id" property.
Thank you so much!
Offline
No problem. For more information about the new API I mentioned in the GitHub issue, you can find the initial pull request for it here:
https://github.com/glpi-project/glpi/pull/12221
It is still a work in progress.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline