Good afternoon,% username%!
Over the past year, I ran into several tasks of writing the SOAP / REST API to various services and brought out a more or less convenient model for myself. I do not pretend to be a fundamental research, I just want to share the experience of attacking a rake.

First, the general requirements for the default API:
- expandability
- convenient standardized request format
- convenient standardized response format
- sufficient security
- return query execution errors
API (PHP/Perl/Python et), UI (JS). , .
JSON. XML, API JavaScript — ?
:
cmd=" "&data="JSON "&sig=" , "
:
cmd — , . , auth, profile, edit, view — . JSON, JSON .
data — JSON.
sig — , . , - : md5(cmd+secret+data), secret — , ( , ), .
- (AJAX-JavaScript) — secret cookie .
:
{
status: "ok error - "
response: " "
error: " 0 "
}
, .
. :
- , , cmd
- — (sig) — ,
- ,
- —
, , , . , , .
, :
- Manager — ,
- Module — . , , , , Registry, , ,
- Registry — , — Manager.
- Response — , , . (JSON )
- -
, — Registry Response.
, :
- auth — API
- log_out —
- user —
- view —
- list —
- add —
- edit —
- del —
, .
API , . , .
UPD: REST SOAP API. , . REST — , .