The eviewboard api does not change users emails

18 views
Skip to first unread message

Lyova Pogosyan

unread,
Mar 1, 2024, 12:45:14 PMMar 1
to Review Board Community
Hi,

I am using RB 6.0.2 and I want to change multiply users emails, so I need to use the api.
I tried many options, but I could not update any user's email.

My query is:
curl -H "Authorization: token <MY_TOKEN>" -H "Accept: application/json" -X PUT "https://<MY_SITE>/api/users/<USERNAME>/?email=<NEW_EMAIL>"


Just the users email is not updated

Also I have tried to send json header but the result is same:
curl -H "Authorization: token <MY_TOKEN>" -H "Accept: application/json" -X PUT "https://<MY_SITE>/api/users/<USERNAME>/" -H "Content-Type: application/json" -d "{'email': '<NEW_EMAIL>'}"

David Trowbridge

unread,
Mar 1, 2024, 12:49:18 PMMar 1
to revie...@googlegroups.com
Parameters to PUT and POST operations in the API need to be specified as form-data, not query parameters or JSON. This can be done with the -F parameter to curl:

curl -H "Authorization: ..." -H "Accept: ..." -X PUT-F "email=<NEW_EMAIL>" https://<MY_SITE>/api/users/<USERNAME>/

David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/bd8cc1df-dbae-4b7c-a133-9637f1e74166n%40googlegroups.com.

Lyova Pogosyan

unread,
Mar 4, 2024, 10:20:43 AMMar 4
to Review Board Community
It works just with:  PUT  -F

Thanks
Reply all
Reply to author
Forward
0 new messages