Create Survey Campaign
Creates a new link or email campaign for the specified survey.
Endpoint
PUT
v5/survey/{survey_id}/surveycampaign
Requires authentication
Path Parameters
The survey in which to create the campaign.
survey_id
string
required
The ID of the survey.
Query Parameters
type
string
required
The campaign type. Accepted values:
link, email, html, js, blog, iframe, popup.name
string
required
The display name for the campaign.
language
string
The language for the campaign. Use
auto to detect the respondent's browser language, or a specific language name such as english. Defaults to auto.status
string
The initial status. Accepted values:
active, closed, deleted.secure
boolean
When
true, forces SSL on the campaign link.slug
string
A custom URL slug for the campaign link.
subtype
string
The link subtype. Accepted values:
standard, private, shortlink, subdomain.privatename
string
The private domain for the campaign, when
subtype=private. Example: surveys.abcco.com.subdomain
string
The subdomain for the campaign, when
subtype=subdomain. Example: mycompany.theme
integer
The ID of a saved theme from your Theme Library to apply to the campaign. To find a theme ID, go to Account > Libraries > Survey Themes and select the theme — the ID appears in the URL.
link_open_date
string
The date and time to open the campaign link, in
Y-m-d H:i:s format.link_close_date
string
The date and time to close the campaign link, in
Y-m-d H:i:s format.tokenvariables
string
URL-encoded token variables to attach to the campaign link. Example:
var%3Dvalue%26var2%3Dvalue.Response
Returns the newly created campaign object.
result_ok
boolean
Whether the request succeeded.
data
object
The newly created campaign object. See List Survey Campaigns for the full list of response fields.
Examples
Note SMS campaigns cannot be created via the API and must be created in the Alchemer Platform UI.
Note When creating an email campaign, a default invite message is created automatically. There is no need to create a message separately via the Email Message endpoint.
Request (cURL)
curl -X PUT "https://api.alchemer.com/v5/survey/123456/surveycampaign?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET&type=link&name=New+Link+Name"
Response
{
"result_ok": true,
"data": {
"id": "300902",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Active",
"name": "New Link Name",
"uri": "www.alchemer.com/s3/1234567/8d5a71c068a5",
"SSL": "True",
"primary_theme_options": null,
"primary_theme_content": null,
"token_variables": null,
"limit_responses": null,
"close_message": null,
"link_open_date": null,
"link_close_date": null,
"language": "Auto",
"date_created": "2017-10-02 18:35:45",
"date_modified": "2017-10-02 18:35:45"
}
}