Latest Neocron News and Information

  • New test server patch #564 has been released to Vedeena

User:Brammers/RaresDBapi

From Neocron Wiki
Jump to: navigation, search

Rares DB API

See http://forum.neocron.com/showthread.php?t=144684 This is a design document to provide API access to the Rares DB via a SOAP interface.

Methods

Login

Login(username,user_api_key,client_api_key)

Returns a token_key_object, which will contain the token_key be used for calls that need write access.

token_key_object

token_key_object.success = boolean (True, login ok, false login failed) token_key_object.token_key = string (blank if login failed, otherwise contains a token key) token_key_object.message = string (contains "OK" if login is successful, otherwise contains a message to why the login failed)

Logout

Logout(token_key)

Logs out of the rares DB.

Returns a boolean. (True - Logout successful, false Logout failed.)

GetRaresList

GetRaresList()

This returns an XML document with the Item ID's to Part ID's mapping, and the type of parts like on http://rares.techhaven.org/list.php

<raredb>
 <item id="1" name="Terminator">
  <part id="7" type="TP"/>
  <part id="8" type="HP"/>
  <part id="9" type="FP"/>
  <part id="10" type="CP"/>
  <part id="11" type="OP"/>
 </item>
</raredb>

GetUserRaresList

GetUserRaresList(token_key,server_name)

SetPartQty

SetPartQty(token_key,server_name,part_id,new_qty)

SetItemQty

SetItemQty(token_key,server_name,item_id,new_qty)

IsListLocked

IsListLocked(token_key,server_name)

Parameters

username - THN Username.

user_api_key - An API key - this will be issued to users of the rares DB via the Rares DB interface. The API key is to prevent issues with third party apps storing username and passwords.

client_api_key - An API key for the client. This is issued by the THN, and should not be made public by any developers. This allows the THN to revoke access to any clients that may be mis-using the API, and also it allows developers to invalidate older versions of their clients for reasons of bugs etc.

token_key - This is a token that is issued when the Login method is called successfully and is used for all calls to the API that require an update.