API version 1

All GET requests will match the Content-Type header and return your results in either XML, JSON, or echoed to the page (if using a web browser).

All POST and PUT requests currently only accept JSON encoded parameters.

All requests will return with the appropriate HTTP status code and an additional body parameters int status and str status_message. This is particularly useful for error handling to the client as you can extract status_message from jQuery's responseText parameter and display the error to the client directly.

Resource
method
POST
create
GET
read
PUT
update
DELETE
delete
Example
html
/companies
Create a new company
Required params
str company_name
Optional params
str alias
str company_overview
str website
int main_address_id
str twitter
List all companies (30 default)
Optional params
limit = all,1,etc.
orderby = company_name,alias,etc.
order = asc,desc
GET (simple)
GET (ordered)
/companies/123
Returns all info on company 123
Updates included body params for company 123.
Optional params
str company_name
str alias
str company_overview
str website
int main_address_id
str twitter
Deletes specified company key.

N.B: the parameter live is toggled from 1 to 0, no company is ever deleted.

To delete an individual company parameter use PUT with empty string values.

GET
/companies/123/turnover
Add new turnover value to company 123.
Required params
int turnover
int year
Returns list of all turnover entries
GET
/companies/123/turnover/456
Returns specified turnover data.
Updates the specified turnover key.
Required params
int turnover
int year
Deletes specified turnover key.
GET
/search/companies
Returns search criteria.
Required attribute
str q
e.g. /search/companies&q=stop
GET