Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

GET /attributes - http://api.spectrumsurveys.com/suppliers/v2/attributes/:qualification_code?localization=:localization

Call this API to view the respondent's question text, condition codes, and condition code texts for unfamiliar qualification codes/condition codes.  Survey_localization is a required Query String parameter.

Warning

Now available on Production - known issues: mod_on & crtd_on return `null`

Implementation

As the PureSpectrum platform continues to expand its Respondent targeting library, it is important that you are able to import foreign targeting attributes & profile your respondents before sending them into a survey.  Your ability to do so will greatly improve conversion, reduce time to termination, and provide you with better population data about your supply.

If your system supports the ability to route or screen respondents on the fly on qualifications for which you are missing for this respondent, this API endpoint is for you.  The goal of this endpoint is not for mapping, but rather for direct creation of question/answers within your profiling mechanism.

When importing a new survey, qualification, or quota into your survey inventory via API - take into consideration if any of the qualifications or the qualification's condition codes are unknown within your system.  If so, fail the survey import and call the GET /attributes endpoint with the qualification and survey localization.  Parse the response and create this new qualification within your system.

Considerations

  • Qualifications are shared across surveyLocalizations on PureSpectrum.  For example, we use the same code for b2b employment in the US/English, that we use in Japanese Japan.
  • Condition codes when appropriate are also shared across localizations
  • Even though the codes may be the same, we represent these questions/answers using the appropriate language/localization
  • We only currently support 3 question types in this api call: Singlepunch, Singlepunch-alt, & Multipunch
    • singlepunch is presented as a dropdown.  Singlepunch-alt and Multipunch are shown in push-button form

HEADER Parameters

...

Parameter

...

Type

...

Required

...

Description

...

access-token

...

string

...

Yes

...

Token used to identify the authenticity of the user.

Query String Parameters

...

Parameter

...

Type

...

Required

...

Description

...

localization

...

string

...

Yes

...

Define the Country & Language combination for which you need the attribute's question/answer text returned

Response Parameters    

...

Parameter

...

Type

...

Description

...

text

...

string

...

The text of the question asked to the respondent

...

type

...

1=singlepunch (only one selection is allowed, presented in dropdown form)

2=singlepunch-alt (only one selection is allowed - presented in push button form)

3=multipunch (multiple selections are allowed, presented in push button form)

4=range (not currently supported)

...

1 = Core profiling question

2 = Extended profiling question

3 = Custom profiling question

...

contains the condition codes and condition code texts

...

condition_codes Array

...

the condition code of the corresponding text. This will match the requisite condition codes in a survey's qualifications/quotas

...

Sample API Request

Code Block
GET /suppliers/v2/attributes/1031?survey_localization=en_US
Host: api.spectrumsurveys.com
access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sample API Response

Example 1: Simple MultiPunch

Code Block
GET /suppliers/v2/attributes/1031?survey_localization=en_US
{
  "text":"Which of the following pets do you own?",
  "cat":"Pets",
  "desc":"Pet Ownership",
  "type":3,
  "class":2,
  "condition_codes":[
	{"id":"111","text":"Dog"},
	{"id":"112","text":"Cat"},
	{"id":"113","text":"Rabbit"},
	{"id":"114","text":"Snake/Lizard"},
	{"id":"115","text":"Fish"},
	{"id":"116","text":"Small Birds"},
	{"id":"117","text":"Large Birds"},
	{"id":"118","text":"Horse/Equine"},
	{"id":"119","text":"Ferrets"},
	{"id":"120","text":"Hamster or other Rodent"},
	{"id":"121","text":"Turtle"},
	{"id":"122","text":"Exotic Pets"},
	{"id":"999","text":"None of the Above"}
  ],
  "crtd_on": 1487871678958,
  "mod_on": 1487871678958
}

Example 2: Singlepunch - in context dropdown.  This will render as The company I work for employs approximately (dropdown) people

Code Block
GET /suppliers/v2/attributes/1034?survey_localization=en_US
{
  "text":"The company I work for employs approximately %1034% people",
  "cat":"B2B",
  "desc":"Company Size (Employees)",
  "type":1,
  "class":2,
  "condition_codes":[
	{"id":"111","text":"1 to 5"},
	{"id":"112","text":"6 to 9"},
	{"id":"113","text":"10 to 19"},
	{"id":"114","text":"20 to 24"},
	...
	{"id":"125","text":"50,000+"},
	{"id":"999","text":"Don't know"}
  ],
  "crtd_on": 1487871678958,
  "mod_on": 1487871678958
}

Example 3: Singlepunch - alt

Code Block
GET /suppliers/v2/attributes/1040?survey_localization=en_US
{
  "text":"Are you registered in any of the following US political parties?",
  "cat":"Politics",
  "desc":"Political Party Affiliation",
  "type":1,
  "class":2,
  "condition_codes":[
	{"id":"111","text":"Democratic Party"},
	{"id":"112","text":"Republican Party"},
	{"id":"113","text":"Independent"},
	{"id":"114","text":"Constitution Party"},
	...
	{"id":"117","text":"Other"},
	{"id":"118","text":"I am not registered with a political party"}
  ],
  "crtd_on": 1487871678958,
  "mod_on": 1487871678958
}

HTTP Response Codes

...

Response

...

Status

...

Description

...

200

...

OK

...

5xx

...

Please Report to support@purespectrum.com

Error Messages

...

Response

...

Description

...

1001

...

Missing localization parameter

...

9999

...

Code Block
GET /Surveys/:Survey_id/PSIDRef

GET /Surveys/:Survey_id/PSIDEligible

...

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. 

Implementation

Every survey on PureSpectrum has a "PSIDRef" List. Whether this list is used for Include or Exclude is determined by the response parameter incl_excl present in the `GET /Surveys` and `GET /Surveys/:Survey_id` call. The value of Include Exclude will not change for a survey which has been already set live. 

Info

"incl_excl": 0 indicates PSIDRef is an exclude list (default)

"incl_excl": 1 indicates PSIDRef is an include list

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.

API Response for GET /surveys/:survey_id/PSIDref

Code Block
Example 1 : The PSIDRef Response when the survey is an include survey.( The "incl_excl" parameter shows status 1)

{
    "incl_excl": 1,
    "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"
    ]
}

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.  

Warning

PSID is based on device id and member 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.

Info

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%, which will return back a response of 

API Response for

Code Block
GET /surveys/:survey_id/PSIDEligible?PSID=75xxee23-370b-a8ye-e601-e1fzz59284c8
Code Block
Example 1 : If the PSIDRef is eligible
{
    "eligible": 1
}

Example 2 : If the PSIDRef is NOT eligible
{
    "eligible": 0
}

API Response for

Code Block
GET /surveys/:survey_id/PSIDRef
Code Block
The PSIDRef Response when the survey is an Exclude survey.( The "incl_excl" parameter shows status 0)

{
    "incl_excl": 0,
    "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"
    ]
}