In some cases, you may desire to set up a QBP survey as per UI.
This can be accomplished using the QBP API.
The QBP feature must be enabled from an operator to use this API |
POST $apihost/$basepath/buyers/v2/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)
{ "qbp" : { "enable": true, "quota_ids": [ "abc", // buyer_quota_id "xyz" ] "category": "Age" // optional in case of UI. } } |
{ "qbp" : { "enable": false } } |
POST $apihost/$basepath/buyers/v2/surveys |
{ "live_url": "http://b_emulator.purespectrum.net:3000/emulated_surveyss", "test_url": "http://b_emulator.purespectrum.net:3000/emulated_surveyss", "survey_title": "test api ", "survey_category_code": 231, "survey_localization": "en_US", "completes_required": 100, "expected_ir": 10, "expected_loi": 10, "offer_price": 10, "field_time": 99, "qbp": { "enable": true, "quota_ids": [ "M","F" ]}, "quotas": [ { "buyer_quota_id": "M", "required_count": 50, "criteria": [ { "qualification_code": 211, "condition_codes": [ "111" ] } ] }, { "buyer_quota_id": "F", "required_count": 50, "criteria": [ { "qualification_code": 211, "condition_codes": [ "112" ] } ] } ], "qualifications": [ { "condition_codes": [ "111", "112" ], "qualification_code": 211 }, { "range_sets": [ { "from": 18, "to": 99, "units": 311 } ], "qualification_code": 212 } ]} |
QBP can’t be enabled without quotas. |
{ "ps_api_response_code": 1007, "ps_api_response_message": "QBP can be enabled with quotas only." } |
QBP quotas can’t be enabled after getting the survey live, User can only change it in the draft survey. |
{ "ps_api_response_code": 1007, "api_response_message": "QBP changes are allowed in draft surveys only." } |