To integrate with ReDem, you must have a ReDem account.
Don’t have an account yet? Get started by setting up your account.
1

Request an API key

Contact us at support@redem.io to request an API key.

2

Prepare your request data

Ensure your data is formatted correctly according to the guidelines before sending it via the API. Below is a sample request object to help you structure your data properly.

For an asynchronous response approach, the synchronousResponse field must always be set to false. This allows you to continue engaging with your respondents without waiting for a response from ReDem.

Example request body
{
  "respondentId": "RESP497770", 
  "surveyName": "Global Vacation Insights 2024",
  "dataPoints": [ 
    {
      "qualityCheck": "OES",
      "dataPointId": "Q1",
      "question": "Where did you spend your last vacation?",
      "answer": "We were at Lake Garda in Italy",
      "keywords": ["Beach", "Mountains", "Lake", "Museums", "Europe", "Asia", "Destination"],
      "activateDuplicateDetection": true,
      "allowedLanguages": ["en"]
    },
    {
      "qualityCheck": "TS",
      "dataPointId": "durationQ1", 
      "duration": 42670
    },
    // ... other data points ...
  ],
  "activateCleaning": true,
  "cleaningSettings": {
    "redemScore": 60,
    "OES": {
      "score": 60,
      "minDataPoints":2,
      "categories": {
        "BAD_LANGUAGE": {"exclude": true, "minDataPoints":2},
        "NONSENSE": {"exclude": true, "minDataPoints":2},
        "WRONG_TOPIC": {"exclude": true, "minDataPoints":2},
        "WRONG_LANGUAGE": {"exclude": true, "minDataPoints":2},
        "AI_GENERATED_ANSWER": {"exclude": true, "minDataPoints":2},
        // ... other categories ...
      }
    },
    "CHS": {"score": 50},
    "GQS": {"score": 40, "minDataPoints":2},
    "TS": {"score": 20}
  },
  "synchronousResponse": false,
}
For a full example and detailed guidance on using this request object, visit the Add Respondent endpoint. It includes explanations of all fields and their usage.
3

Make an API request

At the end of the survey, just before the respondent reaches the ‘complete’ state, submit an API request to ReDem including the respondent’s information and your API key.

Example request (JavaScript)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"respondentId":"RESP497770","projectName":"Global Vacation Insights 2024","dataPoints":[{"qualityCheck":"OES","dataPointId":"Q1","question":"Where did you spend your last vacation?","answer":"We were at Lake Garda in Italy","keywords":["Beach","Mountains","Lake","Museums","Europe","Asia","Destination"],"activateDuplicateDetection":true,"allowedLanguages":["en","de","it"]},{"qualityCheck":"TS","dataPointId":"durationQ1","duration":42670},{"qualityCheck":"GQS","dataPointId":"Q2","gridAnswersPattern":[7,8,9,1,3,5,2,5,9,6]},{"qualityCheck":"OES","dataPointId":"Q3","question":"What was the most memorable part of your last vacation?","answer":"Italian cuisine, especially pizza and fine wine.","keywords":["Cuisine","Food","Art","Adventure","History","Landscape","Culture"],"activateDuplicateDetection":true,"allowedLanguages":["en","de","it"]},{"qualityCheck":"TS","dataPointId":"durationQ3","duration":69720},{"qualityCheck":"CHS","dataPointId":"CHS_Question","interviewData":[{"question":"What mode of transport did you use?","answer":"Car"},{"question":"How many days did you stay?","answer":5},{"question":"Did you travel with family?","answer":"yes"},{"question":"What was your approximate total budget for the trip (in EUR)?","answer":1500},{"question":"What type of accommodation did you stay in?","answer":"Hotel"}]},{"qualityCheck":"GQS","dataPointId":"Q4","gridAnswersPattern":[2,1,4,3,5,2,3,1,1,1]},{"qualityCheck":"TS","dataPointId":"totalDuration","duration":256843}],"cleaningSettings":{"standardSettings":false,"CustomSettings":{"redemScore":60,"OES":{"score":30,"minimumAnswers":2,"categories":{"genericAnswers":{"exclude":true,"minDataPoints":2},"noInformation":{"exclude":true,"minDataPoints":2},"badLanguage":{"exclude":true,"minDataPoints":2},"nonsense":{"exclude":true,"minDataPoints":1},"duplicateAnswer":{"exclude":true,"minDataPoints":1},"duplicateRespondent":{"exclude":true,"minDataPoints":1},"wrongTopic":{"exclude":true,"minDataPoints":1},"wrongLanguage":{"exclude":true,"minDataPoints":1},"copyPastAnswer":{"exclude":true,"minDataPoints":1},"fakeAnswer":{"exclude":true,"minDataPoints":1}}},"CHS":{"score":20},"GQS":{"score":10,"minimumItems":15},"TS":{"score":20}}},"synchronousResponse":false}'
};

fetch('https://api.redem.io/respondent/add', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
4

Use the ReDem API response to trigger your next step

Retrieve the response from ReDem to ensure your request was successfully submitted and is still in progress.

Example response (JavaScript)
  {
    "success": true,
    "message": "Respondent Queued for Evaluation",
    "results": {
      "status": "QUEUED"
    }
  }
For a full example and detailed guidance on using this response object, visit the Add Respondent endpoint. It includes explanations of all fields and their usage.
5

Synchronize respondent evaluations

Since an asynchronous response approach is recommended, you can synchronize respondent evaluations from ReDem at any time.

To streamline the process, you can set up an automated job that performs the synchronization on a regular basis, ensuring your data remains up-to-date without requiring manual intervention.

To do this, you can use the Get Respondent endpoint or the Get All Respondents endpoint.