Guild
Version 5 (nimetu, 12/18/2013 01:37 pm)
| 1 | 1 | vl | h1. guild |
|---|---|---|---|
| 2 | 1 | vl | |
| 3 | 5 | nimetu | Access information from a guild. |
| 4 | 1 | vl | |
| 5 | 1 | vl | h2. Base URL |
| 6 | 1 | vl | |
| 7 | 5 | nimetu | * http://api.ryzom.com/api/guild.php?apikey=key |
| 8 | 5 | nimetu | * http://api.ryzom.com/api/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 | 1 | vl | The [[API Key]] of the *guild*. |
| 15 | 1 | vl | |
| 16 | 1 | vl | h2. Cache Duration |
| 17 | 1 | vl | |
| 18 | 1 | vl | The information are cached for *1 hour*. |
| 19 | 5 | nimetu | Guild xml element has attributes *created* and *cached_until* (utc timestamp) |
| 20 | 1 | vl | |
| 21 | 1 | vl | h2. PHP Interface |
| 22 | 1 | vl | |
| 23 | 5 | nimetu | h3. @ryzom_guild_api($key)@ |
| 24 | 1 | vl | |
| 25 | 5 | nimetu | @$key@ can be either string (single key) or array of strings. |
| 26 | 1 | vl | |
| 27 | 5 | nimetu | On success, function returns associative array of *SimpleXMLElement* with @$key@ as array index. |
| 28 | 5 | nimetu | On failure, function returns boolean *false*. |
| 29 | 1 | vl | |
| 30 | 5 | nimetu | h2. XML structure |
| 31 | 1 | vl | |
| 32 | 5 | nimetu | API is able to return information about multiple guilds at once and so each @<guild>@ element is child of @<ryzomapi>@ root element |
| 33 | 5 | nimetu | @<ryzomapi> |
| 34 | 5 | nimetu | <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 | 5 | nimetu | .... |
| 39 | 5 | nimetu | </guild> |
| 40 | 5 | nimetu | </ryzomapi>@ |
| 41 | 2 | vl | |
| 42 | 5 | nimetu | h3. Invalid key error |
| 43 | 2 | vl | |
| 44 | 5 | nimetu | When provided key is invalid, then xml contains @<error>@ element with @code@ attribute. |
| 45 | 5 | nimetu | @<guild apikey="key1" created="1387369873"> |
| 46 | 5 | nimetu | <error code="404">invalid key</error> |
| 47 | 5 | nimetu | </character>@ |
| 48 | 1 | vl | |
| 49 | 5 | nimetu | Possible error codes are listed on [[API error codes]]. |