Versions Compared

Key

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

You may use this endpoint to retrieve all surveys in your account.

Request

...

GET $apihost/$basepath/surveys

($apihost is the environment against which you are testing,  All Buy API calls will require access_token parameter in the header) 

...

This endpoint will return surveys that are live by default.  You may use the query string parameter "status" to retrieve surveys of a different status

Query String Parameters:

Response Parameter

Type

Description 

Example

status

integer - enum:

22: return live surveys (default)

11: return draft surveys

33: return paused surveys

44: return closed surveys

You may select the status to be returned by this API endpoint

status=22

fromDate

integer - format=YYYYMMDD

Returns only surveys created on or after the value in fromDate.  These dates are in Pacific Time.

fromDate=20190101

toDate

integer - format=YYYYMMDD

Returns only surveys created on or before the value in fromDate.  These dates are in Pacific Time.

toDate=20191231

targeting

integer - enum:

1: returns the normal survey response with qualification and quota arrays. (default)

0: suppresses the qualifications and quotas array to reduce response size

Using targeting=0 will suppress the response of the qualifications and quotas array

targeting=0

limit

integer - enum:

Returns only the number of surveys specified.

limit=20



Sample Request: 

Sample Request
Code Block
languagejs
titleSample Request
linenumberstrue
collapsetrue
GET api.spectrumsurveys.com/buyers/v2/surveys?status=11&fromDate=20190101&toDate=20190131&targeting=0


Response


...

Response Code

200

Response Body

[
Code Block
languagejs
linenumberstrue
collapsetrue
json
[
  {
    "click_balancing": 0,
    "estimated_clicks": 0,
    "ps_survey_status": 22,
    "offer_price": 0.5,
    "incl_excl": 0,
    "survey_title": "Test Survey 1",
    "live_url": "http://mysurvey.com/survey/1",
    "completes_required": 2,
    "field_time": 15,
    "billing_id": "1234",
    "buyer_message": "This is a test survey",
    "uniqueLinks": false,
    "survey_category_code": 231,
    "quotas": [],
    "qualifications": [],
    "expected_loi": 15,
    "expected_ir": 15,
    "ps_survey_id": 123456,
    "buyer_surveygroup_ref": null,
    "test_ps_survey_entry_link": "https://spectrumsurveys.com/#/start-survey?survey_id=123456supplier_id=0",
    "survey_localization": "en_US"
  },
  {
    "click_balancing": 0,
    "estimated_clicks": 0,
    "ps_survey_status": 22,
    "offer_price": 0.5,
    "incl_excl": 0,
    "survey_title": "Test Survey 2",
    "live_url": "http://mysurvey.com/survey/2",
    "completes_required": 2,
    "field_time": 15,
    "billing_id": "1234",
    "buyer_message": "This is a test survey",
    "uniqueLinks": false,
    "survey_category_code": 231,
    "quotas": [],
    "qualifications": [],
    "expected_loi": 15,
    "expected_ir": 15,
    "ps_survey_id": 123457,
    "buyer_surveygroup_ref": null,
    "test_ps_survey_entry_link": "https://spectrumsurveys.com/#/start-survey?survey_id=123457&supplier_id=0",
    "survey_localization": "en_US"
  }
]