Character

Version 10 (vl, 04/12/2009 10:42 am)

1 1 vl
h1. Character
2 1 vl
3 1 vl
h2. Base URL
4 1 vl
5 1 vl
http://atys.ryzom.com/characters/index.php
6 1 vl
7 1 vl
h2. Syntax
8 1 vl
9 7 vl
* *key*: [[API Key]] of the character (partial or full)
10 1 vl
11 1 vl
h2. Errors
12 1 vl
13 7 vl
* *E2*: Bad [[API Key]]
14 3 vl
* *E4*: Character is not found
15 1 vl
16 2 vl
h2. Update Frequency
17 2 vl
18 2 vl
The profile is updated every hour.
19 2 vl
20 1 vl
h2. PHP Example
21 1 vl
22 1 vl
<pre>
23 1 vl
<?
24 10 vl
$url = 'http://atys.ryzom.com/characters/index.php?key=<apikey>';
25 10 vl
$ch = curl_init();
26 10 vl
curl_setopt($ch, CURLOPT_URL, $url);
27 10 vl
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
28 10 vl
curl_setopt($ch, CURLOPT_ENCODING , 'gzip');
29 10 vl
$output = curl_exec($ch);
30 10 vl
curl_close($ch);
31 10 vl
$xml = simplexml_load_string($output);
32 1 vl
echo "Name: ".$xml->name;
33 1 vl
?>
34 1 vl
</pre>
35 1 vl
36 5 vl
will display the name of the character.
37 1 vl
38 1 vl
h2. Real Examples
39 8 vl
40 9 vl
* English: http://atys.ryzom.com/characters/example.php ("PHP Source Code":http://atys.ryzom.com/characters/example.php?src=1)