Versions Compared

Key

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

...

The response object also has the ps_quota_id for each of the quota that was created. The buyer has the option of referring to quotas either through the ps_quota_id or their own buyer_quota_id. If a survey was created through the API, but the user added quotas through the UI, they buyer currently cannot assign a quota_id to the quota created via the UI. In that scenario, the buyer will have to use the ps_quota_id to access the quota created through the UI. 

(testcase id: bapit-2)

Request

...

POST $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) 

...

Body: 

Code Block
languagejs
linenumberstrue
  {
  "survey_title": "Sample Survey for Age Income Gender bapit-2",
  "survey_category_code": 231,
  "survey_localization": "en_US",
  "completes_required": 1000,
  "expected_ir": 60,
  "expected_loi": 60,
  "offer_price": 4.5,
  "live_url": "https://my.survey.com?survey_id=1234",
  "test_url": "https://my.survey.com?survey_id=1234&test=1",
  "field_time": 10,
  "billing_id": "PS_123456",
  "qualifications": [
    {
      "qualification_code": 211,
      "condition_codes": [
        "111", "112"
      ]
    },
    {
      "qualification_code": 212,
      "range_sets": [
        {
          "from": 21,
          "to": 59,
          "units": 311
        }
      ]
    },
    {
      "qualification_code": 213,
      "range_sets": [
        {
          "from": 50000,
          "to": 100000,
          "units": 321
        }
      ]
    }
  ],
  "quotas": [
    {
      "buyer_quota_id": "qb12",
      "required_count": 400,
      "criteria": [{"qualification_code": 211,"condition_codes": ["111"]}]
    },
    {
      "buyer_quota_id": "qb13",
      "required_count": 600,
      "criteria": [{"qualification_code": 211,"condition_codes": ["112"]}]
    },
    {
      "buyer_quota_id": "qb14",
      "required_count": 200,
      "criteria": [{"qualification_code": 212,"range_sets": [{"from": 21,"to": 25,"units": 311}]}]
    },
    {
      "buyer_quota_id": "qb15",
      "required_count": 300,
      "criteria": [{"qualification_code": 212,"range_sets": [{"from": 26,"to": 29,"units": 311}]}]
    },
    {
      "buyer_quota_id": "qb16",
      "required_count": 500,
      "criteria": [{"qualification_code": 212,"range_sets": [{"from": 30,"to": 59,"units": 311}]}]
    }
  ]
}

Result Result 

Response Code

201

Response Body

Code Block
languagejslinenumberstrue
{
  "survey_title": "Sample Survey for Age Income Gender bapit-2",
  "survey_category_code": 231,
  "completes_required": 1000,
  "live_url": "https://my.survey.com?survey_id=1234",
  "test_url": "https://my.survey.com?survey_id=1234&test=1",
  "field_time": 10,
  "offer_price": 4.5,
  "ps_survey_status": 11,
  "expected_loi": 60,
  "expected_ir": 60,
  "ps_survey_id": 3429,
  "mod_on": 1490012784439,
  "crtd_on": 1490011568138,
  "test_ps_survey_entry_link": "http://dev.spectrumsurveys.com:3500/startsurvey?survey_id=3429&ps_redirect_test=1&bsec=a70mx8&supplier_id=23",
  "survey_localization": "en_US",
  "billing_id": "PS_123456",
  "qualifications": [
    {
      "condition_codes": [
        "111",
        "112"
      ],
      "qualification_code": 211
    },
    {
      "qualification_code": 212,
      "range_sets": [
        {
          "from": 21,
          "to": 29,
          "units": 311
        },
        {
          "from": 40,
          "to": 59,
          "units": 311
        }
      ]
    },
    {
      "qualification_code": 213,
      "range_sets": [
        {
          "from": 50000,
          "to": 100000,
          "units": 321
        }
      ]
    }
  ],
  "quotas": [
    {
      "buyer_quota_id": "qb12",
      "ps_quota_id": "ac03018d-0df5-4bed-bf7f-857446ae2f74",
      "required_count": 400,
      "criteria": [
        {
          "qualification_code": 211,
          "condition_codes": [
            "111"
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "qb13",
      "ps_quota_id": "e28bb72b-f4db-4f2c-9395-e2e1c9ea5fe9",
      "required_count": 600,
      "criteria": [
        {
          "qualification_code": 211,
          "condition_codes": [
            "112"
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "qb14",
      "ps_quota_id": "3db1e7a2-f09d-43c5-98ef-fd4d1d4d1538",
      "required_count": 200,
      "criteria": [
        {
          "qualification_code": 212,
          "range_sets": [
            {
              "from": "21",
              "to": "25",
              "units": 311
            }
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "qb15",
      "ps_quota_id": "09ac6704-af70-4cf6-b8ca-639061cca0b7",
      "required_count": 300,
      "criteria": [
        {
          "qualification_code": 212,
          "range_sets": [
            {
              "from": "26",
              "to": "29",
              "units": 311
            }
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "qb16",
      "ps_quota_id": "afd60549-4333-4136-ac27-b0da95f2f84e",
      "required_count": 500,
      "criteria": [
        {
          "qualification_code": 212,
          "range_sets": [
            {
              "from": "40",
              "to": "59",
              "units": 311
            }
          ]
        }
      ]
    }
  ]
}

...