Guild

Version 7 (nimetu, 12/18/2013 01:50 pm)

1 7 nimetu
h1. Guild
2 1 vl
3 7 nimetu
Access guild information.
4 1 vl
5 1 vl
h2. Base URL
6 1 vl
7 7 nimetu
* http://api.ryzom.com/guild.php?apikey=key
8 7 nimetu
* http://api.ryzom.com/guild.php?apikey[]=key1&apikey[]=key2
9 1 vl
10 1 vl
h2. URL Parameters
11 1 vl
12 5 nimetu
h3. @apikey@
13 1 vl
14 7 nimetu
Guild [[API Key]].
15 1 vl
16 1 vl
h2. Cache Duration
17 1 vl
18 1 vl
Guild xml element has attributes *created* and *cached_until* (utc timestamp)
19 1 vl
20 1 vl
h2. PHP Interface
21 1 vl
22 7 nimetu
h3. @ryzom_guild_api($apikey)@
23 1 vl
24 7 nimetu
@$apikey@ can be either string (single key) or array of strings.
25 1 vl
26 7 nimetu
On success, function returns associative array of *SimpleXMLElement* with @$apikey@ as array index.
27 5 nimetu
On failure, function returns boolean *false*.
28 1 vl
29 5 nimetu
h2. XML structure
30 1 vl
31 7 nimetu
API is able to return information about multiple guilds at once and so each *<guild>* element is child of *<ryzomapi>* root element
32 5 nimetu
@<ryzomapi>
33 1 vl
  <guild apikey="key1" created="1387369332" modules="G01:G02:G03:G04:P01" cached_until="1387369632">
34 5 nimetu
    ....
35 5 nimetu
  </guild>
36 5 nimetu
  <guild apikey="key2" created="1387369332" modules="P01" cached_until="1387369632">
37 5 nimetu
    ....
38 5 nimetu
  </guild>
39 5 nimetu
</ryzomapi>@
40 2 vl
41 5 nimetu
h3. Invalid key error
42 2 vl
43 7 nimetu
When provided key is invalid, then xml contains *<error>* element with *code* attribute.
44 5 nimetu
@<guild apikey="key1" created="1387369873">
45 5 nimetu
  <error code="404">invalid key</error>
46 6 nimetu
</guild>@
47 1 vl
48 5 nimetu
Possible error codes are listed on [[API error codes]].