[[PageOutline]] = Web Remote Procedure Calls (RPCs) = BOINC projects export a number of Web RPCs for creating, querying and updating accounts and host records, and miscellaneous other purposes. These can be used for [AccountManagement account management systems] and credit statistics web sites. BOINC's RPC mechanisms have the following conventions: * Each RPC is an HTTP GET transaction. * The input is the GET arguments, i.e. a string of the form {{{ ?param1=val1¶m2=val2&...¶mn=valn }}} where param1 ... paramN are the parameter names, and val1 ... valn are the values. Parameter values must be URL-encoded (for example, using PHP's `urlencode` function). * The output is XML. * If the project's [#get_project_config get_project_config.php] file includes a `` element, its content should be used as the URL prefix; otherwise use the project's master URL. * Optional values are shown enclosed in square brackets. * If an RPC fails, the returned XML document is {{{ N xxx }}} where N is a BOINC error number and xxx is a textual description. BOINC error numbers are in [source:trunk/boinc/lib/error_numbers.h lib/error_numbers.h]; common errors are: '''-1''':: Generic error (error_string may have more info) '''-112''':: Invalid XML (e.g., the preferences passed to am_set_info.php are invalid) '''-136''':: Item not found in database (bad ID of any sort, or ID refers to an item not owned by the caller) '''-137''':: Name is not unique (Can't create account because email address already in use, or can't create team because name is in use) '''-138''':: Can't access database (treat same as -183) '''-161''':: Item not found (deprecated; treat same as -136) '''-183''':: Project is temporarily down '''-205''':: Email address has invalid syntax '''-206''':: Wrong password '''-207''':: Non-unique email address (treat same as -137) '''-208''':: Account creation disabled == Project configuration == #get_project_config '''URL''':: project_url/get_project_config.php '''input''':: none. [[BR]] '''examples''':: http://setiathome.berkeley.edu/get_project_config.php '''output''':: This file is created by [MakeProject make_project], and in most cases you don't have to change it. This document has this structure: {{{ Project name URL [ 12345 ] [ 0|1 ] [ ] [ ] [ N ] [ ] [ ] [ URL ] [ N ] [ i686-apple-darwin Mac OS X (Intel) i686-pc-linux-gnu Linux/x86 ... ] [ 0|1 ] [ [ N ] [ N ] [ N ] [ N ] [ N ] [ N ] [ N ] [ N ] ] }}} The elements are: {{{ #!html }}} name:: {{{ #!html }}} Project name {{{ #!html }}} master_url:: {{{ #!html }}} Master URL {{{ #!html }}} local_revision:: {{{ #!html }}} The SVN changeset number of the project's server software. {{{ #!html }}} web_stopped:: {{{ #!html }}} Nonzero if the project's database is down, which means the data-driven web pages are turned off. {{{ #!html }}} local_revision:: {{{ #!html }}} Nonzero if the project's scheduler server is down, which means you can't get new work or report completed work. {{{ #!html }}} account_creation_disabled:: {{{ #!html }}} If present, this project is not allowing creation of new accounts {{{ #!html }}} min_passwd_length:: {{{ #!html }}} Minimum password length (for new account creation) {{{ #!html }}} account_manager:: {{{ #!html }}} If present, this is an account manager, not a BOINC project {{{ #!html }}} uses_username:: {{{ #!html }}} If present, this project uses names (rather than email addresses) as the primary account identifier {{{ #!html }}} client_account_creation_disabled:: {{{ #!html }}} If present, new accounts can be created only via the web (not via the client software). {{{ #!html }}} rpc_prefix:: {{{ #!html }}} Prefix to use for web RPCs, instead of the master URL. {{{ #!html }}} error_num:: {{{ #!html }}} The project is currently down. A BOINC error number is returned. {{{ #!html }}} platforms:: {{{ #!html }}} A list of platforms for which the project has application versions. {{{ #!html }}} system_requirements:: {{{ #!html }}} Hardware requirements for participating in this project. If a computer doesn't meet these requirements it may not get sent any work by the project. All requirements are 'net'; e.g. the CPU requirements are after factors like [ClientSched on-fraction, active-fraction], and resource share have been taken into consideration. NOT IMPLEMENTED YET. '''action''':: Each BOINC project and account manager exports it's configuration via the get_project_config web RPC. == Server status == #server_status '''URL''':: project_url/server_status.php '''input''':: none. [[BR]] '''examples''':: http://einstein.phys.uwm.edu/server_status.php '''output''':: {{{ 1128535206 jocelyn BOINC database running castelli master science database running klaatu data-driven web pages disabled galileo feeder not running 614830 1208959 8 2 4 15 0.00083333334 }}} '''action''':: XML export generally updated every 10 minutes or so - do not poll more often than that. Status is used to make web sites showing the server status of multiple BOINC projects. == Create account == #create_account '''URL''':: project_url/create_account.php '''input''':: {{{email_addr}}}: email address. [[BR]] {{{passwd_hash}}}: the MD5 hash of the concatenation of the user's password and the email address.[[BR]] {{{user_name}}}: the user name.[[BR]] '''examples''':: http://ralph.bakerlab.org/create_account.php?email_addr=feet1st@noyaspamhoo.com&passwd_hash=2ab548fae3162ccfa1a2d41a55557a92&user_name=CrunchAll '''output''':: {{{ XXX }}} '''action''':: If the project already has an account with that email address, and a different password, it returns an error. If an account with that email address exists and has the same password, it returns the authenticator. Otherwise the project creates an account and returns the authenticator. == Look up account == #lookup_account '''URL''':: project_url/lookup_account.php '''input''':: {{{email_addr}}}: email address [[BR]] [ {{{passwd_hash}}}: ] the MD5 hash of the concatenation of the user's password and the email address. [[BR]] '''examples''':: http://ralph.bakerlab.org/lookup_account.php?email_addr=feet1st@noyaspamhoo.com&passwd_hash=2ab598faf3160ccfa1a2d41a95557a92 '''output''':: {{{ [ XXX ] }}} '''action''':: If an account with the given email address doesn't exist, return an error. If passwd_hash is given and is correct, return the account key. == Get account info == #am_get_info '''URL''':: project_url/am_get_info.php '''input''':: {{{account_key}}}: '''examples''':: '''output''':: {{{ ID NAME COUNTRY WEAK_AUTH POSTAL_CODE GLOBAL_PREFS PROJECT_PREFS URL SEND_EMAIL SHOW_HOSTS N [ ] X }}} '''action''':: returns data associated with the given account == Set account info == #am_set_info '''URL''':: project_url/am_set_info.php '''input''':: {{{account_key}}}: [[BR]] [ {{{name}}}: ] [[BR]] [ {{{country}}}: ] [[BR]] [ {{{postal_code}}}: ] [[BR]] [ {{{global_prefs}}}: ] [[BR]] [ {{{project_prefs}}}: ] [[BR]] [ {{{url}}}: ] [[BR]] [ {{{send_email}}}: ] [[BR]] [ {{{show_hosts}}}: ] [[BR]] [ {{{teamid}}}: ] ''zero means quit current team, if any'' [[BR]] [ {{{venue}}}: ] [[BR]] [ {{{email_addr}}}: ] [[BR]] [ {{{password_hash}}}: ] [[BR]] '''examples''':: '''output''':: {{{ }}} '''action''':: Updates one or more attributes of the given account. The password hash is MD5(password+lower_case(email_addr)). If email address is changed, you must also change the password hash. == Set host info == #am_set_host_info '''URL''':: project_url/am_set_host_info.php '''input''':: {{{account_key}}}: [[BR]] {{{hostid}}}: [[BR]] {{{venue}}}: [[BR]] '''examples''':: '''output''':: {{{ }}} '''action''':: Updates the host's venue == Get account/host credit information == #show_user '''URL''':: project/show_user.php '''input''':: {{{id}}}: (user ID) or auth: (account key) [[BR]] {{{format}}}: output formatting. 'xml' is only supported value (deafult is HTML formatting) [[BR]] '''examples''':: http://boinc.bakerlab.org/rosetta/show_user.php?userid=123&format=xml http://boinc.bakerlab.org/rosetta/show_user.php?auth=X&format=xml '''output''':: {{{ 123 fe0b2753a355b17864ec061eb1b9e8de 918948493 Joe Smith United States 3806.869739 200 1110833427.64028 114322 example.com 1 or 123 fe0b2753a355b17864ec061eb1b9e8de 1101918807 David United States 0.293197 0.000883 1116963330.83107 0 example.com 1 123 1287339128 123 fe0b2753a355b17864ec061eb1b9e8de 0 0 0 Sorabji 1 Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz Pentium 330806175.78458 409200165.535107 Microsoft Windows XP Professional Edition, Service Pack 2, (05.01.2600.00) ... }}} '''action''':: Returns info about an account. If called with the account key, returns a list of hosts associated with the account. == Get result list with pending credit == #pending '''URL''':: project/pending.php '''input''':: {{{format}}}: Output formatting. 'xml' is only supported value (deafult is HTML formatting) [[BR]] {{{authenticator}}}: [[BR]] '''examples''':: http://boinc.bakerlab.org/rosetta/pending.php?format=xml&authenticator=X '''output''':: {{{ N N N N [...] N }}} == Create team == #create_team '''URL''':: project/create_team.php '''input''':: {{{account_key}}}: identifies team founder. [[BR]] {{{name}}}: name of team. [[BR]] [ {{{url}}} ]: team URL. [[BR]] {{{type}}}: one of [/team_types.php these types]. [[BR]] [ {{{name_html}}} ]: team name, with HTML formatting. [[BR]] [ {{{description}}} ]: text describing team. [[BR]] [ {{{country}}} ]: team country (if present, must be one of [/countries.php these countries]). [[BR]] '''examples''':: '''output''':: {{{ N }}} '''action''':: Creates a team == Look up teams by name == #team_lookup_name '''URL''':: project/team_lookup.php '''input''':: {{{team_name}}}: Substring of team name [[BR]] [ {{{format}}} ]: Output formatting. 'xml' is only supported value (deafult is HTML formatting) [[BR]] '''examples''':: http://boinc.bakerlab.org/team_lookup.php?team_name=BOINC&format=xml '''output''':: {{{ 5 BOINC@AUSTRALIA Australia 9 BOINC Synergy International 16 BOINC.BE Belgium 23 HispaSeti & BOINC International 9 1109465921 77 BOINC Synergy www.boincsynergy.com 1 International 226527.840602 12.798762 1178908429.9883 }}} '''action''':: Show info on team with the given ID. == Get team member list == #team_email_list '''URL''':: project/team_email_list.php '''input''':: {{{teamid}}}: database ID of team [[BR]] {{{account_key}}}: account key of team founder (optional) [[BR]] {{{xml}}}: output formatting. 0=HTML, 1=XML. (default is 0) [[BR]] '''examples''':: http://boinc.bakerlab.org/rosetta/team_email_list.php?teamid=2241&account_key=Y&xml=1 '''output''':: {{{ 1 pdq@usndathoople.edu yes|no 232f381c79336f0bd8df02bbce2f2217 1076897105 David United States 9.907264 0.023264 1142628426.48937 usndathoople.edu/~pdq 1 [ ... ] }}} '''action''':: Show list of team members. If account key is that of a team admin, show email addresses, and flags indicating whether the user opted out of getting emails. == Set forum preferences == #edit_forum_preferences '''URL''':: project/edit_forum_preferences_action.php [[BR]] (NOTE: this uses POST, not GET) '''input''':: {{{account_key}}}: [[BR]] {{{avatar_url}}}: ''Note: the image will be downloaded and stored locally. Only JPG and PNG accepted.'' [[BR]] {{{avatar_select}}}: [[BR]] {{{forum_images_as_links}}}: [[BR]] {{{forum_link_externally}}}: [[BR]] {{{forum_hide_avatars}}}: [[BR]] {{{forum_hide_signatures}}}: [[BR]] {{{forum_jump_to_unread}}}: [[BR]] {{{forum_ignore_sticky_posts}}}: [[BR]] {{{forum_low_rating_threshold}}}: [[BR]] {{{forum_high_rating_threshold}}}: [[BR]] {{{forum_minimum_wrap_postcount}}}: [[BR]] {{{forum_display_wrap_postcount}}}: [[BR]] {{{signature_enabled}}}: [[BR]] {{{signature}}}: [[BR]] {{{forum_sort}}}: [[BR]] {{{thread_sort}}}: [[BR]] {{{faq_sort}}}: [[BR]] {{{answer_sort}}}: [[BR]] {{{forum_filter_user}}}: [[BR]] [ {{{removeID}}}: ... ] [[BR]] '''examples''':: '''output''':: A lot of HTML (not XML) '''action''':: Update user's forum preferences == Get user's last posts on the forum == #forum_get_data_user_posts '''URL''':: project/forum_get_data.php '''input''':: {{{method}}}: [[BR]] "user_posts" to retrieve post details, [[BR]] "user_threads" to retrieve thread details.[[BR]] {{{userid}}}: numeric user ID in the database[[BR]] [ {{{count}}} ]: number of entries to return. Maximum 50, default 10.[[BR]] [ {{{contentlength}}} ]: number of characters to return from post content. Default returns whole post. Only used when method=user_posts. '''examples''':: http://setiathome.berkeley.edu/forum_get_data.php?method=user_posts&userid=18&count=20&contentlength=256 http://setiathome.berkeley.edu/forum_get_data.php?method=user_threads&userid=182&count=20 '''output''':: {{{ 1 4157 76 1162847905 [ ... ] }}} or {{{ 1 356 2 11 612 1159062318 <![CDATA[Example forum thread title]]> [...] }}} '''action''':: Get user's last posts from the forum, or get user's last threads from the forums. == Get list of application versions == #apps '''URL''':: project/apps.php '''input''':: [ {{{xml}}} ]: output formatting. 0=HTML, 1=XML. (default is 0) '''examples''':: http://setiathome.berkeley.edu/apps.php?xml=1 '''output''':: List of applications and application versions. For example: {{{ Upper Case i686-pc-linux-gnu Linux/x86 511 21 Apr 2006 19:38:26 UTC 1145648306 windows_intelx86 Windows/x86 515 8 May 2007 21:15:42 UTC 1178658942 ... }}}