2isprime
2isprime•12mo ago

User is not getting updated on v2

He Team, With the recent change : https://github.com/zitadel/zitadel/pull/8635 The user details are not getting updated, I am on version 2.62 and on passing the user details in body, the response is 200, although the user details are not updated. PUT: http://custom_domain/v2/users/human/:userId Request Body:
{
"profile": {
"givenName": "Test",
"familyName": "USer",
"nickName": "''",
"displayName": "Test User",
"preferredLanguage": "und",
"gender": "GENDER_UNSPECIFIED"
},
"email": {
"email": "test@gmail.com",
"isVerified": true
},
"phone": {
"phone": "+9712222222"
}
}
{
"profile": {
"givenName": "Test",
"familyName": "USer",
"nickName": "''",
"displayName": "Test User",
"preferredLanguage": "und",
"gender": "GENDER_UNSPECIFIED"
},
"email": {
"email": "test@gmail.com",
"isVerified": true
},
"phone": {
"phone": "+9712222222"
}
}
Respone:
{
"details": {
"sequence": "1",
"changeDate": "2024-09-26T20:15:16.971158Z",
"resourceOwner": "286501988902895619"
}
}
{
"details": {
"sequence": "1",
"changeDate": "2024-09-26T20:15:16.971158Z",
"resourceOwner": "286501988902895619"
}
}
The user details are not updated
GitHub
fix: use body for update user on user v2 API by stebenz · Pull Requ...
Use body for update user endpoint on user v2 API.
21 Replies
FFO
FFO•12mo ago
Which version of 2.62 are you using? only 2.62.3 contains the patch of above PR
2isprime
2isprimeOP•12mo ago
nevermind...Bumped up the version to 2.62.3 just to understand for the previous version, where is the documentation to refere to?
FFO
FFO•12mo ago
what docs are you looking for exactly?
2isprime
2isprimeOP•12mo ago
To update the user info...for the older versions how would I be able to do that?
FFO
FFO•12mo ago
what do you mean by "older version"? that api had a bug so there is no new version 😄 https://zitadel.com/docs/apis/resources/user_service_v2/user-service-update-human-user
2isprime
2isprimeOP•12mo ago
https://zitadel.com/docs/apis/resources/user_service_v2/user-service-update-human-user earlier we were using PUT: /v2beta/users/${userId}?${params} passing evrything as params.... so upto v2.62.2 this is the only way to do?
FFO
FFO•12mo ago
no, that pr actually brought that you can use a body (which we use as default)
2isprime
2isprimeOP•12mo ago
my concern is on v 2.62.2, what should be the API that will work?
FFO
FFO•12mo ago
I do not understand your question, sorry. The api is exactly the same just the body was not working.
2isprime
2isprimeOP•12mo ago
the one from the doc is: https://$CUSTOM-DOMAIN/v2/users/human/:userId and the one we were using earlier was: https://$CUSTOM-DOMAIN/v2beta/users/:userId?{params} where there was no body and the details were passed as query params to be updated. I want to understand that below v 2.62.3 , I have to follow this way of passing data as query params? because https://$CUSTOM-DOMAIN/v2/users/human/:userId only works with 2.62.3
FFO
FFO•12mo ago
You should still be able to use param in 2.62.3 @stebenz correct me if I am wrong. The beta api graduated into a stable api recently but the design should be the same.
2isprime
2isprimeOP•12mo ago
Unfourtunately, it does not work...it gives 405 { "code": 12, "message": "Method Not Allowed" }
Unknown User
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
2isprime
2isprimeOP•12mo ago
yes, that correct
FFO
FFO•12mo ago
out of curiosity what method do you use?
2isprime
2isprimeOP•12mo ago
PUT
FFO
FFO•12mo ago
well, yeah that should not bring upt that error 😂
2isprime
2isprimeOP•12mo ago
so now I am only left with option to use /v2beta if I do not upgrade ?
FFO
FFO•12mo ago
if you do not upgrade zitadel or your code?
2isprime
2isprimeOP•12mo ago
Both actually😅 If i do not upgrade zitadel then I won’t be able to use the existing code and If I update the code , I won’t need able to use existing zitadel version 😅
FFO
FFO•12mo ago
so I would upgrade zitadel 😄

Did you find this page helpful?