Latest Neocron News and Information

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

User:Brammers/RaresDBapi

From Neocron Wiki
< User:Brammers
Revision as of 12:03, 13 April 2011 by Brammers (talk | contribs) (XML Data (Everything inherits from THN_RareDB_API_Message)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Parameters

username

username - This is the THN Username used to login to the Rares DB.

user_api_key

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 passwords.

client_api_key

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

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.

Objects

THN_RareDB_API_Message

  • THN_RareDB_API_Message.success = boolean (True, call succeeded, false call fail)
  • THN_RareDB_API_Message.message = string (contains "OK" if call succeeded, otherwise contains a message to why the call failed)

THN_RareDB_API_Token_Key

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

THN_RareDB_API_XML_Data

  • THN_RareDB_API_XML_Data.success = boolean (True, call succeeded, false call fail)
  • THN_RareDB_API_XML_Data.message = string (contains "OK" if call succeeded, otherwise contains a message to why the call failed)
  • THN_RareDB_API_XML_Data.xml = contains the xml data as a string

Methods

Login

Login(username,user_api_key,client_api_key)

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

Logout

Logout(token_key)

Logs out of the rares DB.

Returns a THN_RareDB_API_Message.

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)