|
Accessing and modifying user preferences
|
change_preference | Change the value of a preference. |
preference | Get information on a given preference (or group). |
preferences | Get information on multiple preferences. |
values | Fetch the values of a single preference for multiple users. (administrative) |
services/uprefs/change_preference ¶
|
||||||
https://apps.usos.pw.edu.pl/services/uprefs/change_preference | ||||||
Change the value of a preference. | ||||||
upref_id | required | Preference ID. (This has to be a non-group-type preference.) | ||||
value | required |
The new value of the preference. For boolean (checkbox) preferences use "true" or "false". |
||||
format | optional |
Default value: json Format in which to return values. See supported output formats. |
||||
callback | optional |
Required only if you've chosen jsonp as a return format. |
||||
Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus required oauth_token for Token authorization. | ||||||
Returned value:
In case of failure, use the user_messages field to display a proper message for the user. |
services/uprefs/preference ¶
|
||||||
https://apps.usos.pw.edu.pl/services/uprefs/preference | ||||||
Get information on a given preference (or group). | ||||||
upref_id | required |
ID of the user preference (or group of preferences). Most of the IDs are not backward-compatible. They may either disappear or change their type or meaning at any time. You should not hardcode any of these IDs in your code, unless it is a predefined ID:
|
||||
fields | required |
Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section. |
||||
preferred_types | optional |
Default value: (empty string) Pipe-separated list of preference types which you are able to display properly. See the "returns" section for current list of types. In time, we will be adding more preference types. Some of them might be quite complex. However, many preferences might still be expressed using the "legacy" types, e.g. textboxes or checkboxes. If we know that you don't support some new types of preferences, we may choose to convert them to the "legacy" types, supported by you. This parameter is optional, but recommended. If you don't supply this value, we will currently assume that you can understand every preference we can think of. Keep in mind, that these are only preferred types. This means that we may still include unknown types in the response and you must ignore preferences with such unknown types. |
||||
format | optional |
Default value: json Format in which to return values. See supported output formats. |
||||
callback | optional |
Required only if you've chosen jsonp as a return format. |
||||
Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus required oauth_token for Token authorization. | ||||||
Returned value: A dictionary of selected fields and their values. Available fields:
|
services/uprefs/preferences ¶
|
||||||
https://apps.usos.pw.edu.pl/services/uprefs/preferences | ||||||
Get information on multiple preferences. | ||||||
upref_ids | required | Pipe-separated list of preference IDs. | ||||
fields | required |
Selector of result fields you are interested in. The selector may contain any subset of fields, which are described in the returns section of preference method. |
||||
preferred_types | optional |
Default value: (empty string) Same as in the preference method. |
||||
format | optional |
Default value: json Format in which to return values. See supported output formats. |
||||
callback | optional |
Required only if you've chosen jsonp as a return format. |
||||
Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Plus optional oauth_token for Token authorization. | ||||||
Returned value: A dictionary: your upref_ids will be mapped to dictionary's keys, and each value will contain the description of one preference, as defined in the preference method. |
services/uprefs/values ¶
Administrative: This method requires a proper Administrative Consumer Key. Contact us to get one.
|
||||||
https://apps.usos.pw.edu.pl/services/uprefs/values | ||||||
This method allows you to retrieve current values of a single preference for multiple users. Only some preferences can be fetched this way. Important: Since preference IDs are not backward compatible, this method should be avoided! It is intended to be used primarily from within USOS API itself, in order to properly determine the effective outcomes, which are later exposed in other, specialized methods. Before you use this method, make sure no such specialized methods exist, you may also contact us and we may provide such specialized methods for you. | ||||||
upref_id | required | ID of the preference. Only some preferences can be fetched using this method. If the given preference ID is not supported, then you will get a HTTP 400 response. | ||||
user_ids | required | Pipe-separated list of user IDs. They must be valid user IDs, if they're not, then the results are undetermined - you may get an error, but you may also get fake/invalid values. | ||||
format | optional |
Default value: json Format in which to return values. See supported output formats. |
||||
callback | optional |
Required only if you've chosen jsonp as a return format. |
||||
Plus required standard OAuth Consumer signing arguments: oauth_consumer_key, oauth_nonce, oauth_timestamp, oauth_signature, oauth_signature_method, oauth_version. Token is not required. | ||||||
Returned value: A dictionary: your user_ids will be mapped to dictionary's keys, and each value will contain the current value of the preference, as defined in the value field in the preference method. If the given preference is unknown or not supported, then you will get a HTTP 400 response. |