Sync Gateway REST API

62 views
Skip to first unread message

Marcus Roberts

unread,
Sep 17, 2014, 6:23:17 AM9/17/14
to mobile-c...@googlegroups.com
I'm able to successfully create users through the Sync gateway using a PUT with the username/email/password channels I want.

When I try to do a POST just to change the password I get a 405 method not allowed.

If I do a PUT I can change the password, but it overwrites all the other settings (e.g. admin_roles, admin_channels).

Is it possible to update the password (or other attributes like channels) by doing a POST, or do I need to retrieve the object, update the values, and then PUT them all back again?

Traun Leyden

unread,
Sep 17, 2014, 2:18:21 PM9/17/14
to mobile-c...@googlegroups.com

POST is for creating new users, not updating existing users.

I think you'll need to do a PUT with the new values, even the ones you don't want to change.

There's another HTTP verb called PATCH which is more like a "sparse PUT", so you would only be updating the password .. but I don't think Sync Gateway supports this yet.



--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/9a34329d-1594-486e-b4ee-76e4eb3022b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages