Skip to content
viruch edited this page May 23, 2011 · 22 revisions

Communication

JSON is used for the communication between Server and Client.

Server API

get_stock

get_stock [ all | resource_id ] user_id 
example

Request

{ 
  get_stock: { 
    resource_id: 9,
    user_id : 'ee11cbb19052e40b07aac0ca060c23ee'
  }
}

Response

{
  command: 'get_stock',
  response: { 
    9: { amount: 10 }
  }
}

get_resource

get_resource [ all | resource_id ] 
example
{
  get_resource 

get_auctions

get_auctions [ all | resource_id ]

get_user

get_user user_id

buy

buy auction_id

create_auction

create_auction user_id resource_id amount price timeleft_sec

login

login username password

Client API

Clone this wiki locally