Basic form of API URL
Headers
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.
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
Success
Fail : When an API call is rejected due to invalid data or call conditions.
Error : When an API call fails due to an error on the server.