Update survey campaign

Update Survey Campaign

Updates and/or copies a specified survey campaign or link. One or more fields may be changed in a single call.

Endpoint

POST v5/survey/{survey_id}/surveycampaign/{campaign_id}

Requires authentication

Path Parameters

Identifies the survey and campaign to update.

survey_id
string
required
The ID of the survey.
campaign_id
string
required
The ID of the campaign or link to update.

Query Parameters

All parameters are optional. Include only the fields you want to update.

name
string
The updated 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.
status
string
The campaign 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.
theme
integer
The ID of a saved theme from your Theme Library. 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.
contact_list
integer
Available for email type campaigns only. Pass a ContactList ID to add that list to the email campaign.
copy
boolean
When set to true, creates a copy of the campaign rather than updating the existing one.

Response

Returns the updated campaign object.

result_ok
boolean
Whether the request succeeded.
data
object
The updated campaign object. See List Survey Campaigns for the full list of response fields.

Examples

Request (cURL) — Update Status
curl -X POST "https://api.alchemer.com/v5/survey/123456/surveycampaign/300867?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET&status=closed"
Response
{
  "result_ok": true,
  "data": {
    "id": "300867",
    "invite_id": null,
    "type": "SurveyCampaign",
    "link_type": "link",
    "subtype": "standard",
    "status": "Closed",
    "name": "New Link",
    "uri": "www.alchemer.com/s3/1234567/6e8b6551c402",
    "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 15:43:30",
    "date_modified": "2017-10-02 18:39:13"
  }
}