Responses

A request will return a response that indicates the result in two different ways: with the standard HTTP response status code and with a corresponding JSON body.

HTTP response status codes

AzoraOne APIs use standard HTTP status codes to indicate success or failure of API requests. In general, codes within the 200-range indicate a successful request, codes within the 400-range indicate an user error in the request (for example if a required parameter was omitted or a value was invalid), and codes in the 500-range indicate an unintended error within our API, servers or databases.

Success

A successful request will return a HTTP status code in the 200-range.

  • 200: OK - A resource has been returned.

  • 202: Accepted - The request has been accepted for processing, but the processing has not been completed.

User Error

A request with one or more user errors will return a HTTP status code in the 400-range.

  • 400: Bad Request - The request cannot be fulfilled due to bad syntax.

  • 401: Unauthorized - The request contains invalid authorization credentials.

  • 403: Forbidden - The request blocked due to security measures.

  • 404: Not Found - The resource could not be found.

  • 409: Conflict - One or more entities has not succeeded on a bulk request.

  • 412: Precondition Failed - File is not yet ready for extraction.

Server Error

A request that causes a server error will return a HTTP status code in the 500-range.

  • 500: Internal Error - The request was terminated due to an internal error on our server.

  • 501: Not Implemented - This resource has been added to the API but not yet implemented on our servers.

  • 503: Not Available - The API is currently unavailable.

JSON bodies

AzoraOne APIs returns JSON in the response body. If the request is successful you will receive the data that you asked for in the body. If the request failed you will be handed a list of error messages instead.

Success body

As an example of a successful request, the response body below is returned when successfully adding a valid company to the company resource.

{
"success": true,
"data": {
"companyID": "1",
"companyName": "SmallCorp",
"companyProxy": "Account Group Inc",
"active": true,
"precognition": {
"active": true
}
},
"extended": "",
"meta": "",
"time": "2020-09-01 14:02:47"
}

All successful response bodies have the same basic structure and will contain the following parameters:

  1. success - Indicates if the request was successful or not.

  2. data - Contains the data requested.

  3. extended - Contains extended information when extracting data from a file.

  4. meta - Contains non-essential data connected to the requested resource.

  5. time - Indicates the date and time that the request was returned.

Error body

As an example of a failed request, the response body below is returned when failing to add a valid company to the company resource.

{
"success": false,
"data": [
{
"code": 111402,
"message": "Company ID is not valid.",
"details": "",
"element": "companyID"
}
],
"extended": "",
"meta": "",
"time": "2020-09-01 13:57:19"
}

All non-successful response bodies have the same basic structure and will contain the following parameters:

  1. success - Indicates if the request was successful or not.

  2. data - Contains a list of errors objects to ease debugging.

  3. extended - Contains extended information when extracting data from a file.

  4. meta - Contains non-essential data connected to the requested resource.

  5. time - Indicates the date and time that the request was returned.

Multiple response body

As an example of a successful request, the response body below is returned when successfully adding two valid companies to the company resource.

{
"objectList": [
{
"success", false,
"data": [
{
"code": 111401,
"message": "Company ID is missing.",
"details": "",
"element": "companyID"
}
],
"objectID": "1"
},
{
"success", true,
"data": {
"companyID": "1",
"companyName": "SmallCorp",
"companyProxy": "Account Group Inc",
"active": true,
"precognition": {
"active": true
}
},
"objectID": "2"
}
],
"time": "2020-09-04 11:43:21"
}

All multiple response bodies have the same basic structure and will contain the following parameters:

  1. objectList - Contains a list of individual responses for each object.

  2. time - Indicates the date and time that the request was returned.

The objects in objectList is the same as in a normal response, but with the following parameters added:

  1. objectID - Indicates the order that the objects were sent in.

Error object

If a request was not successful you can find a list of error objects in the data parameter.

{
"code": 111402,
"message": "Company ID is not valid.",
"details": "",
"element": "companyID"
}

All error objects have the same basic structure and will each contain the following parameters:

  1. code - Contains an error code indicating which error occurred.

  2. message - Contains a brief description of the error.

  3. details - Contains a detailed description of the error.

  4. element - Contains the parameter name associated with the error.

Error codes

The following error codes are implemented in the current version. We will add error codes continuously.

  • 101211 - Request body is missing.

  • 111401 - Company ID is missing.

  • 111402 - Company ID is not valid.

  • 111403 - Company ID already exists.

  • 111502 - Company name is not valid.

  • 113102 - Corporate identity number is not valid.

  • 113202 - Bankgiro number is not valid.

  • 113212 - Plusgiro number is not valid.

  • 113222 - IBAN is not valid.

  • 211101 - Type and verification series are missing

  • 211202 - File format is not valid.

  • 211211 - File is missing.

  • 211212 - File is not valid.

  • 211214 - File could not be processed.

  • 211215 - File is not ready for extraction.

  • 211302 - File length is not valid.

  • 211401 - File ID is missing.

  • 211402 - File ID is not valid.

  • 211403 - File ID already exists.

  • 211501 - File name is missing.

  • 211502 - File name is not valid.

  • 211902 - Type is not valid.

  • 211912 - Verification series is not valid.

  • 311101 - Invoice number and OCR number are missing.

  • 311601 - Date is missing.

  • 311602 - Date is not valid.

  • 315211 - Total sum is missing.

  • 315212 - Total sum is not valid.

  • 315222 - VAT is not valid.

  • 315302 - Invoice number is not valid.

  • 315312 - OCR number is not valid.

  • 315401 - Account row is missing.

  • 315402 - Account row is not valid.

  • 315492 - Debit and credit do not balance.

  • 411601 - Date is missing.

  • 411602 - Date is not valid.

  • 411801 - Description is missing.

  • 411802 - Description is not valid.

  • 411911 - Verification series is missing.

  • 411912 - Verification series is not valid.

  • 415401 - Account row is missing.

  • 415402 - Account row is not valid.

  • 415492 - Debit and credit do not balance.

  • 511401 - Progenitor ID is missing.

  • 511402 - Progenitor ID is not valid.

  • 511403 - Progenitor ID is already exists.

  • 511612 - DateTime is not valid.

  • 611001 - Can not identify a matching supplier.

  • 611101 - Corporate identity number, bankgiro number, plusgiro number and IBAN are missing.

  • 611401 - Supplier ID is missing.

  • 611402 - Supplier ID is not valid.

  • 611403 - Supplier ID already exists.

  • 611502 - Supplier name is not valid.

  • 613102 - Corporate identity number is not valid.

  • 613202 - Bankgiro number is not valid.

  • 613212 - Plusgiro number is not valid.

  • 613222 - IBAN is not valid.

  • 1000010 - API certification error.

  • 1009100 - Something unexpected happened.

  • 1009210 - Database connection failed.

  • 1009220 - Database operation failed.

  • 1009230 - Database temporarily offline.