Skip to main content

Overview

The PREDUPE API checks whether a respondent has already attempted surveys on a destination platform. You send the destination platform and the survey numbers to check, and the response reports, per survey, whether a duplicate was found. This guide shows how to send the request from the browser with POST, passing the parameters as a JSON body. Like the Activity API, PREDUPE is authorized with an authorization key that you send in the x-api-key header. It runs on search.resdefio.com.
Use POST from the browser. Browsers do not send a request body with GET.

Authentication

Send your authorization key in the x-api-key header of every request.
string
required
Your Research Defender authorization key.
Your authorization key is a secret. The sample on this page calls the API from the browser for demonstration, but anything in client-side code can be read. If you can, call the PREDUPE API from your server and keep the key there.

Endpoint

string
POST https://{environment}.search.resdefio.com/predupes
In the sample, set ENVIRONMENT to "prod" or "stage".

Request body

Send the parameters as a JSON object.
array
required
The destination platforms to check. Each entry has a Platform_Id and its Survey_Numbers.
string
required
The destination key for the client to check the traffic with. Find it with the DESTINATION_PLATFORM lookup.
array
required
One or more survey numbers on that platform. A request supports 30 survey numbers in total; beyond that, entries are processed randomly.
string
The respondent’s session ID. Optional.
string
The panel ID. Optional.
string
The respondent’s hashed email address. Optional.
string
The supplier ID, for reporting only. Optional.

Sending more parameters

The sample sends Destination and Session_Id. To send Panel_Id, Hashed_Email, or Supplier_Id, add them to the object in buildPayload(). A request body with every parameter looks like this:

Response

Each survey in Destination[].Surveys has a Flag (1 if a duplicate was found, 0 if not), Duplicate_Initial_UD, Survey_Number, Duplicate_Score (0 or 100), and Duplicate_Potential (low or high). The response also has a top-level Threat_Potential_Score. See PREDUPE for the field definitions.

Example

predupe-post.js
The JavaScript example builds the body with buildPayload(), which leaves out empty optional values. checkPredupes() sends the request with the Content-Type and x-api-key headers and shows the API’s message if the request fails.

Full HTML page

If you want a complete page you can open in a browser, use the sample below. Replace the placeholder values at the top of the script.
predupe-post-integration.html

Troubleshooting