Last revised: 2017-06-26 History Of Changes
Probably we should change all keys in the JSON request bodies to snake_case format, at the moment it's a mixture of snake_case and camelCase...
The base URL for all API resources and functions is
https://api.zillions.it
All resource and function identifiers in this document are implicitly preceded by the above-mentioned URL.
To specifiy a version, the keyword version=<required version> must be added to the URL query string, for example /accounts/55?version=v0.2. If the requested version does not exist, the API falls back to the current stable version. If the version=<required version> keyword is omitted in the call to the API, the API uses the current stable version. The currently used version is displayed under the header tag Zillions-API-Version in the HTTP response of the API.
The current stable default version is v0.3
v0.2v0.3Mandatory headers:
zillions-environment (I would like this to be Zillions-Environment in the future)Zillions-Client-IDZillions-Client-SecretIn order to authenticate an API request, the headers Zillions-Client-ID and Zillions-Client-Secret must be provided with each API call. Zillions-Client-ID is a 20-digit key consisting of numbers and uppercase letters A to F. Zillions-Client-Secret is a 40-digit secret key consisting of numbers and letters. Example curl command:
curl -X GET \
-H "zillions-environment:dev" \
-H "Zillions-Client-ID:<CLIENT-ID>" \
-H "Zillions-Client-Secret:<CLIENT-SECRET>" \
'https://api.zillions.it/users/10/functions'The Zillions environment (i.e. database) is selected with the zillions-environment header. Possible environments are: demo, test, dev, and prod. Note that not all environments are enabled for each client, by default only the dev environment is enabled. If a client requests an environment which is not yet enabled, the API response is equal to the response for an unsuccessful authentication, see next section. Example curl command:
curl -X GET \
-H "zillions-environment:prod" \
-H "Zillions-Client-ID:<CLIENT-ID>" \
-H "Zillions-Client-Secret:<CLIENT-SECRET>" \
'https://api.zillions.it/users/13333/accounts'{
"information": {
"statusCode": 403,
"statusMessage": "[403] Forbidden.",
"infoLevel": "Error",
"internalErrorCode": null,
"message": "You do not have authorization to request this resource",
"additionalInfo": null
},
"meta": {},
"data": null
}TODO
version=<version>v0, v0.2, v1debug=[true/false]"meta" section of the response.suppress_http_codes=[true/false]200 [OK].NOT YET IMPLEMENTED
{
"information": {
"statusCode": <HTTP status Code>,
"statusMessage": "[<statusCode>] Corresponding HTTP status message",
"infoLevel": "OK/Warning/Error",
"internalErrorCode": <internal error code>,
"message": "a more detailed status/warning/error message"
"(intended for the API user)",
"additionalInfo": "<related link to documentation (TBD)> (TBD)"
},
"data": <the output of the DB procedures>,
"meta": "additional technical information (row counts, ...) (TBD)"
}validateInputBulkusersId, expenseSourcesId, languagePOST validateInputBulk
{
"usersId": 19271,
"expenseSourcesId": 1804,
"language": "en"
}If all required data are supplied (usersId, expenseSourcesId, language), the function validateInputBulk always returns with HTTP status 200.
{
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "Successfully executed validateInputBulk.",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": [
{
"expense_sources_id": <expense_sources_id>,
"trx_number": <transaction number of csv file>,
"error_flag": true/false,
"warning_flag": true/false,
"error_message": <contains row and field name on invalid required field>,
"warning_message": <contains row and field name on invalid optional field>
},
...,
],
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 400,
"statusMessage": "[400] Bad Request.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Not all required fields present. "\
"Missing fields: <LIST OF MISSING FIELDS>",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": null,
"meta": additional technical information (row counts, ...) (TBD)
}{
"information": {
"statusCode": 500,
"statusMessage": "[500] Internal Server Error",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Internal Server Error.",
"additionalInfo": "<related link to documentation>"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}insertBulkusersId, expenseSourcesIdPOST insertBulk
{
"usersId": 19271,
"expenseSourcesId": 1804
}If all required input data (expenseSourcesId, usersId) are present, the function insertBulk always returns with HTTP status 200.
{
"information": {
"statusCode": 200
"statusMessage": "[200] OK.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "Successfully inserted expenses",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": {
"success": true
},
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "Warning",
"internalErrorCode": null,
"message": "No expenses to insert",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": {
"success": true
},
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Transactions are not valid",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": {
"success": false
},
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Expense source for current user does not exist",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": {
"success": false
},
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 400,
"statusMessage": "[400] Bad Request.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Not all required fields present." \
"Missing fields: <LIST OF MISSING FIELDS>",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 500,
"statusMessage": "[500] Internal Server Error",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Internal Server Error.",
"additionalInfo": "<related link to documentation>"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}DEPRECATED! USE POST TO users/ID/accounts SEE THE CORRESPONDING SECTION
createTokenFIreturnUrlSo far, this function only uses the returnUrl key. Also, it connects to a fake bank with a temporary user. The mapping of saltedge customer ids and account ids to our user ids and account ids will be added gradually and documented here.
{
"usersId": 10,
"fiId": 1,
"returnUrl": "https://www.zillions.it"
}{
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "Successfully created Token",
"additionalInfo": "<related link to documentation>"
},
"meta": {
"error_class_saltedge": null,
"error_message_saltedge": null
},
"data": {
"success": true,
"usersId": 10,
"fiId": 1,
"return_url": "https://www.zillions.it",
"token": <TOKEN>,
"connect_url": "https://www.saltedge.com/connect?token=<TOKEN>",
"expires_at": "2017-12-04T11:07:38Z"
}
}{
"information": {
"statusCode": 422,
"statusMessage": "[422] Unprocessable Entity.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Could not create Token",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": {
"success": false,
"usersId": 10,
"fiId": 1,
"return_url": "https://www.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null
},
"meta": {
"error_class_saltedge": <saltedge error class>,
"error_message_saltedge": <saltedge error message>
}
}{
"information": {
"statusCode": 400,
"statusMessage": "[400] Bad Request.",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Not all required fields present." \
"Missing fields: <LIST OF MISSING FIELDS>",
"additionalInfo": "<related link to documentation> (TBD)"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}{
"information": {
"statusCode": 500,
"statusMessage": "[500] Internal Server Error",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Internal Server Error.",
"additionalInfo": "<related link to documentation>"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}NOT YET IMPLEMENTED
users/<users_id>/functions/<function_id>users/<users_id>/functionsexecution_time=<DATETIME string>: optional: this specifies the execution time. If omitted, the current datetime is used.Example request:
GET users/12345/functions?execution_time=2017-12-02T13:00
Response:
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "[200] OK.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": [
{
"function_id": 1,
"function_name": "DocumentUpload",
"enabled": true,
"function_description": "",
"limit_type": "zillions_auth.docs_year",
"function_limit": 100,
"execution_time": "2017-12-02T12:00:00.000Z",
"current_plan": 1,
"users_id": "12345"
},
{
"function_id": 1,
"function_name": "DocumentUpload",
"enabled": true,
"function_description": "",
"limit_type": "zillions_auth.doc_size_mb",
"function_limit": 5,
"execution_time": "2017-12-02T12:00:00.000Z",
"current_plan": 1,
"users_id": "12345"
},
{
"function_id": 1,
"function_name": "DocumentUpload",
"enabled": true,
"function_description": "",
"limit_type": "zillions_auth.total_storage_gb",
"function_limit": 0.3,
"execution_time": "2017-12-02T12:00:00.000Z",
"current_plan": 1,
"users_id": "12345"
}
]function_id or function_name, and the user's usage_plan.users/<users_id>/functions/<function_id OR function_name>execution_time=<datetime string>: optional. Specifies the execution time. If omitted, the current datetime is used. Example: execution_time=2017-11-20%2011:00.execution_value=<execution value>: optional. Specifies the queried execution value. Example: execution_value=3.0.limit_type=<limit type>: optional (?). Specifies the queried limit type. Example: limit_type=zillions_auth.doc_size_mb.Example request:
GET users/12345/functions/1?execution_value=4.3&limit_type=zillions_auth.doc_size_mb
or:
GET users/12345/functions/DocumentUpload?execution_value=4.3\
&limit_type=zillions_auth.doc_size_mb
Response:
"information": {
"statusCode": 200,
"statusMessage": "[200] OK.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "[200] OK.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"function_id": 1,
"function_name": "DocumentUpload",
"enabled": true,
"function_message": "ok",
"limit_allowed": 1,
"limit_message": "ok",
"execution_time": "2017-12-06T12:04:28.000Z",
"execution_value": 4.3,
"limit_type": "zillions_auth.doc_size_mb",
"function_limit": 5,
"current_plan": 1,
"users_id": "12345"
}users/<users_id>/accountsfis_id, return_urlPOST users/12971/accounts
{
"fis_id": 66,
"return_url": "https://my.zillions.it"
}The same request can be supplied multiple times. The corresponding responses then give information about the status of the request. Alternatively, the request_id returned in the response of the first request can be used to check the status of the request in the update_requests table in the import database. When all accounts and transactions for the corresponding request are imported into the database, update_requests.request_status='complete'.
{
"information": {
"statusCode": 202,
"statusMessage": "[202] Accepted.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "Successfully created Token",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": 10,
"return_url": "https://my.zillions.it",
"token": "https://www.some.url/<TOKEN>",
"connect_url": "<TOKEN>",
"expires_at": "2018-03-01T11:42:40Z",
"request_status": "pending"
}
}{
"information": {
"statusCode": 409,
"statusMessage": "[409] Conflict.",
"infoLevel": "Error",
"internalErrorCode": null,
"message": "The update request for user 12971 with FI 66 is processing at the moment.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": 10,
"return_url": "https://my.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null,
"request_status": "processing"
}
}{
"information": {
"statusCode": 303,
"statusMessage": "[303] See Other.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "The update request for user 12971 with FI 66 is already complete.
All accounts and transactions are imported.
See imported accounts under
'https://api.zillions.it/accounts?creation_type=accounts&created_by=10&version=v0.3'
and imported transactions under
'https://api.zillions.it/transactions?creation_type=accounts&created_by=10&version=v0.3'.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": 10,
"return_url": "https://my.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null,
"request_status": "complete",
"url_accounts":
"https://api.zillions.it/accounts?creation_type=accounts&created_by=10&version=v0.3",
"url_transactions":
"https://api.zillions.it/transactions?creation_type=accounts&created_by=10&version=v0.3"
}
}{
"information": {
"statusCode": 422,
"statusMessage": "[422] Unprocessable Entity.",
"infoLevel": "Error",
"internalErrorCode": null,
"message": "Could not create Token.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": null,
"return_url": "https://my.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null,
"request_status": "failed"
}
}{
"information": {
"statusCode": 500,
"statusMessage": "[500] Internal Server Error",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Internal Server Error.",
"additionalInfo": "<related link to documentation>"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}users/<users_id>/accounts/<accounts_id>/refreshreturn_urlPOST users/12967/accounts/67/refresh
{
"return_url": "https://my.zillions.it"
}The same request can be supplied multiple times. The corresponding responses then give information about the status of the request. Alternatively, the request_id returned in the response of the first request can be used to check the status of the request in the update_requests table in the import database. When all accounts and transactions for the corresponding request are imported into the database, update_requests.request_status='complete'.
{
"information": {
"statusCode": 202,
"statusMessage": "[202] Accepted.",
"infoLevel": "OK",
"internalErrorCode": null,
"message": "Successfully created Token",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": 10,
"return_url": "https://my.zillions.it",
"token": "https://www.some.url/<TOKEN>",
"connect_url": "<TOKEN>",
"expires_at": "2018-03-01T11:42:40Z",
"request_status": "pending"
}
}{
"information": {
"statusCode": 409,
"statusMessage": "[409] Conflict.",
"infoLevel": "Error",
"internalErrorCode": null,
"message": "The update request for user 12971 with FI 66 is processing at the moment.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": 10,
"return_url": "https://my.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null,
"request_status": "processing"
}
}{
"information": {
"statusCode": 422,
"statusMessage": "[422] Unprocessable Entity.",
"infoLevel": "Error",
"internalErrorCode": null,
"message": "Could not create Token.",
"additionalInfo": "<link to documentation>"
},
"meta": {},
"data": {
"users_id": "12971",
"fis_id": "66",
"request_id": null,
"return_url": "https://my.zillions.it",
"token": null,
"connect_url": null,
"expires_at": null,
"request_status": "failed"
}
}{
"information": {
"statusCode": 500,
"statusMessage": "[500] Internal Server Error",
"infoLevel": "Error",
"internalErrorCode": (TBD),
"message": "Internal Server Error.",
"additionalInfo": "<related link to documentation>"
},
"data": null,
"meta": "additional technical information (row counts, ...) (TBD)"
}function_id or function_name, and the user's usage_plan.users_id to a bank with fis_idrequest_id with which the status of the request can be checkedrequest_status is complete, all accounts and transactions are importedaccounts_id of a user with users_idrequest_id with which the status of the request can be checkedrequest_status is complete, all new account and transaction data are imported