You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The qne service uses a RESTful JSON API for all communication. This publicly available endpoint is located at [origin]/api.
NOTE: [origin] in the following addresses needs to be replaced by the qne server address, for example in development use http://localhost:3000
Security
There are four types of endpoint security in the API:
email/password authentication
JWT token authentication
random number authentication
no authentication
1. Email/password authentication
This method is used for in security related endpoints, such as [origin]/api/v1/authenticate. Authentication is provided using HTTP Basic access authentication.
2. JWT token authenticaton
Token authentication is the most common authentication method that is built using JSON Web Tokens. The token is obtained from the [origin]/api/v1/authenticate POST endpoint and passed to the methods using token authentication in the HTTP Header Authorization: Bearer <token>.
3. Random number authenticaton
Random number authentication is used in individualized questionnaire endpoints, and is passed in the url or in the payload. For example some questionnaire URL:s might need additional security, and some respondent links might be unique, which would result in an endpoint [origin]/api/v1/questions/[questionnaire path]/questionnaire/[questionnaire_random_number]/respondent/[respondent_random_number]
4. No authentication
qne also hosts a public methods, which use no authentication. These are e.g. methods that receive publicly available questionnaires, such as GET [origin]/api/v1/questions/[questionnaire_path].
Security endpoints
Authenticate
Description
Value
Endpoint
/api/v1/authenticate
Method
POST
Security
1
Description
Authenticates the user and returns a JWT token.
Administration endpoints
Create New Questionnaire
Description
Value
Endpoint
/api/v1/questionnaires
Method
PUT
Security
2
Description
Creates a new questionnaire, payload is the full questionnaire.
Update Questionnaire
Description
Value
Endpoint
/api/v1/questionnaires/[questionnaire_uuid]
Method
PUT
Security
2
Description
Updates an existing questionnaire, payload has the full questionnaire.
Delete Questionnaire
Description
Value
Endpoint
/api/v1/questionnaires/[questionnaire_uuid]
Method
DELETE
Security
2
Description
Deletes an existing questionnaire, which is not deployed.