Adding Subscriber Emails to a Survey Created via API
Overview
PureSpectrum surveys send notifications to email subscribers for important events. You may subscribe an email address to these events either through the UI on the Final Details page, or in the API using the "subscriber_emails":Â []
field.
Â
Use
Adding Subscriber Emails Via API
To add subscriber emails via Buy API, you must pass in the following request body parameters in either the POST /surveys
or PUT /surveys/:surveyId
endpoints:
"subscriber_emails":Â ["researcher@youremail.com","support@youremail.com"]
Emails must be passed in as strings, and must use valid email format.
Important Considerations
The subscription list is a property of the survey. Updating the list in one survey will not update subscriber lists in other surveys.
If you need help with Subscriber Lists, 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,
"subscriber_emails":Â ["researcher@youremail.com","support@youremail.com"],
"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":Â ["researcher@youremail.com","support@youremail.com"],
"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 is sent with improper email addresses, the API will respond with HTTP status 400, and error code.