====== API interaction format ====== WaspAce API works in [[http://en.wikipedia.org/wiki/JSON|JSON]] format at http://api.waspace.net ===== Interaction codes ===== * [[en:api:format:opcodes]] * [[en:api:format:serverresponses]] * [[en:api:format:generalerrors]] ===== Format of POST requests processing ===== == Request == Request body should contain the following string with JSON-object: v={ "Action":, "Data":{ } } //Where// * //// - request code. * //// - data dependent on the operation code. * //"v="// - used to work with JavaScript. == Response == In the body of the server response the string will be contained: ===== Format of GET requests processing ===== == Request == The request string should look like this: http://api.waspace.net//{} //Where// * //// - request code. * //// - data dependent on the operation code. == Response == In the body of the server response the string will be contained: //Where// * //// - Server response in JSON format. ==== Types of server responses ==== == Request is successfully done == { "Status": , "Data": { } } //Где// * //// - Status of the request, indicating successful execution * //// - Data in JSON format, the content of which depends on the request. If the data in the response is not required, the Data object in the response will be absent. == Request failed, general error was occured. == { "Status":, "Error": } //Where// * //// - response status, meaning the general error. * //// - one of the common error codes. == Request failed, an error occurred on request == { "Status":, "Error": } //Where// * //// - response status, meaning a mistake on request * //// -one of the error codes on request. ===== Additional information ===== * Encoding requests and responses - UTF-8. * Response from the server comes in a format JavaScript encodeURI. * Request to the server can also be encoded by function similar to JavaScript encodeURI.