GET /Surveys/:Survey_id/PSIDRef
PureSpectrum offers its buyers the ability to recontact respondents using their persistent PureSpectrum Id (PSID). The same mechanism is also used by suppliers to understand which respondents to exclude due to deduplication.
Implementation
PSIDRef returns an array of PSID's, which are persistent respondent id's. You may use this list in conjunction with the value of `incl_excl` present in the GET /surveys & GET /surveys/:survey_id calls.
If the value of "incl_excl" is 1, then the survey is an "include" survey. The PSIDRef returns the list of respondents that are eligible to take the survey and is updated in real time.
If the value of "incl_excl" is 0, then PSIDRef will list the respondents which are no longer eligible to take the survey due to deduplication or other reasons. By default, surveys on PureSpectrum are "incl_excl":0.
API Response for GET /surveys/:survey_id/PSIDRef
Example 1 : The PSIDRef Response when the survey is an include survey.( The "incl_excl" parameter shows status 1) { "incl_excl": 1, "refresh":1510843032899, "PSIDRef": [ "bfdc8e99-yybb-xxee-aajj-1e6493b92f7b", "09a290ee-aajj-yybb-xxee-47e7d4c44db0", "f1d0adb1-aajj-xxee-yybb-d2a3513390f1", "2a6511cf-aajj-yybb-xxee-a322fac3de33", "dccc33db-aajj-xxee-yybb-8a5aa7449155" ] } Example 2 : The PSIDRef Response when the survey is an Exclude survey.( The "incl_excl" parameter shows status 0) { "incl_excl": 0, "refresh":1510843032899, "PSIDRef": [ "bfdc8e99-yybb-xxee-aajj-1e6493b92f7b", "09a290ee-aajj-yybb-xxee-47e7d4c44db0", "f1d0adb1-aajj-xxee-yybb-d2a3513390f1", "2a6511cf-aajj-yybb-xxee-a322fac3de33", "dccc33db-aajj-xxee-yybb-8a5aa7449155" ] }
Include
Include Survey's are sometimes referred to as recontact surveys. Effectively a buyer will define the list of respondents which they are attempting to reach. When a respondent that is on this list completes the survey, their id will automatically be removed from the PSIDRef list. As long as the PSID is present on the Ref list, the respondent may take the survey. PSID's are consistent across suppliers, so it is possible that the respondent may take a survey from one supplier, and be recontacted via a different supplier.
As a supplier, you should be storing the PSID of each respondent you send into PureSpectrum. We always append the PSID of the Respondent on redirect back to you.
PSID is loosely based on device id. While unlikely, it is possible that the PSID of a respondent may change. You should always overwrite the PSID of your respondents in case the PSID changes.
If you see that a survey has "incl_excl":1, your system should call the api endpoint GET /surveys/:survey_id/PSIDRef. If any of the PSID's match within your system, you may then target these respondents for this survey.
Exclude
If a survey is not defined as an include survey, the PSIDref list will always contain the EXCLUDE list. This is the default for surveys created on PureSpectrum. Leveraging the exclude list will allow you the ability to avoid termination due to deduplication. You may either call the survey's PSIDRef list, and store it, or you may use the optional query string parameter /PSIDref?PSID=%respondent'sPSID% . Documentation available here: GET PSIDEligible
Request Header Parameters
Parameter | Type | Required | Description |
---|---|---|---|
access-token | string | Yes | Token used to identify the authenticity of the user. |
Response Header Parameters
Parameter | Type | Description |
---|---|---|
timestamp | iso timestamp | Useful for specifying "fromDate" example: 2017-11-17T06:15:45.110Z |
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
fromDate | Iso Timestamp | No | This parameter may be used to only return psid's that were added since the specified timestamp, dramatically reducing the size of the payload. If the "refresh" parameter is newer than your last stored timestamp, it is recommended that you clear your psid list, and call this api without the fromDate parameter to get the most accurate list. Example: fromDate=2017-11-16T14:48:48.811Z Suggested Usage for Exclude:
|
Response Parameters
Parameter | Type | Description | Nullable |
---|---|---|---|
PSIDRef | array of strings | Contains a list of PSID's. These id's used in conjunction with value of "incl_excl" will give you instruction on which respondents are eligible to take this specific survey. | No |
incl_excl | integer | can be either a "0" or "1". "0" stands for exclusion and "1" stands for "inclusion". Its is always "0" by default unless specified otherwise. | No |
refresh | Iso Timestamp | Anytime a value is deleted from the PSIDref list, this value will be updated to the current UTC time, so that you know to clear your current list, and call this api again without the "fromDate" parameter | No |
HTTP Response Codes
Response | Status | Description |
---|---|---|
200 | OK | |
400 | Bad Request | See Error Messages |
401 | Unauthorized | Check Access Token |
404 | Not Found | Invalid Survey ID |
5xx | Internal Server Error | Please Report to support@purespectrum.com |
Error Messages
Response | Description |
---|---|
1001 | Invalid Survey ID |
1002 | Survey is closed |
1003 | Survey is not live (paused or draft) |
9999 | Unknown Error - Please Report to support@purespectrum.com |