Basic form of API URL

#API Form
https://${CloudVendor}.${CountryCode}.machlake.com/

Headers

Content-Type: application/json; charset=utf8
x-api-key: {API Key}

Please keep your API Key carefully to prevent security threats.

Basic response format

The response of all requests must follow the format below, and the response in the description of each API describes only the value of the "data" key.

{
    "status" : "success" or "fail" or "error",
    "data" : {
        ....
    }
}

When setting up a JSON API, you'll have all kinds of different types of calls and responses. JSend separates responses into some basic types, and defines required and optional keys for each type:

Type

Description

Required Keys

Optional Keys

Success

All went well, and (usually) some data was returned.

status, data

Fail

There was a problem with the data submitted, or some pre-condition of the API call wasn't satisfied

status, data

Error

An error occurred in processing the request, i.e. an exception was thrown

status, data

code, data

Example response type

{
    status : "success",
    data : {
        "tag_1" : [ .... ],
        "tag_2" : [ .... ]
    }
}

{
    status : "success",
    data : { "id" : 2, "title" : "Another blog post", "body" : "More content" }
}

{
    status : "success",
    data : null
}
{
    "status" : "fail",
    "data" : { "title" : "A title is required" }
}
{
    "status" : "error",
    "message" : "Unable to communicate with database"
}