Documentation API Cosmic Latte - JU-DEV-Bootcamps/ERAS GitHub Wiki

Endpoints list to obtain survey information

Authorization: Add header "x-apikey" with Api key

Evaluations

Get all evaluations:

This endpoint returns all the evaluations related to the API key. (Even if there are several surveys, all the evaluations are returned together). If we send Evaluation_id this only retrieves an evaluation

image


Get results of an evaluation by its ID (sent in the body)

POST: https://staging.cosmic-latte.com/api/1.0/evaluations/exec/evaluationAnswers

  • Requires header with API key
  • Requires body with: { "@data": { "_id": "Evaluation_id" } }
  • Response: Details of an evaluation

image


Get results of a set of evaluations by its ID of questionnaire (This value is in the field "evaluationSets:ID_Questionnaire")

POST: https://staging.cosmic-latte.com/api/1.0/evaluationSets/exec/evaluationsAnswers

  • Requires header with API key
  • Requires body with: { "@data": { "_id": "ID_Questionnaire" } }
  • Response: List of answers for the questionnaire, all answers in text form

image


Get evaluation details by the ID

POST: https://staging.cosmic-latte.com/api/1.0/evaluations/exec/evaluationDetails

  • Requires header with API key
  • Requires body with: { "@data": { "_id": "Evaluation_id" } }
  • Response: List of questions and answers

image


Endpoints to obtain survey information

Steps:

  1. Get questionnaire ID (endpoint api/1.0/evaluations, filter by name)
  2. In the response, in any of the evaluations, there is a property called “parent” that contains a value with the questionnaire id: "parent": "evaluationSets:ahdcosdMBR8aFsM9D" You have to remove the “evaluationSets:” part and the rest will be the id
  3. Call the evaluationSets/exec/evaluationsAnswers endpoint and within the response:
  • the first array brings the ids of the evaluations made by users that correspond to that questionnaire.
  • The first 10 arrays are information about schedules, start, end and other details
  • After the tenth array, the array of responses to each question in the form begins. Contains the textual response
  1. Obtain questions: request to endpoint evaluations/exec/evaluationDetails (by any evaluation id) and this retrieve questions in text form and position to be mapped