Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Get Surveys - 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.

...

  • 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.

...

Response Parameters    



Parameter

Type

Description

q_text

string

The text of the question asked to the respondent

q_descstringA description of the question that is asked of the respondent
q_catstringCategory name of the question that is asked of the respondent

q_type

integer

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)


q_classinteger

1 = Core profiling question

2 = Extended profiling question

3 = Custom profiling question

conditionscondition_codesarray of objects

contains the condition codes and condition code texts

c_idstring

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

c_textstringThe text of the answer presented to the respondent

...

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


Example 2: Singlepunch - in context dropdown

Code Block
GET /suppliers/v2/attributes/1034?survey_localization=en_US
{
  "q_text":"The company I work for employs approximately %1034% people",
  "q_cat":"B2B",
  "q_desc":"Company Size (Employees)",
  "q_type":1,
  "q_class":2,
  "conditionscondition_codes":[
	{"c_id":"111","c_text":"1 to 5"},
	{"c_id":"112","c_text":"6 to 9"},
	{"c_id":"113","c_text":"10 to 19"},
	{"c_id":"114","c_text":"20 to 24"},
	...
	{"c_id":"125","c_text":"50,000+"},
	{"c_id":"999","c_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
{
  "q_text":"Are you registered in any of the following US political parties?",
  "q_cat":"Politics",
  "q_desc":"Political Party Affiliation",
  "q_type":1,
  "q_class":2,
  "conditionscondition_codes":[
	{"c_id":"111","c_text":"Democratic Party"},
	{"c_id":"112","c_text":"Republican Party"},
	{"c_id":"113","c_text":"Independent"},
	{"c_id":"114","c_text":"Constitution Party"},
	...
	{"c_id":"117","c_text":"Other"},
	{"c_id":"118","c_text":"I am not registered with a political party"}
  ],
  "crtd_on": 1487871678958,
  "mod_on": 1487871678958
}


HTTP Response Codes


Response

Status

Description

200

OK


400Bad Request
You may be missing the survey_localization code
See Error Messages
404Not FoundQualification code doesn't exist in database

5xx

Internal Server Error

Please Report to support@purespectrum.com

Error Messages


Response

Description

1001

Missing localization parameter

1002Invalid date parameter
1003Qualification doesn't exist in localization code

9999

Unknown Error - Please Report to support@purespectrun support@purespectrum.com