From ebbcce590483a5970268db0c59bae0cec81648ad Mon Sep 17 00:00:00 2001 From: Anita Kuno Date: Thu, 7 Jul 2016 13:15:41 -0400 Subject: [PATCH] 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 --- storyboard/api/v1/user_preferences.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/storyboard/api/v1/user_preferences.py b/storyboard/api/v1/user_preferences.py index 4a77d6d0..449e0d23 100644 --- a/storyboard/api/v1/user_preferences.py +++ b/storyboard/api/v1/user_preferences.py @@ -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. """