Changes between Initial Version and Version 1 of WebRpc


Ignore:
Timestamp:
Apr 25, 2007, 1:03:59 PM (17 years ago)
Author:
Nicolas
Comment:

Converted by an automatic script

Legend:

Unmodified
Added
Removed
Modified
  • WebRpc

    v1 v1  
     1= Web Remote Procedure Calls (RPCs) =
     2
     3
     4=== Contents ===
     5
     6 * [http://boinc.berkeley.edu/#overview Overview]
     7 * [http://boinc.berkeley.edu/#project_config# Project configuration]
     8 * [http://boinc.berkeley.edu/#create_account Create account]
     9 * [http://boinc.berkeley.edu/#lookup_account Lookup account]
     10 * [http://boinc.berkeley.edu/#am_get_info Get account info]
     11 * [http://boinc.berkeley.edu/#am_set_info Set account info]
     12 * [http://boinc.berkeley.edu/#am_set_host_info Set host info]
     13 * [http://boinc.berkeley.edu/#show_user Get account/host credit info]
     14 * [http://boinc.berkeley.edu/#create_team Create team]
     15 * [http://boinc.berkeley.edu/#team_lookup Lookup teams by name]
     16 * [http://boinc.berkeley.edu/#team_lookup_id Lookup team by ID]
     17 * [http://boinc.berkeley.edu/#team_email_list Get team member list]
     18 * [http://boinc.berkeley.edu/#edit_forum_preferences_action Set forum preferences]
     19 * [http://boinc.berkeley.edu/#forum_get_user_posts Get last user's posts from the forum]
     20 * [http://boinc.berkeley.edu/#forum_get_user_threads Get last user's threads from the forum]
     21 * [http://boinc.berkeley.edu/#apps Get list of applications and versions]
     22
     23
     24=== Overview ===
     25 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.
     26
     27BOINC's RPC mechanisms have the following conventions:
     28
     29
     30 * Each RPC is an HTTP GET transaction.
     31 * The input is the GET arguments, i.e. a string of the form
     32{{{
     33param1=val1&param2=val2&...&paramn=valn
     34}}}
     35      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).
     36 * If an RPC fails, the returned XML document is
     37{{{<error>
     38    <error_num>N</error_num>
     39    <error_string>xxx</error_string>
     40</error>}}}
     41      where N is a BOINC error number and xxx is a textual description. BOINC error numbers are in lib/error_numbers.h; common errors are:
     42
     43 '''-1'''::
     44        Generic error (error_string may have more info)
     45 '''-112'''::
     46        Invalid XML (e.g., the preferences passed to am_set_info.php are invalid)
     47 '''-136'''::
     48        Item not found in database     (bad ID of any sort, or ID refers to an item not owned by the caller)
     49 '''-137'''::
     50        Name is not unique (Can't create account because     email address already in use,     or can't create team because name is in use)
     51 '''-138'''::
     52        Can't access database (treat same as -183)
     53 '''-161'''::
     54        Item not found (deprecated; treat same as -136)
     55 '''-183'''::
     56        Project is temporarily down
     57 '''-205'''::
     58        Email address has invalid syntax
     59 '''-206'''::
     60        Wrong password
     61 '''-207'''::
     62        Non-unique email address (treat same as -137)
     63 '''-208'''::
     64        Account creation disabled
     65 * The output is XML.
     66 * If the project's [ProjectConfigRpc get_project_config.php] file includes a `<rpc_prefix>` element, its content should be used as the URL prefix; otherwise use the project's master URL.
     67
     68
     69=== Project configuration ===
     70 Each BOINC project exports some configuration items relevant to attaching and creating accounts. This RPC is documented [ProjectConfigRpc here].
     71=== Create account ===
     72
     73
     74 '''Create account''':: '''URL'''::
     75        project_url/create_account.php
     76 '''input'''::
     77        email_addr: email address         passwd_hash: the MD5 hash of the concatenation         of the user's password and the email address.                  user_name: the user name
     78 '''output'''::
     79       
     80{{{<account_out>
     81    <authenticator>XXX</authenticator>
     82</account_out>}}}
     83
     84 '''action'''::
     85        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.
     86
     87
     88
     89=== Look up account ===
     90
     91
     92 '''URL'''::
     93        project_url/lookup_account.php
     94 '''input'''::
     95        email_addr: email address                  [ passwd_hash ]: the MD5 hash of the concatenation         of the user's password and the email address.
     96 '''output'''::
     97       
     98{{{<account_out>
     99    [ <authenticator>XXX</authenticator> ]
     100</account_out>
     101    }}}
     102
     103 '''action'''::
     104        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.
     105
     106
     107
     108=== Get account info ===
     109
     110
     111 '''URL'''::
     112        project_url/am_get_info.php
     113 '''input'''::
     114        account_key
     115 '''output'''::
     116       
     117{{{<am_get_info_reply>
     118    <success/>
     119    <id>ID</id>
     120    <name>NAME</name>
     121    <country>COUNTRY</country>
     122    <postal_code>POSTAL_CODE</postal_code>
     123    <global_prefs>
     124        GLOBAL_PREFS
     125    </global_prefs>
     126    <project_prefs>
     127        PROJECT_PREFS
     128    </project_prefs>
     129    <url>URL</url>
     130    <send_email>SEND_EMAIL</send_email>
     131    <show_hosts>SHOW_HOSTS</show_hosts>
     132    <teamid>N</teamid>
     133    [ <teamfounder/> ]
     134    <venue>X</venue>
     135</am_get_info_reply>
     136    }}}
     137
     138 '''action'''::
     139        returns data associated with the given account
     140
     141
     142
     143=== Set account info ===
     144
     145
     146 '''URL'''::
     147        project_url/am_set_info.php
     148 '''input'''::
     149        account_key     [ name ]     [ country ]     [ postal_code ]     [ global_prefs ]     [ project_prefs ]     [ url ]     [ send_email ]     [ show_hosts ]     [ teamid ]  ''zero means quit current team, if any''     [ venue ]     [ email_addr ]     [ password_hash ]
     150 '''output'''::
     151       
     152{{{<am_set_info_reply>
     153    <success/>
     154</am_set_info_reply>}}}
     155
     156 '''action'''::
     157        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.
     158
     159
     160
     161=== Set host info ===
     162
     163
     164 '''URL'''::
     165        project_url/am_set_host_info.php
     166 '''input'''::
     167        account_key     hostid     venue
     168 '''output'''::
     169       
     170{{{<am_set_host_info_reply>
     171    <success/>
     172</am_set_host_info_reply>}}}
     173
     174 '''action'''::
     175        Updates the host's venue
     176
     177
     178
     179=== Get account/host credit information ===
     180
     181
     182 '''URL'''::
     183        project/show_user.php?userid=X&format=xml or     project/show_user.php?auth=X&format=xml
     184 '''input'''::
     185        id (user ID) or auth (account key)
     186 '''output'''::
     187       
     188{{{<user>
     189    <id>123</id>
     190    <cpid>fe0b2753a355b17864ec061eb1b9e8de</cpid>
     191    <create_time>918948493</create_time>
     192    <name>Joe Smith</name>
     193    <country>United States</country>
     194    <total_credit>3806.869739</total_credit>
     195    <expavg_credit>200</expavg_credit>
     196    <expavg_time>1110833427.64028</expavg_time>
     197    <teamid>114322</teamid>
     198    <url>example.com</url>
     199    <has_profile>1</has_profile>
     200</user>
     201
     202or
     203
     204<user>
     205    <id>123</id>
     206    <cpid>fe0b2753a355b17864ec061eb1b9e8de</cpid>
     207    <create_time>1101918807</create_time>
     208    <name>David</name>
     209    <country>United States</country>
     210    <total_credit>0.293197</total_credit>
     211    <expavg_credit>0.000883</expavg_credit>
     212    <expavg_time>1116963330.83107</expavg_time>
     213    <teamid>0</teamid>
     214    <url>example.com</url>
     215    <has_profile>1</has_profile>
     216    <host>
     217        <id>123</id>
     218        <create_time>1287339128</create_time>
     219        <rpc_seqno>123</rpc_seqno>
     220        <host_cpid>fe0b2753a355b17864ec061eb1b9e8de</host_cpid>
     221        <total_credit>0</total_credit>
     222        <expavg_credit>0</expavg_credit>
     223        <expavg_time>0</expavg_time>
     224        <domain_name>Sorabji</domain_name>
     225        <p_ncpus>1</p_ncpus>
     226        <p_vendor>Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz</p_vendor>
     227        <p_model>Pentium</p_model>
     228        <p_fpops>330806175.78458</p_fpops>
     229        <p_iops>409200165.535107</p_iops>
     230        <os_name>Microsoft Windows XP</os_name>
     231        <os_version>Professional Edition, Service Pack 2, (05.01.2600.00)</os_version>
     232    </host>
     233    ...
     234</user>
     235}}}
     236
     237 '''action'''::
     238        Returns info about an account.     If called with the account key,     returns a list of hosts associated with the account.
     239
     240
     241
     242=== Create team ===
     243
     244
     245 '''URL'''::
     246        project/create_team.php
     247 '''input'''::
     248        account_key: identifies team founder name: name of team url: team URL (optional) type: one of the types listed [http://boinc.berkeley.edu/team_types.php here]. name_html: team name, HTML (optional) description: text describing team (optional) country: team country (optional; if present, must be one of the countries listed [http://boinc.berkeley.edu/countries.php here].
     249 '''output'''::
     250       
     251{{{<create_team_reply>
     252    <success/>
     253    <teamid>N</teamid>
     254</create_team_reply>
     255}}}
     256
     257 '''action'''::
     258        Creates a team
     259
     260
     261
     262=== Look up teams by name ===
     263
     264
     265 '''URL'''::
     266        project/team_lookup.php?team_name=string&format=xml
     267 '''input'''::
     268        Substring of team name
     269 '''output'''::
     270       
     271{{{<teams>
     272    <team>
     273        <id>5</id>
     274        <name>BOINC@AUSTRALIA</name>
     275        <country>Australia</country>
     276    </team>
     277    <team>
     278        <id>9</id>
     279        <name>BOINC Synergy</name>
     280        <country>International</country>
     281    </team>
     282    <team>
     283        <id>16</id>
     284        <name>BOINC.BE</name>
     285        <country>Belgium</country>
     286    </team>
     287    <team>
     288        <id>23</id>
     289        <name>HispaSeti & BOINC</name>
     290        <country>International</country>
     291    </team>
     292</teams
     293}}}
     294
     295 '''action'''::
     296        Teams with names matching *string* will be returned.     A maximum of 100 teams will be returned.
     297
     298
     299
     300=== Look up team by ID ===
     301
     302
     303 '''URL'''::
     304        project/team_lookup.php?team_id=N
     305 '''input'''::
     306        Team ID
     307 '''output'''::
     308       
     309{{{<team>
     310    <id>5</id>
     311    <name>BOINC@AUSTRALIA</name>
     312    <country>Australia</country>
     313</team>
     314}}}
     315
     316 '''action'''::
     317        Show info on team with the given ID.
     318
     319
     320
     321=== Get team member list ===
     322
     323
     324 '''URL'''::
     325        project/team_email_list.php?teamid=X&account_key=Y&xml=1
     326 '''input'''::
     327        teamid: database ID of team     account_key: account key of team founder (optional)
     328 '''output'''::
     329       
     330{{{<users>
     331    <user>
     332        <id>1</id>
     333        <email_addr>pdq@usndathoople.edu</email_addr>
     334        <cpid>232f381c79336f0bd8df02bbce2f2217</cpid>
     335        <create_time>1076897105</create_time>
     336        <name>David</name>
     337        <country>United States</country>
     338        <total_credit>9.907264</total_credit>
     339        <expavg_credit>0.023264</expavg_credit>
     340        <expavg_time>1142628426.48937</expavg_time>
     341        <url>usndathoople.edu/~pdq</url>
     342        <has_profile>1</has_profile>
     343    </user>
     344    [ ... ]
     345</users>}}}
     346
     347 '''action'''::
     348        Show list of team members.     If account key is that of team founder, show email addresses.
     349
     350
     351
     352=== Set forum preferences ===
     353
     354
     355 '''URL'''::
     356        project/edit_forum_preferences_action.php          NOTE: this uses POST, not GET
     357 '''input'''::
     358        account_key     avatar_url ''Note: the image will be downloaded and stored locally. Only JPG and PNG accepted.''     avatar_select     forum_images_as_links     forum_link_externally     forum_hide_avatars     forum_hide_signatures     forum_jump_to_unread     forum_ignore_sticky_posts     forum_low_rating_threshold     forum_high_rating_threshold     forum_minimum_wrap_postcount     forum_display_wrap_postcount     signature_enabled     signature     forum_sort     thread_sort     faq_sort     answer_sort     forum_filter_user     [ removeID ... ]
     359 '''output'''::
     360        A lot of HTML (not XML)
     361 '''action'''::
     362        Update user's forum preferences
     363
     364
     365
     366=== Get last user's posts from the forum ===
     367
     368
     369 '''URL'''::
     370        project/forum_get_data.php?method=user_posts&userid=N&count=N
     371 '''input'''::
     372        userid: numeric user ID in the database     count ''(optional)'': number of entries to return. Maximum 50, default 10.
     373 '''output'''::
     374       
     375{{{<rpc_response>
     376    <count>1</count>
     377    <posts>
     378        <post>
     379        <id>4157</id>
     380        <threadid>76</threadid>
     381        <timestamp>1162847905</timestamp>
     382        <content><![CDATA[Example post content (truncated to 100 characters).]]></content>
     383        </post>
     384        [ ... ]
     385    </posts>
     386</rpc_response>}}}
     387
     388 '''action'''::
     389        Get last user's posts from the forum.
     390
     391
     392
     393=== Get last user's threads from the forum ===
     394
     395
     396 '''URL'''::
     397        project/forum_get_data.php?method=user_threads&userid=N&count=N
     398 '''input'''::
     399        userid: numeric user ID in the database     count ''(optional)'': number of entries to return. Maximum 50, default 10.
     400 '''output'''::
     401       
     402{{{<rpc_response>
     403    <count>1</count>
     404    <threads>
     405        <thread>
     406            <id>356</id>
     407            <forumid>2</forumid>
     408            <replies>11</replies>
     409            <views>612</views>
     410            <timestamp>1159062318</timestamp>
     411            <title><![CDATA[Example forum thread title]]></title>
     412        </thread>
     413        [...]
     414    </threads>
     415</rpc_response>}}}
     416
     417 '''action'''::
     418        Get last user's threads from the forums.
     419
     420
     421
     422=== Get list of application versions ===
     423
     424
     425 '''URL'''::
     426        project/apps.php
     427 '''output'''::
     428        List of applications and application versions;     this shows what platforms are supported by the project.
     429
     430