The following API calls are currently available for the SurveyCampaign object:
GET LIST - Get a list of all of links and campaigns for the specified survey.
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign
| Parameters | Example | Required |
|---|---|---|
| Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
| page | page=3 | False |
| resultsperpage | resultsperpage=100 | False |
Response Example (.json format):
{
"result_ok": true,
"total_count": "9",
"page": 1,
"total_pages": 1,
"results_per_page": 50,
"data": [
{
"id": "300865",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Active",
"name": "Default Link",
"uri": "www.surveygizmo.com/s3/1234567/survey",
"SSL": "False",
"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:41:41",
"date_modified": "2017-10-02 15:41:41"
},
{
"id": "300866",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "hiddenlink",
"status": "Active",
"name": "Hidden Link",
"uri": "www.surveygizmo.com/s3/1234567/survey",
"SSL": "False",
"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:41:49",
"date_modified": "2017-10-02 15:41:49"
},
{
"id": "300867",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Active",
"name": "New Link",
"uri": "www.surveygizmo.com/s3/1234568/survey",
"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 15:43:30"
}
]
}GET CAMPAIGN - Get information about a specific link or campaign.
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=GET
| Parameters | Example | Required |
|---|---|---|
| Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
Response Example (.json format):
{
"result_ok": true,
"data": {
"id": "300865",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Active",
"name": "Default Link",
"uri": "www.surveygizmo.com/s3/1234567/survey",
"SSL": "False",
"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:41:41",
"date_modified": "2017-10-02 15:41:41"
}
}CREATE CAMPAIGN - Create a new link or campaign.
When creating email campaigns campaigns via either the API or the UI, a default message is created. So, while you might think your next step is to use the EmailMessage object to create a message, you don't need to!
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign?_method=PUT&type=link&name=New Link Name
| Parameters | Example | Required |
|---|---|---|
| Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
| type | link, email, html, js, blog, iframe, popup | True |
| name | New Link Name | True |
| language | auto, english, etc. | False |
| status | active, closed, deleted | False |
| secure | true, false | False |
| slug | newlinkslug | False |
| subtype | standard, private, shortlink, subdomain | False |
| privatename | surveys.abcco.com | False |
| subdomain | mycompany | False |
| theme* | 12345 | False |
| linkdates[open] | Y-m-d H:i:s | False |
| linkdates[close] | Y-m-d H:i:s | False |
| tokenvariables | var%3Dvalue%26var2%3D=value | False |
*The theme parameter only supports saved themes in your Theme Library. To obtain the ID, go to Account > Libraries > Survey Themes and select the theme you wish to use. The ID will display in the URL.
Response Example (.json format):
{
"result_ok": true,
"data": {
"id": "300902",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Active",
"name": "New Link",
"uri": "www.surveygizmo.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"
}
}UPDATE/COPY CAMPAIGN - Update and/or copy a specified link or campaign.
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=POST
| Parameters | Example | Required |
|---|---|---|
| Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
| name | UpdatedLinkName | False |
| language | auto, english, etc. | False |
| status | active, closed, deleted | False |
| secure | true, false | False |
| slug | newlinkslug | False |
| subtype | standard, private, shortlink, subdomain | False |
| privatename | surveys.abcco.com | False |
| subdomain | mycompany | False |
| theme* | 12345 | False |
| linkdates[open] | Y-m-d H:i:s | False |
| linkdates[close] | Y-m-d H:i:s | False |
| tokenvariables | var%3Dvalue%26var2%3D=value | False |
| contact_list** | Contact List ID | False |
| copy | true | False |
*The theme parameter only supports saved themes in your Theme Library. To obtain the ID, go to Account > Libraries > Survey Themes and select the theme you wish to use. The ID will display in the URL.
**Available for the campaign type of 'email', the contact_list parameter allows you to add a ContactList to your Email Campaign. Use the following format:
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=POST&contact_list=1
Response Example (.json format):
{
"result_ok": true,
"data": {
"id": "300867",
"invite_id": null,
"type": "SurveyCampaign",
"link_type": "link",
"subtype": "standard",
"status": "Closed",
"name": "New Link",
"uri": "www.surveygizmo.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"
}
}DELETE CAMPAIGN - Delete a specific link or campaign from a survey.
https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=DELETE
| Parameters | Example | Required |
|---|---|---|
| Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
Response Example (.json format):
{
"result_ok": true
}