Overview
Use
Important Considerations
I
If you need help with QLC codes, please contact PureSpectrum support at support@purespectrum.com
Request
POST (or PUT) $apihost/$basepath/surveys
($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header)
Parameters:
Body:
{ "live_url": "https://yoursurvey.com/survey123", "test_url": "https://yoursurvey.com/survey123/test=1", "survey_title": "Test Survey", "survey_category_code": 231, "survey_localization": "en_US", "completes_required": 3, "expected_ir": 10, "expected_loi": 10, "offer_price": 10, "field_time": 99, "qualifications": [ { "qualification_code": 211, "condition_codes": [ "111", "112" ] } ], "quotas": [ { "buyer_quota_id": "1", "required_count": 3, "criteria": [ { "qualification_code": 211, "condition_codes": [ "111" ] } ] }, { "buyer_quota_id": "2", "required_count": 3, "criteria": [ { "qualification_code": 211, "condition_codes": [ "112" ] } ] } ], "qlc": { "enable": true, "multiple_quotas": { "enable": true } } } |
Result
Response Code
201 if POST, 200 if PUT
Response Body
{ "click_balancing": 0, "estimated_clicks": 0, "ps_survey_status": 11, "offer_price": 10, "incl_excl": 0, "live_url": "https://yoursurvey.com/survey123", "test_url": "https://yoursurvey.com/survey123/test=1", "survey_title": "Test Survey", "survey_category_code": 231, "completes_required": 3, "field_time": 99, "billing_id": null, "buyer_message": null, "expected_loi": 10, "expected_ir": 10, "ps_survey_id": 68463, "buyer_surveygroup_ref": null, "subscriber_emails": [], "qlc": { "enable": true, "multiple_quotas": { "enable": true, "count_by_quota": false, "compensate_by_quota": false } }, "quota_throttling": false, "test_ps_survey_entry_link": "https://staging.spectrumsurveys.com/startsurvey?survey_id=68463&ps_redirect_test=1&bsec=a70mx8&supplier_id=23", "survey_localization": "en_US", "uniqueLinks": false, "qualifications": [ { "condition_codes": [ "111", "112" ], "qualification_code": 211 } ], "quotas": [ { "buyer_quota_id": "1", "ps_quota_id": "ba58ca72-5b4f-45d1-8bc1-6cf0e481a36b", "required_count": 3, "criteria": [ { "qualification_code": 211, "condition_codes": [ "111" ] } ] }, { "buyer_quota_id": "2", "ps_quota_id": "f34610da-da3c-426c-9929-bc8e287f659f", "required_count": 3, "criteria": [ { "qualification_code": 211, "condition_codes": [ "112" ] } ] } ] } |
Error Handling
In the event a request enables QLC, but there are no quotas, the API will respond with HTTP status 400, and error code:
{ "ps_api_response_code": 1014, "ps_api_response_message": "QLC can only be turned on if there are quotas. Please set QLC to false, or add quotas in order to launch this survey." }