API Documentation

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 new AutoROICalc Records.

Records properties:

AttributeTypeDescription
datedateYYYY-MM-DD
timetimeHH:MM:SS
typestringThe Record type
activitystring‘open’ | ‘closed’ – currently not applicable
descstringThe Record description
sourcearray<string>The Record sources
valuefloatThe Record value
The AutoROICalc Records properties table

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
         }
     }]
 }