Get Surveys - POST /attributes - http://api.spectrumsurveys.com/buyers/v1/attributes
...
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. |
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 | Nullable |
---|---|---|---|
text | string | The text of the question asked to the respondent | |
desc | string | A description of the question that is asked of the respondent | |
cat | string | Category name of the question that is asked of the respondent | |
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) | |
class | integer | 1 = Core profiling question 2 = Extended profiling question 3 = Custom profiling question | |
condition_codes | array | contains the condition codes and condition code texts | |
crtd_on | UTC Timestamp in milliseconds since Unix Epoch | Timestamp of when this attribute was created | |
mod_on | UTC Timestamp in milliseconds since Unix Epoch | Timestamp of when this attribute was modified. This may include a change in text, addition or modification of condition codes. In case the mod_on has changed since your last sync, delete the qualification in your system and recreate it to prevent inconsistencies. |
condition_codes Array
Parameter | Type | Description | Nullable |
---|---|---|---|
id | string | the condition code of the corresponding text. This will match the requisite condition codes in a survey's qualifications/quotas | |
text | string | The text of the answer presented to the respondent |
Sample API Request
Code Block |
---|
GET /suppliers/v2/attributes/1031?survey_localization=en_US Host: api.spectrumsurveys.com access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
...
Code Block |
---|
POST /buyers/v1/attributes/ { "Buyer_Attribute_ID" : "ABC123", "Desc" : "Pet Food Preferences", "Category" : "Pets", "Type":1, "localizations":[ : [ { "localization" : "en_us", "Q_text": "Do you purchase dry or wet Dog Food?" "answers":[ { "Buyer_Answer_ID" : "DEF456", "Answer_Text" : "Dry Food" }, { "Buyer_Answer_ID" : "DEF457", "Answer_Text" : "WetFood" }.... ] } } |
...
Code Block |
---|
GET /suppliersbuyers/v2v1/attributes/1034?survey_localization=en_US { "textQ_ID" :"The company I work for employs approximately %1034% people", 1110 "localizations":[ { "cat":"B2B",answers":[ { "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 } buyer_Answer_ID" : "DEF456", "PS_C_ID" : 111 }, { " buyer_Answer_ID" : "DEF456", " PS_C_ID" : 111 } ] } ] } |
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 | |
400 | Bad Request | See Error Messages |
404 | Not Found | Qualification code doesn't exist in database |
5xx | Internal Server Error | Please Report to support@purespectrum.com |
Error Messages
Response | Description |
---|---|
1001 | Missing localization parameter |
1002 | Qualification doesn't exist in localization code |
9999 | Unknown Error - Please Report to support@purespectrum.com |