{"openapi":"3.0.0","info":{"title":"Minidiag API","description":"","version":"1.0.0"},"servers":[{"url":"\/","description":""}],"paths":{"\/api\/authentication_token":{"ref":"JWT Token","post":{"operationId":"adminPostCredentialsItem","tags":["Token"],"responses":{"200":{"description":"Get JWT token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Token"}}}}},"summary":"Get JWT token to admin login.","description":"Get JWT token to admin login.","parameters":[],"requestBody":{"description":"Generate new JWT Token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Credentials"}}},"required":false},"deprecated":false},"parameters":[]},"\/api\/participations":{"post":{"operationId":"postParticipationCollection","tags":["Participation"],"responses":{"201":{"description":"Participation resource created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}}},"links":{"GetParticipationItem":{"operationId":"getParticipationItem","parameters":{"id":"$response.body#\/id"},"description":"The `id` value returned in the response can be used as the `id` parameter in `GET \/api\/participations\/{id}`."}}},"400":{"description":"Invalid input"},"422":{"description":"Unprocessable entity"}},"summary":"Creates a Participation resource.","description":"Creates a Participation resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"requestBody":{"description":"The new Participation resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationPostInput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationPostInput"}}},"required":true},"deprecated":false},"parameters":[]},"\/api\/participations\/{id}":{"get":{"operationId":"getParticipationItem","tags":["Participation"],"responses":{"200":{"description":"Participation resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}}}},"404":{"description":"Resource not found"}},"summary":"Retrieves a Participation resource.","description":"Retrieves a Participation resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"X-PARTICIPATION-KEY","in":"header","description":"The participation security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"delete":{"operationId":"deleteParticipationItem","tags":["Participation"],"responses":{"204":{"description":"Participation resource deleted"},"404":{"description":"Resource not found"}},"summary":"Removes the Participation resource.","description":"Removes the Participation resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"X-PARTICIPATION-KEY","in":"header","description":"The participation security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"parameters":[]},"\/api\/participations\/{id}\/answer":{"post":{"operationId":"answerParticipationItem","tags":["Participation"],"responses":{"201":{"description":"Participation resource created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationDetailsOutput"}}},"links":{"GetParticipationItem":{"operationId":"getParticipationItem","parameters":{"id":"$response.body#\/id"},"description":"The `id` value returned in the response can be used as the `id` parameter in `GET \/api\/participations\/{id}`."}}},"400":{"description":"Invalid input"},"422":{"description":"Unprocessable entity"},"404":{"description":"Resource not found"}},"summary":"Answer the current question of this participation","description":"Answer the current question of this participation","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"X-PARTICIPATION-KEY","in":"header","description":"The participation security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"requestBody":{"description":"The new Participation resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationAnswerInput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationAnswerInput"}}},"required":true},"deprecated":false},"parameters":[]},"\/api\/participations\/{id}\/current-question":{"get":{"operationId":"next_questionParticipationItem","tags":["Participation"],"responses":{"200":{"description":"Participation resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationCurrentQuestionOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Participation.ParticipationCurrentQuestionOutput"}}}},"404":{"description":"Resource not found"}},"summary":"Gets the next question information.","description":"Gets the next question information. NOTE: you can use the ENABLE_NEW_ANSWER_OUTPUT environment variable to enable the new answer output format. If not set, the old format (key\/value) will be used.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"X-PARTICIPATION-KEY","in":"header","description":"The participation security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"parameters":[]},"\/api\/persons":{"post":{"operationId":"postPersonCollection","tags":["Person"],"responses":{"201":{"description":"Person resource created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}}},"links":{"GetPersonItem":{"operationId":"getPersonItem","parameters":{"id":"$response.body#\/id"},"description":"The `id` value returned in the response can be used as the `id` parameter in `GET \/api\/persons\/{id}`."}}},"400":{"description":"Invalid input"},"422":{"description":"Unprocessable entity"}},"summary":"Creates a Person resource.","description":"Creates a Person resource.","parameters":[],"requestBody":{"description":"The new Person resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonPostInput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonPostInput"}}},"required":true},"deprecated":false},"parameters":[]},"\/api\/persons\/{id}":{"get":{"operationId":"getPersonItem","tags":["Person"],"responses":{"200":{"description":"Person resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}}}},"404":{"description":"Resource not found"}},"summary":"Retrieves a Person resource.","description":"Retrieves a Person resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"put":{"operationId":"putPersonItem","tags":["Person"],"responses":{"200":{"description":"Person resource updated","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonDetailsOutput"}}},"links":{"GetPersonItem":{"operationId":"getPersonItem","parameters":{"id":"$response.body#\/id"},"description":"The `id` value returned in the response can be used as the `id` parameter in `GET \/api\/persons\/{id}`."}}},"400":{"description":"Invalid input"},"422":{"description":"Unprocessable entity"},"404":{"description":"Resource not found"}},"summary":"Replaces the Person resource.","description":"Replaces the Person resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"requestBody":{"description":"The updated Person resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonPutInput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Person.PersonPutInput"}}},"required":true},"deprecated":false},"delete":{"operationId":"deletePersonItem","tags":["Person"],"responses":{"204":{"description":"Person resource deleted"},"404":{"description":"Resource not found"}},"summary":"Removes the Person resource.","description":"Removes the Person resource.","parameters":[{"name":"X-PERSON-KEY","in":"header","description":"The person security key","required":false,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false},{"name":"id","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"parameters":[]},"\/api\/surveies\/file":{"post":{"operationId":"post_fileSurveyCollection","tags":["Survey"],"responses":{"201":{"description":"Survey resource created","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Survey.SurveyDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Survey.SurveyDetailsOutput"}}},"links":{"GetSurveyItem":{"operationId":"getSurveyItem","parameters":{"name":"$response.body#\/name"},"description":"The `name` value returned in the response can be used as the `name` parameter in `GET \/api\/surveies\/{name}`."}}},"400":{"description":"Invalid input"},"422":{"description":"Unprocessable entity"}},"summary":"File with survey","description":"Creates a Survey resource.","parameters":[],"requestBody":{"description":"","content":{"multipart\/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary"}}}}},"required":false},"deprecated":false},"parameters":[]},"\/api\/surveies\/{name}":{"get":{"operationId":"getSurveyItem","tags":["Survey"],"responses":{"200":{"description":"Survey resource","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Survey.SurveyDetailsOutput"}},"text\/html":{"schema":{"$ref":"#\/components\/schemas\/Survey.SurveyDetailsOutput"}}}},"404":{"description":"Resource not found"}},"summary":"Retrieves a Survey resource.","description":"Retrieves a Survey resource.","parameters":[{"name":"name","in":"path","description":"Resource identifier","required":true,"deprecated":false,"allowEmptyValue":false,"schema":{"type":"string"},"style":"simple","explode":false,"allowReserved":false}],"deprecated":false},"parameters":[]},"\/api\/token\/refresh":{"ref":"Refresh JWT Token","post":{"operationId":"adminRefreshToken","tags":["Token"],"responses":{"200":{"description":"Get JWT token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Token"}}}}},"summary":"Refresh JWT token to admin login.","description":"Refresh JWT token to admin login.","parameters":[],"requestBody":{"description":"Refresh JWT Token","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RefeshToken"}}},"required":false},"deprecated":false},"parameters":[]}},"components":{"schemas":{"KeyValuePairDTO":{"type":"object","description":"","required":["key","value"],"properties":{"key":{"description":"The key linked to the value.","type":"string"},"value":{"description":"The value.","type":"string"}}},"Participation":{"type":"object","description":"","properties":{"id":{"readOnly":true,"description":"Identifier of the Participation.","type":"integer"},"person":{"type":"string","format":"iri-reference"},"survey":{"type":"string","format":"iri-reference"},"securityKey":{"type":"string","format":"ulid"},"isFinalized":{"type":"boolean"},"finalizedDate":{"type":"string","format":"date-time","nullable":true},"currentQuestion":{"type":"string","format":"iri-reference"},"results":{"type":"array","items":{"type":"string"}},"createdDate":{"default":"CURRENT_TIMESTAMP","example":"CURRENT_TIMESTAMP","type":"string","format":"date-time"},"createdBy":{"type":"string","format":"iri-reference","nullable":true},"updatedDate":{"type":"string","format":"date-time","nullable":true},"updatedBy":{"type":"string","format":"iri-reference","nullable":true},"deletedDate":{"type":"string","format":"date-time","nullable":true},"deletedBy":{"type":"string","format":"iri-reference","nullable":true},"isDeleted":{"type":"boolean"},"finalized":{"readOnly":true,"type":"boolean"},"deleted":{"readOnly":true,"type":"boolean"}}},"Participation.ParticipationAnswerInput":{"type":"object","description":"","properties":{"answers":{"description":"answers to a question.","type":"array","items":{"type":"string"}}}},"Participation.ParticipationCurrentQuestionOutput":{"type":"object","description":"","properties":{"field":{"type":"string","nullable":true},"chapterName":{"type":"string","nullable":true},"label":{"description":"label (e.g. title) of the question.","type":"string"},"description":{"description":"description text of the question.","type":"string","nullable":true},"mediaUrl":{"description":"URL of the media linked to the question.","type":"string","nullable":true},"type":{"description":"type of the question.","type":"string"},"number":{"type":"integer"},"nbQuestions":{"type":"integer","nullable":true},"parameters":{"description":"parameters linked to the answering format.","$ref":"#\/components\/schemas\/QuestionParametersDTO"},"possibleAnswers":{"description":"possible answers for this question. Note: this array can be empty.","type":"array","items":{"$ref":"#\/components\/schemas\/ParticipationCurrentQuestionAnswerOutput"}}}},"Participation.ParticipationDetailsOutput":{"type":"object","description":"","properties":{"id":{"description":"Identifier","type":"integer"},"personId":{"description":"ID of the person.","type":"integer"},"surveyId":{"description":"ID of the survey.","type":"integer"},"securityKey":{"description":"Security key for this participation","type":"string","format":"ulid"},"isFinalized":{"description":"Either this participation is finalized or not","type":"boolean"},"finalizedDate":{"description":"The finalisation date of the participation, if any.","type":"string","format":"date-time","nullable":true},"currentQuestionId":{"description":"The current question ID of this participation.","type":"integer"},"results":{"description":"Results of this participation","type":"array","items":{"type":"string"}}}},"Participation.ParticipationPostInput":{"type":"object","description":"","required":["personId","surveyId"],"properties":{"personId":{"description":"The ID of the person which passes the survey.","type":"integer"},"surveyId":{"description":"The ID of the survey to pass.","type":"integer"}}},"ParticipationCurrentQuestionAnswerOutput":{"type":"object","description":"","properties":{"id":{"type":"integer"},"label":{"type":"string"},"descriptionLabel":{"type":"string","nullable":true},"mediaURL":{"type":"string","nullable":true},"sequenceNumber":{"type":"integer"}}},"Person":{"type":"object","description":"","properties":{"id":{"readOnly":true,"description":"Identifier of the Person.","type":"integer"},"metadata":{"type":"array","items":{"type":"string"}},"securityKey":{"type":"string","format":"ulid"},"createdDate":{"default":"CURRENT_TIMESTAMP","example":"CURRENT_TIMESTAMP","type":"string","format":"date-time"},"createdBy":{"type":"string","format":"iri-reference","nullable":true},"updatedDate":{"type":"string","format":"date-time","nullable":true},"updatedBy":{"type":"string","format":"iri-reference","nullable":true},"deletedDate":{"type":"string","format":"date-time","nullable":true},"deletedBy":{"type":"string","format":"iri-reference","nullable":true},"isDeleted":{"type":"boolean"},"deleted":{"readOnly":true,"type":"boolean"}}},"Person.PersonDetailsOutput":{"type":"object","description":"","properties":{"id":{"type":"integer"},"securityKey":{"description":"Security key for this person.","type":"string","format":"ulid"},"metadata":{"description":"A JSON object containing fields regarding the person. These fields are\nfree-formatted to abstract any use of them (e.g. not putting useless fields on\nthis class).","type":"array","items":{"$ref":"#\/components\/schemas\/KeyValuePairDTO"}}}},"Person.PersonPostInput":{"type":"object","description":"","properties":{"metadata":{"description":"A JSON object containing fields regarding the person. These fields are\nfree-formatted to abstract any use of them (e.g. not putting useless fields on\nthis class).","type":"array","items":{"$ref":"#\/components\/schemas\/KeyValuePairDTO"}}}},"Person.PersonPutInput":{"type":"object","description":"","required":["metadata"],"properties":{"metadata":{"description":"A JSON object containing fields regarding the person. These fields are\nfree-formatted to abstract any use of them (e.g. not putting useless fields on\nthis class).","type":"array","items":{"$ref":"#\/components\/schemas\/KeyValuePairDTO"}}}},"QuestionParametersDTO":{"type":"object","description":"","properties":{"length":{"description":"maximum length allowed for this response.","type":"integer","nullable":true},"maxAllowed":{"description":"maximum number of response allowed.","type":"integer","nullable":true},"description":{"description":"maximum number of response allowed.","type":"string","nullable":true},"shortLabel":{"description":"maximum number of response allowed.","type":"string","nullable":true},"unit":{"description":"maximum number of response allowed.","type":"string","nullable":true},"min":{"description":"minimal value for a given response type.","type":"string","nullable":true},"max":{"description":"maximal value for a given response type.","type":"string","nullable":true},"maxPrecision":{"description":"maximal precision allowed for this response.","type":"integer","nullable":true},"placeholder":{"description":"placeholder for input field","type":"string","nullable":true},"displayMode":{"description":"adds a display modification for the field (ex: integer:many)","type":"string","nullable":true},"isMultiple":{"description":"either the response is single, or can be multiple","type":"boolean"},"selectPlusValueType":{"description":"adds a value type for the select plus field","type":"string","nullable":true}}},"Survey.SurveyDetailsOutput":{"type":"object","description":"","properties":{"id":{"type":"integer"},"name":{"type":"string"},"firstQuestionId":{"type":"integer"},"initialResults":{"type":"array","items":{"type":"string"},"nullable":true},"onStartEventId":{"type":"integer","nullable":true},"onFinishEventId":{"type":"integer","nullable":true}}},"Token":{"type":"object","properties":{"token":{"type":"string","readOnly":true},"refresh_token":{"type":"string","readOnly":true}}},"RefeshToken":{"type":"object","properties":{"refresh_token":{"type":"string"}}},"Credentials":{"type":"object","properties":{"login":{"type":"string","example":"admin"},"password":{"type":"string","example":"admin"}}}},"responses":{},"parameters":{},"examples":{},"requestBodies":{},"headers":{},"securitySchemes":{"apiKey":{"type":"apiKey","description":"Value for the Authorization header parameter.","name":"Authorization","in":"header"}}},"security":[{"apiKey":[]}],"tags":[]}