Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 583 Bytes

add-survey.md

File metadata and controls

16 lines (12 loc) · 583 Bytes

Create survey

Success case

  1. ✅ Receive a POST request on route /api/surveys
  2. ✅ Validate if the request was executed by an admin
  3. ✅ Validate required data question and answers
  4. Create a survey with the provided data
  5. ✅ Return 204, without data

Exceptions

  1. ✅ Return error 404 if the API doesn't exist
  2. ✅ Return error 403 if the user is not an admin
  3. ✅ Return error 400 if the question or answers are not provided by the client
  4. ✅ Return error 500 if the survey creation generates an error