API Methods

Please contact us api@retinarisk.com for access to our sandbox and production servers.

Access to the Sandbox server is granted for a month from sign-up and allows for 200 free calculations with the RetinaRisk algorithm. When the month or call limit is reached on the Sandbox server, please contact our team with the email above.

Authentication

POST: /api/auth/sign-up

Create user account in AWS Cognito.

Email will be sent from ‘no-reply@verificationemail.com’ with access codes. The password must be 8 or more in length, include lowercase letters, at least 1 capital letter and number.


Headers:
Content-Type: application/json

Body example:
{
  "email": "email@gmail.com",
  "password": "testTEST1234"
}

Response example:
{
  "status": "SUCCESS"
}

POST: /api/auth/confirm-sign-up

Confirm new user with access code sent to users email.

Headers:
Content-Type:application/json

Body example: 
{
  "email": "email@gmail.com",
  "code": "957833"
}
Response example:
{
  "status": "SUCCESS"
}

POST: /api/auth/sign-in

After user has created an account, one must sign in to receive access_token. This authentication token is required to access the RetinaRisk calculator.
When the access_token has been received, you can directly go to the Calculations section below.


Headers:
Content-Type:application/json

Body example:
{
  "email": "email@gmail.com",
  "password": "testTEST1234"
}

Response example:
{
  "access_token": 
 "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXNzYWdlIjoiQ2Fubm90IHJlYWQgcHJvcGVydHkgJ3VzZXJSZXBvc2l0b3J5JyBvZiB1bmRlZmluZWQiLCJzdGF0dXMiOjUwMCwiaWF0IjoxNTk2ODA5ODgyfQ.IkC7NYBKyyNBNbjK2SA1diU3tBAnuCwSxnNizIiG34U"
}

POST: /api/auth/change-password

Change users password.

Headers:
Content-Type:application/json

Body example:
{
  "email": "email@gmail.com",
  "previousPassword": "testTEST1234",
  "proposedPassword": "testTEST12345"
}

Response example:
{
  "message": "password changed successfully",
  "statusCode": 200
}

POST: /api/auth/reset-password

Reset password email sent to user.

Headers:
Content-Type:application/json

Body example:
{
  "email": "email@gmail.com"
}

Response example:
{
  "message": "password reset successfully"
}

POST: /api/auth/confirm-reset-password

Confirm new password with access code given in email.

Headers:
Content-Type:application/json

Body example:
{
  "email": "email@gmail.com",
  "password": "testTEST1234",
  "code": "957833"
}

Response example:
{
  "status": "SUCCESS"
}

POST: /api/auth/resend-confirmation-code

Resend user access confirmation email.


Headers:
Content-Type:application/json

Body example:
{
  "email": "email@gmail.com"
}

Response example:
{
  "message": "new confirmation code was successfully sent"
}

Calculations

POST: /api/calculator/calculateRisk

API CALCULATOR INPUTS

  • Data
    • Type of diabetes (type1 / type2) (string)
    • Duration of diabetes (X years) (integer)
    • Gender (male/female) (string)
    • Diagnosis of diabetic retinopathy (0 / 1) (boolean)
    • Blood pressure
      • Diastolic (40-200) (integer)
      • Systolic (60-200) (integer)
    • HbA1c  (0.0-12.0%) (float)
  • Options
    • format (json)
    • language
      • English (en)
      • Spanish (es)
      • Deutsch (de)
      • Icelandic (is)

 

API CALCULATOR RETURNS

The RetinaRisk API outputs consists of three different pieces of information:

  • Calculation of the risk of developing sight threatening diabetic retinopathy in the next 12 months displayed in percentages.
  • Recommendation of appropriate eye screening interval (SI), given in months.
    • Max recommended interval given is 24 months.
  • Analysis of the risk factors most affecting each risk calculation.

 

Headers:Content-Type:application/json 

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXNzYWdlIjoiQ2Fubm90IHJlYWQgcHJvcGVydHkgJ3VzZXJSZXBvc2l0b3J5JyBvZiB1bmRlZmluZWQiLCJzdGF0dXMiOjUwMCwiaWF0IjoxNTk2ODA5ODgyfQ.IkC7NYBKyyNBNbjK2SA1diU3tBAnuCwSxnNizIiG34U

Body example:
{
  "data":
  {
    "diabetesDuration": "15",
    "diabetesType": "type2",
    "gender": "female",
    "hasRetinopathy": "0",
    "bloodGlucose": "6.72",
    "bloodPressures":
    {
      "diastolic": "100",
      "systolic": "160"
    }
  },
  "options":
  {
    "format":"json",
    "language":"en"
  }
}

Response example:
{
  "results": {
    "RiskValue": 1.5,
    "ScreeningInterval": 16,
    "Analysis": {
      "riskValue": {
        "title": "MEDIUM RISK OF RETINOPATHY",
        "text": "You have a medium risk of developing sight threatening retinopathy."
      },
      "diabetesDuration": {
        "title": "Diabetes Duration",
        "text": "Your risk of developing sight threatening retinopathy is impacted by your duration of your diabetes. As the duration increases the need for better eye care is of importance."
      },
      "bloodPressure": {
        "title": "Blood Pressure",
        "text": "Your blood pressure is above average. High blood pressure accelerates the progression of diabetic retinopathy. Keep your blood pressure less than or equal to 130/80."
      }
    }
  }
}