Versions Compared

Key

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

POST /attributes - http://api.spectrumsurveys.com/buyers/v1/attributes

GET /attributes - http://api.spectrumsurveys.com/buyers/v1/attributes/:buyer_attribute_id

...

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.

...

Code Block
{
   "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"
             }
        ]
   }

  ]
}


Example 2 : The attribute API GET Request/Response

Code Block
GET /buyers/v1/attributes/ABC123
Host: api.spectrumsurveys.com
access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

{
   "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"
             }
        ]
   }
  ]
}


Info

In the GET /attributes/:buyer_attribute_id - You may append the query string parameter: survey_localization=[%%survey_localization%%] in order to limit the result of the GET request to your desired localization


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 Invalid 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

...