Add example commands for the User Preferences api

Currently the api documentation does not include example commands.
It would be very friendly for our users to have some example
commands to follow and use the api.

This patch adds examples to the User Preferences section of
the api documentation.

Change-Id: I31b01e58c5c42181d226c0fe263f7825baf9e971
This commit is contained in:
Anita Kuno 2016-07-07 13:15:41 -04:00
parent 5a4da2cf51
commit ebbcce5904

@ -42,6 +42,11 @@ class UserPreferencesController(rest.RestController):
def get_all(self, user_id):
"""Return all preferences for the current user.
Example::
curl https://my.example.org/api/v1/users/21/preferences \\
-H 'Authorization: Bearer MY_ACCESS_TOKEN'
:param user_id: An ID of the user.
"""
@ -59,6 +64,13 @@ class UserPreferencesController(rest.RestController):
"""Allow a user to update their preferences. Note that a user must
explicitly set a preference value to Null/None to have it deleted.
Example::
curl https://my.example.org/api/v1/users/21/preferences \\
-H 'Authorization: Bearer MY_ACCESS_TOKEN' \\
-H 'Content-Type: application/json;charset=UTF-8' \\
--data-binary '{"display_events_tags_added":"false"}'
:param user_id: The ID of the user whose preferences we're updating.
:param body: A dictionary of preference values.
"""