It works just with:  PUT  -F

Thanks
On Friday, March 1, 2024 at 9:49:18 PM UTC+4 David Trowbridge wrote:

> 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
>
> On Fri, Mar 1, 2024 at 10:45 AM Lyova Pogosyan <lyovi...@gmail.com> wrote:
>
>> 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>"
>>
>> The response is as expected in example:
>> User Resource | Review Board latest Documentation | Review Board 
>> <https://www.reviewboard.org/docs/manual/latest/webapi/2.0/resources/user/#examples>
>>
>> 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>'}"
>>
>> -- 
>> 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
>>  
>> <https://groups.google.com/d/msgid/reviewboard/bd8cc1df-dbae-4b7c-a133-9637f1e74166n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/4c5085b1-331b-4642-9869-b233f329e2bdn%40googlegroups.com.

Reply via email to