Plus Exchange
From EQdkp Plus Wiki
| Information
|
| min. EQDKP-PLUS Version | 0.7.0.0
|
What is Plus Exchange (pex)
Plus Exchange is a class that provides you the possibility to communicate with your EQdkp Plus using REST. It's possible to signup for Raids or getting a list of upcoming events.
Creating an own exchange-module
Every exchange-module must have an unique name!
Sample exchange-module
<?php
if (!defined('EQDKP_INC')){
die('Do not access this file directly.');
}
if (!class_exists('exchange_check_session')){
class exchange_check_session {
public function post_check_session($params, $body){
global $user;
$xml = simplexml_load_string($body);
$status = 0;
if ($xml && $xml->sid){
$result = $user->check_session($xml->sid);
if ($result != ANONYMOUS){
$status = 1;
} else {
$status = 0;
}
}
return array('valid' => $result);
}
}
}
?>
Our Example has the Name "check_session". The class has to be named "exchange_", followed by the module, name, e.g. "exchange_check_session".
You could make an REST-Request with 4 different methods:
- GET - just receive data, don't use when sending additional data like XML
- POST - update data, used when sendig additional data liks XML, as seen in the example above
- PUT - insert new data
- DELETE - delete data
For each of this four methods, you can create on own function, e.g. "post_check_session" if you want to use the POST-Method, or "get_check_session" when using the GET-Method, ...
$params will contain all GET- and POST-Parameter, $body contains the body, like an XML-Feed with data (not possible when using a GET-Method).
Returnvalue is an array containing the data you want to send back. If you want to send back an error, use "return $pex->error('Your error message');".
Folder
Put all exchange-modules into the folder
root/core/exchange/
or if you have a plugin, into
root/plugins/PLUGINNAME/exchange/
Perform Methods
To perform Methods, you need the following information:
- URL to the user's EQdkp Plus, e.g. http://domain.com/eqdkp07/. Split it into Host (= Domain, without protocol and path)and the Path, e.g. Host (<<HOST>>): domain.com, Path (<<Path>>): /eqdkp07/. Normally, a REST-Class would do that for you.
- The Name of the exchange-module, in this example "rest_dummy"
- A session-ID, if the exchange-module needs authentification (<<SID>>)
| Index | Description
|
| Name | rest_dummy
|
| Description | Just an example, it's not implemented ;)
|
| Method | POST
|
| URL-Params |
- s (Session-ID <<SID>>)
- dummyid (integer)
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=rest_dummy&dummyid=42&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Content-Length: 53
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request><text>This is a dummy Text</text></request>
|
| Sample Return on success | <?xml version="1.0" encoding="utf-8"?>
<response>
<status>1</status>
<message>Everything ok</message>
</response>
|
| Sample Return if an error occurs | <?xml version="1.0" encoding="utf-8"?>
<response>
<status>0</status>
<error>Error Message</error>
</response>
|
You will always get an status tag, so you can always check if an error occured or not.
Output Format
Default output format is XML. If you want JSON, use URL-Parameter format=json.
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=user_chars&format=json HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | {"chars":{"char:79":{"id":79,"name":"Kultschack","main":1,"class":"4","classname":"Magier","race":"10","racename":"Blutelf","roles":{"role:3":{"id":3,"name":"DD Fernkampf","default":0}}},"char:114":{"id":114,"name":"Bluebellow","main":0,"class":"1","classname":"Todesritter","race":"5","racename":"Troll","roles":{"role:2":{"id":2,"name":"Tank","default":0},"role:4":{"id":4,"name":"DD Nahkampf","default":0}}}},"status":1}
|
Authentification Functions
Login-Flow
- User has to insert his Username and Passwort
- The App get's the User-Salt from the EQdkp Plus
- You create with the Salt and the given Password a sha512-Hash which can be saved on the client
- User-Login with Username and saved hash
- You'll get an session-ID and a date until the session is valid and has to be renewed
- With this session-ID, you can use the exchange-functions like posting a shout
Getting Salt
| Index | Description
|
| Name | get_salt
|
| Description | Returns the user's salt
|
| Method | POST
|
| URL-Params | none
|
| XML-Data |
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=get_salt HTTP/1.1
Host: <<HOST>>
Content-Length: 36
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request><user>root</user></request>
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response><status>1</status><salt>ZjU4MzYxYTMxMzA2MzI1OTQwODg5ZGE=</salt></response>
|
The salt is returned base64-encodet, so you've to decode it.
With the encoded salt, you can create the hash with following method:
$hash = hash('sha512', $salt.$password);
This Hash can be saved on the client, but never the clean password!!!
Login
| Index | Description
|
| Name | login
|
| Description | User-Login
|
| Method | POST
|
| URL-Params | none
|
| XML-Data |
- user (string; Username)
- password (string; hashed password, NOT clean password!)
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=login HTTP/1.1
Host: <<HOST>>
Content-Length: 89
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request><user>root</user><password>96917805fd060e3766a9a1b834639d35</password></request>
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response><status>1</status><sid>1f93fcfb4f2447c5c50f851be2269ba</sid><end>1279053414</end></response>
|
Session-Check
To check if a session is valid and you user is logged in, use this Function.
| Index | Description
|
| Name | check_session
|
| Description | Checks if a given Session-ID is valid, means if User is logged in.
|
| Method | POST
|
| URL-Params | none
|
| XML-Data |
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=check_session HTTP/1.1
Host: <<HOST>>
Content-Length: 61
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request><sid>1f93fcfb4f2447c5c50f851be2269ba</sid></request>
|
| Sample Return |
Returns 1 is user is logged in (that means session for this user is still active), or 0 if User is Guest.
<?xml version="1.0" encoding="utf-8"?>
<response><status>1</status><valid>1</valid></response>
|
Logout
| Index | Description
|
| Name | logout
|
| Description | Destroys a given session
|
| Method | POST
|
| URL-Params | none
|
| XML-Data |
- sid (string; The Session you want to destroy)
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=logout HTTP/1.1
Host: <<HOST>>
Content-Length: 61
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request><sid>1f93fcfb4f2447c5c50f851be2269ba</sid></request>
|
| Sample Return | <response><status>1</status><result>1</result></response>
|
Core Exchange Functions
User-Chars
| Index | Description
|
| Name | user_chars
|
| Description | Returns all chars of an User
|
| Method | GET
|
| URL-Params |
- s (Session-ID <<SID>>)
- userid (optional, otherwise the userid of the requesting user will be used)
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=user_chars&userid=217&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<chars>
<char>
<id>79</id>
<name>Kàltschack</name>
<main>1</main>
<class>4</class>
<classname>Mage</classname>
<race>10</race>
<racename>Blood Elf</racename>
<roles>
<role>
<id>3</id>
<name>DD Fernkampf</name>
<default>0</default>
</role>
</roles>
</char>
<char>
<id>114</id>
<name>Bluebellow</name>
<main>0</main>
<class>1</class>
<classname>Death Knight</classname>
<race>5</race>
<racename>Troll</racename>
<roles>
<role>
<id>2</id>
<name>Tank</name>
<default>0</default>
</role>
<role>
<id>4</id>
<name>DD Nahkampf</name>
<default>0</default>
</role>
</roles>
</char>
</chars>
<status>1</status>
</response>
|
Calendar Events List
| Index | Description
|
| Name | calevents_list
|
| Description | Shows a list with next upcoming Events like Raids, ...
|
| Method | GET
|
| URL-Params |
- s (Session-ID <<SID>>)
- raids_only (optional, 0 or 1, default: 1)
- number (optional, default: 10)
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=calevents_list&raids_only=0&number=3&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<events>
<event>
<type>raid</type>
<title>Kara</title>
<start>2011-07-13 01:09</start>
<start_timestamp>1310512140</start_timestamp>
<end>2011-07-13 03:09</end>
<end_timestamp>1310519340</end_timestamp>
<allDay>0</allDay>
<closed>0</closed>
<eventid>14</eventid>
<url>calendar/viewcalraid.php?eventid=14</url>
<icon>./games/wow/events/unknown.png</icon>
<note></note>
<raidleader>Alyia</raidleader>
<raidstatus>
<status0>
<id>0</id>
<count>0</count>
</status0>
<status1>
<id>1</id>
<count>2</count>
</status1>
<status2>
<id>2</id>
<count>1</count>
</status2>
<status3>
<id>3</id>
<count>0</count>
</status3>
<required>3</required>
</raidstatus>
<user_status>2</user_status>
<color>#00628c</color>
<calendar>1</calendar>
<calendar_name>Raids</calendar_name>
</event>
<event>
<type>raid</type>
<title>Gruul</title>
<start>2011-07-21 15:07</start>
<start_timestamp>1311253620</start_timestamp>
<end>2011-07-21 17:07</end>
<end_timestamp>1311260820</end_timestamp>
<allDay>0</allDay>
<closed>0</closed>
<eventid>18</eventid>
<url>calendar/viewcalraid.php?eventid=18</url>
<icon>./games/wow/events/unknown.png</icon>
<note></note>
<raidleader>Alyia</raidleader>
<raidstatus>
<status0>
<id>0</id>
<count>0</count>
</status0>
<status1>
<id>1</id>
<count>0</count>
</status1>
<status2>
<id>2</id>
<count>1</count>
</status2>
<status3>
<id>3</id>
<count>0</count>
</status3>
<required>0</required>
</raidstatus>
<user_status>2</user_status>
<color>#00628c</color>
<calendar>1</calendar>
<calendar_name>Raids</calendar_name>
</event>
<event>
<type>event</type>
<title>Testtermin</title>
<start>2011-07-29 09:58</start>
<start_timestamp>1311926280</start_timestamp>
<end>2011-07-29 11:58</end>
<end_timestamp>1311933480</end_timestamp>
<allDay>1</allDay>
<closed>0</closed>
<eventid>16</eventid>
<url></url>
<icon></icon>
<note>Testnotiz</note>
<raidleader></raidleader>
<raidstatus></raidstatus>
<user_status>-1</user_status>
<color>#ba1e1e</color>
<calendar>2</calendar>
<calendar_name>Standard</calendar_name>
</event>
</events>
<status>1</status>
|
Calendar Event Details
| Index | Description
|
| Name | calevents_details
|
| Description | Shows detailed information about an Event
|
| Method | GET
|
| URL-Params |
- s (Session-ID <<SID>>)
- eventid (integer)
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=calevents_details&eventid=14&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<type>raid</type>
<categories>classes</categories>
<title>Kara</title>
<start>2011-07-27 01:09</start>
<start_timestamp>1311721740</start_timestamp>
<end>2011-07-27 03:09</end>
<end_timestamp>1311728940</end_timestamp>
<deadline>2011-07-27 00:09</deadline>
<deadline_timestamp>1311718140</deadline_timestamp>
<allDay>0</allDay>
<closed>0</closed>
<icon>./games/wow/events/unknown.png</icon>
<note></note>
<raidleader>Alyia</raidleader>
<raidstatus>
<status0>
<id>0</id>
<name>Bestätigt</name>
<count>0</count>
<maxcount>3</maxcount>
<categories>
<category1>
<id>1</id>
<name>Todesritter</name>
<color>#C41F3B</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category1>
<category2>
<id>2</id>
<name>Druide</name>
<color>#FF7C0A</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category2>
<category3>
<id>3</id>
<name>Jäger</name>
<color>#AAD372</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category3>
<category4>
<id>4</id>
<name>Magier</name>
<color>#68CCEF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category4>
<category5>
<id>5</id>
<name>Paladin</name>
<color>#F48CBA</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category5>
<category6>
<id>6</id>
<name>Priester</name>
<color>#FFFFFF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category6>
<category7>
<id>7</id>
<name>Schurke</name>
<color>#FFF468</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category7>
<category8>
<id>8</id>
<name>Schamane</name>
<color>#1a3caa</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category8>
<category9>
<id>9</id>
<name>Hexenmeister</name>
<color>#9382C9</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category9>
<category10>
<id>10</id>
<name>Krieger</name>
<color>#C69B6D</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category10>
</categories>
</status0>
<status1>
<id>1</id>
<name>Angemeldet</name>
<count>1</count>
<maxcount>3</maxcount>
<categories>
<category1>
<id>1</id>
<name>Todesritter</name>
<color>#C41F3B</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category1>
<category2>
<id>2</id>
<name>Druide</name>
<color>#FF7C0A</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category2>
<category3>
<id>3</id>
<name>Jäger</name>
<color>#AAD372</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category3>
<category4>
<id>4</id>
<name>Magier</name>
<color>#68CCEF</color>
<count>1</count>
<maxcount>0</maxcount>
<chars>
<char>
<id>79</id>
<name>Kàltschack</name>
<classid>4</classid>
<signedbyadmin>0</signedbyadmin>
<note></note>
<rank></rank>
</char>
</chars>
</category4>
<category5>
<id>5</id>
<name>Paladin</name>
<color>#F48CBA</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category5>
<category6>
<id>6</id>
<name>Priester</name>
<color>#FFFFFF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category6>
<category7>
<id>7</id>
<name>Schurke</name>
<color>#FFF468</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category7>
<category8>
<id>8</id>
<name>Schamane</name>
<color>#1a3caa</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category8>
<category9>
<id>9</id>
<name>Hexenmeister</name>
<color>#9382C9</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category9>
<category10>
<id>10</id>
<name>Krieger</name>
<color>#C69B6D</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category10>
</categories>
</status1>
<status2>
<id>2</id>
<name>Abgemeldet</name>
<count>0</count>
<maxcount>3</maxcount>
<categories>
<category1>
<id>1</id>
<name>Todesritter</name>
<color>#C41F3B</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category1>
<category2>
<id>2</id>
<name>Druide</name>
<color>#FF7C0A</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category2>
<category3>
<id>3</id>
<name>Jäger</name>
<color>#AAD372</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category3>
<category4>
<id>4</id>
<name>Magier</name>
<color>#68CCEF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category4>
<category5>
<id>5</id>
<name>Paladin</name>
<color>#F48CBA</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category5>
<category6>
<id>6</id>
<name>Priester</name>
<color>#FFFFFF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category6>
<category7>
<id>7</id>
<name>Schurke</name>
<color>#FFF468</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category7>
<category8>
<id>8</id>
<name>Schamane</name>
<color>#1a3caa</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category8>
<category9>
<id>9</id>
<name>Hexenmeister</name>
<color>#9382C9</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category9>
<category10>
<id>10</id>
<name>Krieger</name>
<color>#C69B6D</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category10>
</categories>
</status2>
<status3>
<id>3</id>
<name>Ersatzbank</name>
<count>0</count>
<maxcount>3</maxcount>
<categories>
<category1>
<id>1</id>
<name>Todesritter</name>
<color>#C41F3B</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category1>
<category2>
<id>2</id>
<name>Druide</name>
<color>#FF7C0A</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category2>
<category3>
<id>3</id>
<name>Jäger</name>
<color>#AAD372</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category3>
<category4>
<id>4</id>
<name>Magier</name>
<color>#68CCEF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category4>
<category5>
<id>5</id>
<name>Paladin</name>
<color>#F48CBA</color>
<count>0</count>
<maxcount>1</maxcount>
<chars/>
</category5>
<category6>
<id>6</id>
<name>Priester</name>
<color>#FFFFFF</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category6>
<category7>
<id>7</id>
<name>Schurke</name>
<color>#FFF468</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category7>
<category8>
<id>8</id>
<name>Schamane</name>
<color>#1a3caa</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category8>
<category9>
<id>9</id>
<name>Hexenmeister</name>
<color>#9382C9</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category9>
<category10>
<id>10</id>
<name>Krieger</name>
<color>#C69B6D</color>
<count>0</count>
<maxcount>0</maxcount>
<chars/>
</category10>
</categories>
</status3>
</raidstatus>
<user_status>
<status>1</status>
<status_name>Angemeldet</status_name>
<char_id>79</char_id>
<char_class>4</char_class>
<char_name>Kàltschack</char_name>
</user_status>
<user_chars>
<char>
<id>79</id>
<name>Kàltschack</name>
<signed_in>1</signed_in>
<main>1</main>
<class>4</class>
<roles>
<role>
<id>3</id>
<name>DD Fernkampf</name>
<signed_in>0</signed_in>
</role>
</roles>
</char>
<char>
<id>114</id>
<name>Bluebellow</name>
<signed_in>0</signed_in>
<main>0</main>
<class>1</class>
<roles>
<role>
<id>2</id>
<name>Tank</name>
<signed_in>0</signed_in>
</role>
<role>
<id>4</id>
<name>DD Nahkampf</name>
<signed_in>0</signed_in>
</role>
</roles>
</char>
</user_chars>
<comments>
<comment>
<username>root</username>
<date>2011-07-07 17:41</date>
<date_timestamp>1310053300</date_timestamp>
<message>Z<em>wei</em>ter Ko<strong>mmen</strong>tar</message>
</comment>
<comment>
<username>root</username>
<date>2011-07-07 17:22</date>
<date_timestamp>1310052167</date_timestamp>
<message>Mein Testkommentar</message>
</comment>
</comments>
<calendar>1</calendar>
<calendar_name>Raids</calendar_name>
<status>1</status>
</response>
|
Raid Signup
| Index | Description
|
| Name | raid_signup
|
| Description | Singup to an Raid
|
| Method | POST
|
| URL-Params |
|
| XML-Data |
- eventid (integer)
- memberid (integer)
- status (integer)
- role (integer; only needed if raid-categories is "roles")
- note (string; optional)
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=raid_signup&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Content-Length: 121
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request>
<eventid>18</eventid>
<memberid>79</memberid>
<status>2</status>
<role>1</role>
<note>Testnote</note>
</request>
|
| Sample Return | <response>
<status>1</status>
</response>
|
Latest News
| Index | Description
|
| Name | latest_news
|
| Description | Shows a list with the latest News
|
| Method | GET
|
| URL-Params |
- s (Session-ID <<SID>>)
- sort (optional, asc or desc, default: desc)
- number (optional, default: 10)
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=latest_news&number=3&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<entries>
<entry>
<id>26</id>
<headline>Test</headline>
<message><p>äöüßasd asd asd asd</p></message>
<date>1310737200</date>
<author>root</author>
<category_id>1</category_id>
<category>Default</category>
<comments/>
</entry>
<entry>
<id>13</id>
<headline>Der Weltpokal „Hand von Adal“ ist geschafft</headline>
<message>Testmessage</message>
<date>1309974900</date>
<author>root</author>
<category_id>1</category_id>
<category>Default</category>
<comments>
<comment>
<username>root</username>
<date>2011-07-15 15:38</date>
<date_timestamp>1310737097</date_timestamp>
<message>äöü</message>
</comment>
<comment>
<username>root</username>
<date>2011-07-12 13:55</date>
<date_timestamp>1310471714</date_timestamp>
<message>;)</message>
</comment>
<comment>
<username>root</username>
<date>2011-07-12 13:54</date>
<date_timestamp>1310471697</date_timestamp>
<message>:)</message>
</comment>
<comment>
<username>root</username>
<date>2011-07-09 09:10</date>
<date_timestamp>1310195428</date_timestamp>
<message>Test</message>
</comment>
</comments>
</entry>
<entry>
<id>14</id>
<headline>Wo bin ich hier eigentlich?</headline>
<message><p></p></message>
<date>1309974840</date>
<author>root</author>
<category_id>1</category_id>
<category>Default</category>
<comments/>
</entry>
</entries>
<status>1</status>
</response>
|
Data
| Index | Description
|
| Name | data
|
| Description | Returns data like Guildname, Game, ...
|
| Method | GET
|
| URL-Params |
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=data&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<eqdkp>
<name>Riposte</name>
<guild>Riposte</guild>
<dkp_name>DKP</dkp_name>
<forum_url></forum_url>
<language>german</language>
</eqdkp>
<game>
<name>wow</name>
<version>4.2</version>
<language>german</language>
<server_name>Antonidas</server_name>
<server_loc>eu</server_loc>
</game>
<status>1</status>
</response>
|
Points
| Index | Description
|
| Name | points
|
| Description | Returns DKP-Points of characters
|
| Method | GET
|
| URL-Params |
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=points&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<eqdkp>
<name>Riposte</name>
<guild>Riposte</guild>
<dkp_name>DKP</dkp_name>
<version>0.7.3.5</version>
<layout>user_epgp</layout>
</eqdkp>
<game>
<name>wow</name>
<version>4.2</version>
<language>german</language>
<server_name>Antonidas</server_name>
<server_loc>eu</server_loc>
</game>
<info>
<with_twink></with_twink>
<date>31.03.12 11:12:56</date>
<timestamp>1333185176</timestamp>
<total_players>50</total_players>
<total_items>8598</total_items>
</info>
<players>
<player>
<id>675</id>
<name>Adanae</name>
<active>0</active>
<hidden>0</hidden>
<main_id>675</main_id>
<main_name>Adanae</main_name>
<class_id>4</class_id>
<class_name>Magier</class_name>
<race_id>9</race_id>
<race_name>Draenei</race_name>
<points>
<multidkp_points>
<multidkp_id>1</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>2</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>3</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>4</multidkp_id>
<points_current>32</points_current>
<points_current_with_twink>32</points_current_with_twink>
<points_earned>640</points_earned>
<points_earned_with_twink>640</points_earned_with_twink>
<points_spent>20</points_spent>
<points_spent_with_twink>20</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="positive">32</span></points_current_html>
<points_current_with_twink_html><span class="positive">32</span></points_current_with_twink_html>
<points_earned_html><span class="positive">640</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">640</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">20</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">20</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
</points>
<items>
<item>
<game_id>71024</game_id>
<name>Band des Kristallgefängnisses</name>
<value>20.00</value>
<itempool_id>4</itempool_id>
</item>
</items>
</player>
<player>
<id>679</id>
<name>Aenya</name>
<active>1</active>
<hidden>0</hidden>
<main_id>679</main_id>
<main_name>Aenya</main_name>
<class_id>1</class_id>
<class_name>Todesritter</class_name>
<race_id>4</race_id>
<race_name>Nachtelf</race_name>
<points>
<multidkp_points>
<multidkp_id>1</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>10</points_spent>
<points_spent_with_twink>10</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">10</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">10</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>2</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>3</multidkp_id>
<points_current>0</points_current>
<points_current_with_twink>0</points_current_with_twink>
<points_earned>0</points_earned>
<points_earned_with_twink>0</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="neutral">0</span></points_current_html>
<points_current_with_twink_html><span class="neutral">0</span></points_current_with_twink_html>
<points_earned_html><span class="positive">0</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">0</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
<multidkp_points>
<multidkp_id>4</multidkp_id>
<points_current>80</points_current>
<points_current_with_twink>80</points_current_with_twink>
<points_earned>80</points_earned>
<points_earned_with_twink>80</points_earned_with_twink>
<points_spent>0</points_spent>
<points_spent_with_twink>0</points_spent_with_twink>
<points_adjustment>0</points_adjustment>
<points_adjustment_with_twink>0</points_adjustment_with_twink>
<points_current_html><span class="positive">80</span></points_current_html>
<points_current_with_twink_html><span class="positive">80</span></points_current_with_twink_html>
<points_earned_html><span class="positive">80</span></points_earned_html>
<points_earned_with_twink_html><span class="positive">80</span></points_earned_with_twink_html>
<points_spent_html><span class="negative">0</span></points_spent_html>
<points_spent_with_twink_html><span class="negative">0</span></points_spent_with_twink_html>
<points_adjustment_html><span class="neutral">0</span></points_adjustment_html>
<points_adjustment_with_twink_html><span class="neutral">0</span></points_adjustment_with_twink_html>
</multidkp_points>
</points>
<items>
<item>
<game_id>70279</game_id>
<name>Drachenlederhandschuhe des ruchlosen Gladiators</name>
<value>10.00</value>
<itempool_id>1</itempool_id>
</item>
</items>
</player>
</players>
<multidkp_pools>
<multidkp_pool>
<id>1</id>
<name>Burning Crusade</name>
<desc>25er Raids in TBC</desc>
<events>
<event>
<id>4</id>
<name>Magtheridons Hort</name>
<value>0.00</value>
</event>
<event>
<id>5</id>
<name>Gruuls Unterschlupf</name>
<value>0.00</value>
</event>
<event>
<id>6</id>
<name>Höhle des Schlangenschreins</name>
<value>0.00</value>
</event>
<event>
<id>7</id>
<name>Verschiedene Outland Bosse</name>
<value>0.00</value>
</event>
<event>
<id>10</id>
<name>Festung der Stürme</name>
<value>0.00</value>
</event>
<event>
<id>18</id>
<name>Berg Hyjal</name>
<value>0.00</value>
</event>
<event>
<id>19</id>
<name>Schwarzer Tempel</name>
<value>0.00</value>
</event>
<event>
<id>23</id>
<name>Sonnenbrunnenplateau</name>
<value>0.00</value>
</event>
<event>
<id>24</id>
<name>DKP Reset</name>
<value>0.00</value>
</event>
<event>
<id>25</id>
<name>25er-Instanz</name>
<value>0.00</value>
</event>
<event>
<id>26</id>
<name>Gildenbesprechung</name>
<value>0.00</value>
</event>
<event>
<id>27</id>
<name>Abschiedsraid</name>
<value>0.00</value>
</event>
<event>
<id>52</id>
<name>Andi's Place</name>
<value>5.00</value>
</event>
</events>
<mdkp_itempools>
<itempool_id>1</itempool_id>
</mdkp_itempools>
</multidkp_pool>
<multidkp_pool>
<id>2</id>
<name>WotLK Part 1</name>
<desc>25er Raids ab WotLK</desc>
<events>
<event>
<id>28</id>
<name>Naxxramas T7</name>
<value>0.00</value>
</event>
<event>
<id>29</id>
<name>25er T7</name>
<value>0.00</value>
</event>
<event>
<id>31</id>
<name>Auge der Ewigkeit T7</name>
<value>0.00</value>
</event>
<event>
<id>32</id>
<name>Das Obsidiansanktum T7</name>
<value>0.00</value>
</event>
<event>
<id>1</id>
<name>25er-Raid</name>
<value>0.00</value>
</event>
<event>
<id>53</id>
<name>alert("");Bla</name>
<value>0.00</value>
</event>
</events>
<mdkp_itempools>
<itempool_id>1</itempool_id>
<itempool_id>2</itempool_id>
</mdkp_itempools>
</multidkp_pool>
<multidkp_pool>
<id>3</id>
<name>WotLK Part 2</name>
<desc>Ulduar, Kolosseum und Eiskronenzitadelle</desc>
<events>
<event>
<id>37</id>
<name>Das Obsidiansanktum T8</name>
<value>0.00</value>
</event>
<event>
<id>34</id>
<name>25er Raid</name>
<value>0.00</value>
</event>
<event>
<id>35</id>
<name>Ulduar</name>
<value>0.00</value>
</event>
<event>
<id>36</id>
<name>PTR Ulduar</name>
<value>0.00</value>
</event>
<event>
<id>38</id>
<name>Naxxramas T8</name>
<value>0.00</value>
</event>
<event>
<id>39</id>
<name>Das Auge der Ewigkeit</name>
<value>0.00</value>
</event>
<event>
<id>41</id>
<name>Das Kolosseum</name>
<value>0.00</value>
</event>
<event>
<id>42</id>
<name>Archavons Kammer</name>
<value>0.00</value>
</event>
<event>
<id>43</id>
<name>Die Eiskronenzitadelle T10</name>
<value>0.00</value>
</event>
<event>
<id>44</id>
<name>Charwechsel</name>
<value>0.00</value>
</event>
<event>
<id>45</id>
<name>Das Rubinsanktum</name>
<value>0.00</value>
</event>
<event>
<id>1</id>
<name>25er-Raid</name>
<value>0.00</value>
</event>
<event>
<id>53</id>
<name>alert("");Bla</name>
<value>0.00</value>
</event>
</events>
<mdkp_itempools>
<itempool_id>1</itempool_id>
<itempool_id>2</itempool_id>
<itempool_id>3</itempool_id>
</mdkp_itempools>
</multidkp_pool>
<multidkp_pool>
<id>4</id>
<name>Cataclysm Part 1</name>
<desc>Cataclysm Patch 1</desc>
<events>
<event>
<id>46</id>
<name>Pechschwingenabstieg</name>
<value>0.00</value>
</event>
<event>
<id>47</id>
<name>Thron der Vier Winde</name>
<value>0.00</value>
</event>
<event>
<id>48</id>
<name>Die Bastion des Zwielichts</name>
<value>0.00</value>
</event>
<event>
<id>49</id>
<name>Baradinfestung</name>
<value>0.00</value>
</event>
<event>
<id>50</id>
<name>Sonstiges Cataclysm Part 1</name>
<value>0.00</value>
</event>
<event>
<id>51</id>
<name>Feuerlande</name>
<value>0.00</value>
</event>
</events>
<mdkp_itempools>
<itempool_id>1</itempool_id>
<itempool_id>2</itempool_id>
<itempool_id>3</itempool_id>
<itempool_id>4</itempool_id>
</mdkp_itempools>
</multidkp_pool>
</multidkp_pools>
<itempools>
<itempool>
<id>1</id>
<name>Burning Crusade</name>
<desc>25er Raids in TBC</desc>
</itempool>
<itempool>
<id>2</id>
<name>WotLK Part 1</name>
<desc>25er Raids ab WotLK</desc>
</itempool>
<itempool>
<id>3</id>
<name>WotLK Part 2</name>
<desc>Ulduar, Kolosseum und Eiskronenzitadelle</desc>
</itempool>
<itempool>
<id>4</id>
<name>Cataclysm Part 1</name>
<desc>Cataclysm Patch 1</desc>
</itempool>
</itempools>
<status>1</status>
</response>
|
- with_twink: sum of points of all chars, including twinks and mains
- layout: used DKP-System, e.g. epgp, zs (ZeroSum), edkp (effective dkp), ... Each DKP-System has the columns _current, _earned and _spent.
Plugin Exchange Moduls
List Shouts
| Index | Description
|
| Name | shoutbox_list
|
| Description | Returns a list of the latest shouts
|
| Plugin | Shoutbox
|
| Method | GET
|
| URL-Params |
- s (Session-ID <<SID>>)
- number (optional; integer; default: 10)
- sort (optional; string desc/asc; default: asc )
|
| Sample Call | GET <<PATH>>/exchange.php?out=rest&function=shoutbox_list&number=20&sort=desc&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Connection: Close
|
| Sample Return | <?xml version="1.0" encoding="utf-8"?>
<response>
<entries>
<entry>
<id>1</id>
<member_id>79</member_id>
<user_id>1</user_id>
<name>Kàltschack</name>
<text><p>Test</p></text>
<date>2011-07-24 14:30</date>
<timestamp>1309797805</timestamp>
</entry>
<entry>
<id>2</id>
<member_id>79</member_id>
<user_id>1</user_id>
<name>Kàltschack</name>
<text><p>test</p></text>
<date>2011-07-24 14:30</date>
<timestamp>1309797805</timestamp>
</entry>
<entry>
<id>3</id>
<member_id>79</member_id>
<user_id>1</user_id>
<name>Kàltschack</name>
<text><p>test</p></text>
<date>2011-07-24 14:30</date>
<timestamp>1309797805</timestamp>
</entry>
<entry>
<id>4</id>
<member_id>79</member_id>
<user_id>1</user_id>
<name>Kàltschack</name>
<text><p>Das ist eine Testnachricht</p></text>
<date>2011-07-24 14:30</date>
<timestamp>1309797805</timestamp>
</entry>
<entry>
<id>5</id>
<member_id>79</member_id>
<user_id>1</user_id>
<name>Kàltschack</name>
<text><p><img alt=";)" src="http://localhost/web/eqdkp07/libraries/jquery/core/images/editor/icons/wink.png" /> <img alt=":)" src="http://localhost/web/eqdkp07/libraries/jquery/core/images/editor/icons/happy.png" /> :-) ? &</p></text>
<date>2011-07-24 14:30</date>
<timestamp>1309797805</timestamp>
</entry>
</entries>
<status>1</status>
</response>
|
If Shoutboxes uses only user-IDs, member_id will contain -1.
Add Shout
| Index | Description
|
| Name | shoutbox_add
|
| Description | Add an Shout
|
| Plugin | Shoutbox
|
| Method | POST
|
| URL-Params |
|
| XML-Data |
- text (string; Text you want to shout)
- charid (integer; ID of user's char)
|
| Sample Call | POST <<PATH>>/exchange.php?out=rest&function=shoutbox_add&s=<<SID>> HTTP/1.1
Host: <<HOST>>
Content-Length: 66
Content-Type: application/atom+xml; charset=UTF-8
Connection: Close
<request>
<charid>18</charid>
<text>Testshout</text>
</request>
|
| Sample Return | <response>
<status>1</status>
</response>
|
Testing Client for REST
<?php
$xml = '<request><user>root</user><password>96917805fd060e3766a9a1b834639d35</password></request>';
$fp = fsockopen("localhost", 80, $errno, $errstr, 30);
if (!$fp) {
return array(false, "$errstr ($errno)");
} else {
$out = "POST /web/eqdkp07/exchange.php?out=rest&function=login HTTP/1.1\r\n";
$out .= "Host: localhost\r\n";
$out .= "Content-Length: ".strlen($xml)."\r\n";
$out .= "Content-Type: application/atom+xml; charset=UTF-8\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $xml;
$return = "";
fwrite($fp, $out);
while (!feof($fp)) {
$return .= fgets($fp);
}
fclose($fp);
}
var_dump($return);
?>