Difference between revisions of "Internal API"

From ITR Wiki
Line 7: Line 7:
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
! Endpoint !! Role !! Description !! Headers
+
! Endpoint !! Role !! Description !! Headers !! Response codes
 
|-
 
|-
 
| test || All || Standard test page  
 
| test || All || Standard test page  
 
|-
 
|-
| copyright || All || Return the copyright information for this ITR installation  
+
| copyright || All || Return the copyright information for this ITR installation || 200 OK
 
|-
 
|-
| companyname || All || Return the company name for this ITR installation  
+
| companyname || All || Return the company name for this ITR installation || 200 OK
 
|-
 
|-
| login || All || Login endpoint  || UserID, Password, CompanyID (optional)
+
| login || All || Login endpoint  || UserID, Password, CompanyID (optional) || 200 OK or 401 user not found in case user is unknown or user id/password combination is not correct
 
|-
 
|-
 +
| sendresetpassword || All || Send a reset password link via mail. The mail contains a URL with a token which is valid for 5 minutes. || UserID || 200 OK or 404 user not found 
 +
|-
 +
| resetpassword || All || Reset the password. In case the account is registered with multiple companies then all these passwords will be reset || UserID, Password, SessionID || 200 OK or 404 user not found or token invalid
 +
|-
 +
| checktoken || All || Checks if the token is valid || UserID, Password, SessionID || 200 OK or 404 token invalid
 +
 +
|-
 +
 
|}
 
|}

Revision as of 09:15, 29 March 2019

Internal API

The internal API is for usage by the website of the ITR. It cannot be used from external websites, unless the flag ENABLE_CORS in the file instance/application.cfg is set to 'Y'. It is strongly discouraged to set this flag to 'Y' for anything else but developmnet systems.

The following API calls are available for the following roles

Endpoint Role Description Headers Response codes
test All Standard test page
copyright All Return the copyright information for this ITR installation 200 OK
companyname All Return the company name for this ITR installation 200 OK
login All Login endpoint UserID, Password, CompanyID (optional) 200 OK or 401 user not found in case user is unknown or user id/password combination is not correct
sendresetpassword All Send a reset password link via mail. The mail contains a URL with a token which is valid for 5 minutes. UserID 200 OK or 404 user not found
resetpassword All Reset the password. In case the account is registered with multiple companies then all these passwords will be reset UserID, Password, SessionID 200 OK or 404 user not found or token invalid
checktoken All Checks if the token is valid UserID, Password, SessionID 200 OK or 404 token invalid