Guild
Version 8 (nimetu, 12/18/2013 01:56 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 | 8 | nimetu | <pre><code class="xml"> |
33 | 8 | nimetu | <ryzomapi> |
34 | 1 | vl | <guild apikey="key1" created="1387369332" modules="G01:G02:G03:G04:P01" cached_until="1387369632"> |
35 | 5 | nimetu | .... |
36 | 5 | nimetu | </guild> |
37 | 5 | nimetu | <guild apikey="key2" created="1387369332" modules="P01" cached_until="1387369632"> |
38 | 1 | vl | .... |
39 | 1 | vl | </guild> |
40 | 8 | nimetu | </ryzomapi> |
41 | 8 | nimetu | </code></pre> |
42 | 5 | nimetu | |
43 | 1 | vl | h3. Invalid key error |
44 | 1 | vl | |
45 | 1 | vl | When provided key is invalid, then xml contains *<error>* element with *code* attribute. |
46 | 8 | nimetu | <pre><code class="xml"> |
47 | 8 | nimetu | <guild apikey="key1" created="1387369873"> |
48 | 5 | nimetu | <error code="404">invalid key</error> |
49 | 8 | nimetu | </guild> |
50 | 8 | nimetu | </code></pre> |
51 | 1 | vl | |
52 | 5 | nimetu | Possible error codes are listed on [[API error codes]]. |