REST¶
API Standard Response.¶
success: the call succeededcode: an array of response codesdata : data: an array of objects returned from the database.data : total_rows: the total number of rows you have access to.data : returned_rows: the number of rows returned by this call.data : private_key: the private key used to encode urls and other items. It will be sent only once.data : public_key: the public key. It can be used to authenticate calls.data : next: the url for the next set of object. It will be null if there is no more object to retrieve. Only for GET calls.data : prev: the url for the previous set of object. It will be null if there on the first page. Only for GET calls.debug : warnings: null | an array of warnings.debug : errors: null | an array of errors.supported: based on version of api being requested (200 = supported, 100 = deprecated, 0 = not supported).
The REST API come with a standard response:
{
success: true,
code: [],
data: [
{ ... },
{ ... },
],
total_rows: 2,
returned_rows: 2,
private_key: null,
public_key: null
}
You can get the results sorted in ascending or descending order by any indexable fields by using _asc[] = field or _desc[] = field. In addition of the standard response above a debug array can be accessible when passing _debug = true in the url parameters:
{
success: false,
code: [703],
data: [
{ ... },
{ ... },
],
total_rows: 2,
returned_rows: 2,
private_key: null,
public_key: null,
debug: {
warnings: null,
errors: ['email must not be null']
}
}
HTTP Request Methods¶
GET: The GET method does not require any URL parameters; it will filter by what the user have access to. If using parameters, they will need to be in the URL query string:http://{{environment.url}}/user?_gt[updated_on]=1434234342&_gt[created_on]=1434234342POST: The POST method create a new object. Parameters for the POST method have to be in the body in form URL-encoded or sent as multipart/form-data if sending an image for upload.PUT: The PUT method replaces the whole object in the database. It is not to be confused with PATCH which is a partial update. For the PUT method, parameters have to be in the body in form URL-encoded or sent as multipart/form-data if sending an image for upload.PATCH: The PATCH method is similar to PUT put is a partial object update. The parameters for the PATCH method has to be in the body in form URL-encoded or sent as multipart/form-data if sending an image for upload.DELETE: The delete method takes no parameters. The id of the object to be deleted in stuck at the end of the URL. This will delete the organization with id 3:http://{{environment.url}}/organization/3
Comparison Operators¶
Each indexed parameter has comparison and filtering methods available.
equal: equal can be used in two different ways either like a regular url argument or using a array syntax using_equal[]:http://{{environment.url}}/member?_version=3.2&email=vero@busybusy.com http://{{environment.url}}/member?_version=3.2&_equal[email]=vero@busybusy.comnot equal: using array syntax_not_equal[]:http://{{environment.url}}/member?_version=3.2&_not_equal[email]=vero@busybusy.comin: using array syntax_in[]:http://{{environment.url}}/member?_version=3.2&_in[email][]=vero@busybusy.com&_in[email][]=vero.bis@busybusy.comnot in: using array syntax_not_in[]:http://{{environment.url}}/member?_version=3.2&_not_in[email][]=vero@busybusy.com&_not_in[email][]=vero.bis@busybusy.comgreater than: using array syntax_gt[]:http://{{environment.url}}/member?_version=3.2&_gt[email]=vero@busybusy.comgreater than or equal: using array syntax_gte[]:http://{{environment.url}}/member?_version=3.2&_gte[email]=vero@busybusy.comless than: using array syntax_lt[]:http://{{environment.url}}/member?_version=3.2&_lt[email]=vero@busybusy.comless than or equal: using array syntax_lte[]:http://{{environment.url}}/member?_version=3.2&_lte[email]=vero@busybusy.comnull: using special string_-NULL-_:http://{{environment.url}}/member?_version=3.2&email=_-NULL-_not null: using special string!_-NULL-_:http://{{environment.url}}/member?_version=3.2&email=!_-NULL-_