Duplicate Check API

This API is used to determine if a respondent is likely to be rejected from a survey because of our deduplication criteria.

Command

"livealert/duplicateCheck/1"

Recommended Frequency

Make this API call the moment before you display the survey to the user.



Inputs

The following values are expected in the JSON body:

Name Type Required Description
command String

Must be "livealert/duplicateCheck/1"

rfg_id String

The identifier of the project.

fingerprint String

The code to compute the fingerprint is available at https://hosting.researchforgood.com/js/df-fp.js
The fingerprint is computed using the following JavaScript:

function processDataForceFingerprint(fingerprint) {
        console.log("Please implement me!, fingerprint = " + fingerprint);
    }
    getDataForceFingerprint(processDataForceFingerprint);

If you are not able to generate the fingerprint, you can send fingerprint:0. In such cases, the rid value becomes mandatory. We will use the fingerprint value we have stored in our system for that respondent in order to determine if the respondent is likely to be ruled out because of deduplication. If the respondent has not started a session with us yet, then we will only consider the IP value. Please note that this is not the preferred option: if you are able to run javascript and generate a fingerprint, you should send the fingerprint value to us. Only use this workaround if you cannot run javascript on your site / app.

ip String

IP of the respondent.

rid String

Unique identifier for the respondent.

This value is mandatory when you send fingerprint:0. Please refer to the fingeprint description for more detail.


Outputs

Name Type Description
rfg_id String

The identifier of the project

fingerprint String

Fingerprint of the respondent.

ip String

IP of the respondent

isDuplicate Long

true if the panelist will be rejected because of deduplication, false if it is not likely that the panelist will be rejected because of deduplication.


Example Command

Command with all parameters:

{
  "command": "livealert/duplicateCheck/1",
  "ip": "187.143.120.25",
  "rid": "rfgTester",
  "rfg_id": "RFG605150-001",
  "fingerprint": "c042ac342900efdfceee4a2edb549f5c"}

Command when no fingerprint is available:

{
  "command": "livealert/duplicateCheck/1",
  "ip": "187.143.120.25",
  "rid": "rfgTester",
  "rfg_id": "RFG605150-001",
  "fingerprint": 0
}

This command would produce an error because there is no fingerprint and no rid:

  "command": "livealert/duplicateCheck/1",
  "ip": "187.143.120.25",
  "rfg_id": "RFG605150-001",
  "fingerprint": 0
}

Example Response

"response" : { 
    "rfg_id" : "RFG10016-005", 
    "fingerprint" : "c042ac342900efdfceee4a2edb549f5c", 
    "ip" : "166.78.136.138" , 
    "isDuplicate" : false
}