Response
The response from an API call will always be JSON. The JSON response will have four primary keys: status, messages, meta, and data.
The `status` value will either be `success` or `error`.
The `messages` value will be an array of messages. Typically the `messages` value will be an empty array. It will generally be used for error responses (like validation errors) but it could also be used to send additional information during a successful response.
The `meta` value will contain additional details about the response. For example, it could include pagination information or other relevant information.
The `data` value is where the actual data for the response is found (if the endpoint returns data). Depending on the endpoint, the `data` could be an array of values or it could be a single value.
Success
Below is an example of a successful response:
curl https://sandbox.sellinpublic.com/api/v0/hello -u "demo:sip_api_sand_01234demo56789_key"
{
"status": "success",
"messages": [],
"meta": {},
"data": {
"name": "World"
}
}
Error
curl https://sandbox.sellinpublic.com/api/v0/hello -u "demo:sip_api_sand_invalid_key"
Below is an example of an error response:
{
"status": "error",
"messages": [
"The API user or key does not appear to be valid."
],
"meta": {},
"data": {}
}