The current AutoROICalc API integration version is v1. The default request/response format is JSON. Successful requests return a 200 OK HTTP status. The API documentation consists of these sections:
Authentication
To use the API, you need to authenticate your User Account. This is currently done via HTTP Basic Auth.
- In this current API integration, the “username” is the User´s e-mail address.
- As the password, the User uses his User Account API key that can be found in the Account section.
Records
The Records API currently allows you to add, update, and delete AutoROICalc Records.
Records properties:
Attribute | Type | Description |
---|---|---|
id | number | The Record id |
date | date | YYYY-MM-DD |
time | time | HH:MM:SS |
type | string | The Record type |
activity | string | ‘open’ | ‘closed’ – currently not applicable |
desc | string | The Record description |
source | array<string> | The Record sources |
value | float | The Record value |
Add Records
This API helps you to add new AutoROICalc Records.
Sample Records data:
[ { "date": "2021-04-04", "time": "16:35", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource1", "exampleSource2"], "value": 13.94 }, { "date": "2021-04-05", "time": "12:09", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource1"], "value": 20.21 } ]
HTTP request:
POST https://autoroicalc.com/api/auto-roi-calc/v1/add-records
Example request:
curl -v -u <USER_EMAIL>:<USER_API_KEY> \ -H "Content-Type: application/json" \ -d '[{"date":"2021-04-04","time":"16:35","type":"exampleType","activity":"closed","desc":"exampleDescription","source":["exampleSource1","exampleSource2"],"value":13.94},{"date":"2021-04-05","time":"12:09","type":"exampleType","activity":"closed","desc":"exampleDescription","source":["exampleSource1"],"value":20.21}]' \ -X POST https://autoroicalc.com/api/auto-roi-calc/v1/add-records
Successful response:
{ "auth": "valid", "jsonCheck": "valid", "noOfRecords": 2, "apiLimit": "ok", "results": [{ "status": true, "message": false, "result": true, "recordData": { "date": "2021-04-04", "time": "16:35:00", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource1", "exampleSource2"], "value": 13.94 } }, { "status": true, "message": false, "result": true, "recordData": { "date": "2021-04-05", "time": "12:09:00", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource1"], "value": 20.21 } }] }
Update Records
This API helps you to update existing AutoROICalc Records. The “id” attribute identifies your Record.
Sample Records data to update:
[ { "id": 4 "date": "2021-04-04", "time": "16:35", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource"], "value": 13.94 } ]
HTTP request:
PUT https://autoroicalc.com/api/auto-roi-calc/v1/update-records
Example request:
curl -v -u <USER_EMAIL>:<USER_API_KEY> \ -H "Content-Type: application/json" \ -d '[{"id":4,"date":"2021-04-04","time":"16:35","type":"exampleType","activity":"closed","desc":"exampleDescription","source":["exampleSource"],"value":13.94}]' \ -X PUT https://autoroicalc.com/api/auto-roi-calc/v1/update-records
Successful response:
{ "auth": "valid", "jsonCheck": "valid", "noOfRecords": 1, "apiLimit": "ok", "results": [{ "status": true, "message": false, "result": true, "recordData": { "date": "2021-10-23", "time": "08:00:00", "type": "exampleType", "activity": "closed", "desc": "exampleDescription", "source": ["exampleSource"], "value": 1 } }] }
Delete Records
This API helps you to delete your AutoROICalc Records.
Sample data to delete:
[1, 2, 3]
HTTP request:
DELETE https://autoroicalc.com/api/auto-roi-calc/v1/delete-records
Example request:
curl -v -u <USER_EMAIL>:<USER_API_KEY> \ -H "Content-Type: application/json" \ -d '[1, 2, 3]' \ -X DELETE https://autoroicalc.com/api/auto-roi-calc/v1/delete-records
Successful response:
{ "auth": "valid", "jsonCheck": "valid", "noOfRecords": 3, "apiLimit": "ok", "results": [{ "status": true, "result": true }, { "status": true, "result": true }, { "status": true, "result": true }] }