post user error
Moderators: alexandre, hugo, rmvanarkel
post user error
Hi,
i want to use the api for update full profile, with the post request but i have the following error :
{
"exceptionType": "org.cyclos.server.model.NestedFrameworkException",
"kind": "nested",
"conflictError": {
"code": "staleEntity"
},
"error": {
"exceptionType": "org.cyclos.model.StaleEntityException",
"kind": "general"
},
"property": "user"
}
I try to use the version parameter but nothing changes.
Someone can help me ?
Thanks
Regards,
Guillaume
i want to use the api for update full profile, with the post request but i have the following error :
{
"exceptionType": "org.cyclos.server.model.NestedFrameworkException",
"kind": "nested",
"conflictError": {
"code": "staleEntity"
},
"error": {
"exceptionType": "org.cyclos.model.StaleEntityException",
"kind": "general"
},
"property": "user"
}
I try to use the version parameter but nothing changes.
Someone can help me ?
Thanks
Regards,
Guillaume
Re: post user error
You will have call the Edit For Profile `GET /users/{user}/data-for-edit`, replace your custom values in that response object, and then call `PUT /users/{user}` to update.
Re: post user error
Hi thanks ! Its weird, i can see my custom values ( profile fields) when i get the data-for-edit.
Is it normal ?
Thanks,
Guillaume
Is it normal ?
Thanks,
Guillaume
Re: post user error
Yes it is normal. That's how cyclos works. You can update the customValues to whatever you wanted to update and the call the PUT and you are all done.
Re: post user error
I tried but my customvalues don't change. I have now no errors...
Re: post user error
May be the customValues are not updated properly. That needs a cross check.
Re: post user error
Ok thanks,
but how to do this cross check ?
but how to do this cross check ?
Re: post user error
It's very strange because i can register user with post/Users with the customValues ! But i can't modify this values with the putUser 
Re: post user error
Are you able to confirm what you're actually posting?
There is a possibility that you're posting back the old values.
Can you check log output or tcpdump output to verify what you're actually posting?
There is a possibility that you're posting back the old values.
Can you check log output or tcpdump output to verify what you're actually posting?
Re: post user error
In this example i want to change the Num_adherent_part to 423
PUT /api/users/-2852719781260026695 HTTP/1.1
Host: 192.168.100.14:8080
User-Agent: python-requests/2.21.0
Accept-Encoding: gzip, deflate
Accept: text/plain
Connection: keep-alive
Content-type: application/json
Content-Length: 189
Authorization: Basic YWRtaW5BUEk6QXplcnR5MTIzNDU2Nzg5
{"name": "Guillaume ROCHE TOTO", "username": "xxx@gmail.com", "email": "xxx@gmail.com", "hiddenFields": [], "version": 8, "customValues": {"Num_adherent_part": "423"}}HTTP/1.1 204
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
Date: Thu, 01 Sep 2022 20:08:59 GMT
Keep-Alive: timeout=20
Connection: keep-alive
But when i connect the user to cyclos, i have still the old Num_adherent_part
Thanks
Regards
PUT /api/users/-2852719781260026695 HTTP/1.1
Host: 192.168.100.14:8080
User-Agent: python-requests/2.21.0
Accept-Encoding: gzip, deflate
Accept: text/plain
Connection: keep-alive
Content-type: application/json
Content-Length: 189
Authorization: Basic YWRtaW5BUEk6QXplcnR5MTIzNDU2Nzg5
{"name": "Guillaume ROCHE TOTO", "username": "xxx@gmail.com", "email": "xxx@gmail.com", "hiddenFields": [], "version": 8, "customValues": {"Num_adherent_part": "423"}}HTTP/1.1 204
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
Date: Thu, 01 Sep 2022 20:08:59 GMT
Keep-Alive: timeout=20
Connection: keep-alive
But when i connect the user to cyclos, i have still the old Num_adherent_part
Thanks
Regards
Re: post user error
I solve this !
The problem came from the permssion of the admin groups !
Thanks to you !
Regards!
The problem came from the permssion of the admin groups !
Thanks to you !
Regards!