Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

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.

Not yet available, api specs subject to change

Implementation


For trusted enterprise buyers that choose to integrate into the PureSpectrum Buy API - we offer the ability to create custom targeting attributes, based on your targeting library.  Before creating survey, qualification, or quota that will require custom targeting, your integration should call this API to create a new qualification within the PureSpectrum library.  We will return a qualification id that corresponds to your new attribute, as well as condition id's that correspond to you answer id's.  Once you map these values internally, you may then create a survey with these new targets!

Some suppliers are able to dynamically consume, store, and screen respondents using a supply API endpoint.  Creating good targeting questions will increase conversion & the overall respondent experience.

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
  • A condition code may have different text across different 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

Nullable

text

string

The text of the question asked to the respondent


descstringA description of the question that is asked of the respondent
catstringCategory 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)


localizationsenum

Contains the question text and their respective answer text and ID's


localizationstringLists the type of language code the answer needs to be in
respIDstringThis needs to be included in the text and acts as a container for answers block
answersarrayIts acts a container for range of "buyer_answer_id's" and corresponding "answer_text's"
buyer_answer_idstringIt is the "answer_id" to the question raised by buyer
answer_teststringIt is the "answer_text" to the question raised by buyer
condition_codesarray

Contains the condition codes and condition code texts


condition_codes Array

ParameterTypeDescriptionNullable
idstring

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


textstringThe text of the answer presented to the respondent

Sample API Request

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


Sample API Response


Example 1: The attribute API POST request

POST /buyers/v1/attributes/
{
   "buyer_attribute_id":"ABC123",
   "desc":"Pet Food Preferences",
   "category":"Pets",
   "type":1,  //singlepunch
   "localizations":[
   {
       "localization" : "en_US",
       "text": "Do you purchase dry or wet Dog Food?%%respID%%"
       "answers":[
             {
                "buyer_answer_id" : "DEF456-1",
                "text" : "Dry Food"
             },
             {
                 "buyer_answer_id" : "DEF456-2",
                 "text" : "Wet Food"
             },
			 {
                 "buyer_answer_id" : "DEF456-99",
                 "text" : "Not Sure/Doesn't Apply"
             }
        ]
   },
   {
       "localization" : "en_CA",
       "text": "Do you purchase dry or wet Dog Food?%%respID%%"
       "answers":[
             {
                "buyer_answer_id" : "DEF456-1",
                "text" : "Dry Food"
             },
             {
                 "buyer_answer_id" : "DEF456-2",
                 "text" : "Wet Food"
             },
			 {
                 "buyer_answer_id" : "DEF456-99",
                 "text" : "Not Sure/Doesn't Apply"
             }
        ]
   }
}

Example 2 : The attribute API Response

GET /buyers/v1/attributes/
{
   "ps_qualification_code" : 1110
   "buyer_attribute_id" : "ABC123",
   "desc" : "Pet Food Preferences",
   "Category" : "Pets",
   "type":1,
   "localizations":[
   {
       "localization" : "en_US",
       "text": "Do you purchase dry or wet Dog Food?%%respID%%"
       "answers":[
             {
                "buyer_answer_id" : "DEF456-1",
				"ps_cond_code":"111"
                "text" : "Dry Food"
             },
             {
                 "buyer_answer_id" : "DEF456-2",
                 "ps_cond_code":"112"
                 "text" : "Wet Food"
             },
			 {
                 "buyer_answer_id" : "DEF456-99",
                 "ps_cond_code":"113"
                 "text" : "Not Sure/Doesn't Apply"
             }
        ]
   },
   {
       "localization" : "en_CA",
       "text": "Do you purchase dry or wet Dog Food?%%respID%%"
       "answers":[
             {
                "buyer_answer_id" : "DEF456-1",
                "ps_cond_code":"111"
                "text" : "Dry Food"
             },
             {
                 "buyer_answer_id" : "DEF456-2",
                 "ps_cond_code":"112"
                 "text" : "Wet Food"
             },
			 {
                 "buyer_answer_id" : "DEF456-99",
                 "ps_cond_code":"113"
                 "text" : "Not Sure/Doesn't Apply"
             }
        ]
   }

  ]
}


HTTP Response Codes


Response

Status

Description

200

OK


400Bad RequestSee Error Messages
404Not FoundQualification code doesn't exist in database

5xx

Internal Server Error

Please Report to support@purespectrum.com

Error Messages


Response

Description

1001Missing localization parameter.
1002Resp_ID is missing in the Question text.
1003Category is Invalid. Please check the documentation.
1004Type can only take values of 1, 2 or 3.
1005Survey Localization is Invalid.
1006Buyer attribute ID is already used. Please use a new one. Use PUT to edit the attributes.
1007Invalid Survey Localization code.
1008Invalid JSON. Please check your request format.

9999

Unknown Error - Please Report to support@purespectrum.com

  • No labels