SurveyCampaign Sub-Object v5

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

Note: Get requests will cache for 60 seconds. If you make repeated API get requests that are identical, the return will be cached and will thus return identical results.
ParametersExampleRequired
Authentication Credentialsapi_token=5D685159B6964FB69B044D3E7D2676D1True
pagepage=3False
resultsperpageresultsperpage=100False

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [total_count] => 8
 [page] => 1
 [total_pages] => 1
 [results_per_page] => 50
 [data] => Array
 (
 [0] => Array
 (
 [id] => 100000
 [invite_id] =>
 [type] => SurveyCampaign
 [link_type] => link
 [subtype] => standard
 [status] => Active
 [name] => Default Link
 [url] => app.sgizmo.com/s3/123456/TEST
 [SSL] => False
 [token_variables] =>
 [limit_responses] =>
 [close_message] => 
 [language] => Auto
 [date_created] => 2012-04-30 13:22:35
 [date_modified] => 2012-04-30 13:22:35
 )

 [1] => Array
 (
 [id] => 100001
 [invite_id] => 12345
 [type] => SurveyCampaign
 [link_type] => email
 [subtype] => standard
 [status] => Active
 [name] => My New Email Campaign
 [url] => s-lececb.sgizmo.com/s3/
 [SSL] => False
 [token_variables] => 
 [limit_responses] =>
 [close_message] => 
 [language] => Auto
 [date_created] => 2012-04-30 13:22:35
 [date_modified] => 2012-04-30 13:22:35
 )

GET CAMPAIGN - Get information about a specific link or campaign.

https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=GET

Note: Get requests will cache for 60 seconds. If you make repeated API get requests that are identical, the return will be cached and will thus return identical results.
ParametersExampleRequired
Authentication Credentialsapi_token=5D685159B6964FB69B044D3E7D2676D1True

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [data] => Array
 (
 [id] => 140308
 [invite_id] => 94135
 [type] => SurveyCampaign
 [link_type] => email
 [subtype] => 
 [status] => Active
 [name] => My New Email Campaign
 [uri] => s-67d398-i.sgizmo.com/s3/
 [SSL] => False
 [token_variables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => Auto
 [date_created] => 2014-07-29 11:25:52
 [date_modified] => 2016-05-24 14:52:54
 )

)

CREATE CAMPAIGN - Create a new link or campaign.

When creating 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

ParametersExampleRequired
Authentication Credentialsapi_token=5D685159B6964FB69B044D3E7D2676D1True
typelink, email, html, js, blog, iframe, popupTrue
nameNew Link NameTrue
languageauto, english, etc.False
statusactive, closed, deletedFalse
slug (link only)newlinkslugFalse
subtype (link only)standard, private, shortlinkFalse
linkdates[open]Y-m-d H:i:sFalse
linkdates[close]Y-m-d H:i:sFalse
tokenvariablesvar%3Dvalue%26var2%3D=valueFalse

Protocol is not an available parameter, however, if you use the Force HTTPS linkssetting under Account > Account Settings, all links created via the API will be set to the secure protocol.

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [data] => Array
 (
 [id] => 12345
 [invite_id] => 12345
 [type] => SurveyCampaign
 [link_type] => link
 [subtype] => standard
 [status] => Active
 [name] => New Link
 [uri] => app.sgizmo.com/s3/1035186/b0fb3ea1a88d
 [SSL] => False
 [token_variables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => Auto
 [date_created] => 2014-07-29 11:25:52
 [date_modified] => 2016-05-24 14:52:54
 )

)

UPDATE/COPY CAMPAIGN - Update and/or copy a specified link or campaign.

https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=POST

ParametersExampleRequired
Authentication Credentialsapi_token=5D685159B6964FB69B044D3E7D2676D1True
nameUpdatedLinkNameFalse
languageauto, english, etc.False
statusactive, closed, deletedFalse
slug (link only)updatedlinkslugFalse
subtype (link only)standard, private, shortlinkFalse
privatename (link only)*awesomesurveys.comFalse
linkdates[open]Y-m-d H:i:sFalse
linkdates[close]Y-m-d H:i:sFalse
tokenvariablesvar%3Dvalue%26var2%3D=valueFalse
copytrueFalse

*v4 only

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [data] => Array
 (
 [id] => 123456
 [invite_id] => 
 [type] => SurveyCampaign
 [link_type] => link
 [subtype] => standard
 [status] => Active
 [name] => My New Link
 [uri] => app.sgizmo.com/s3/1035186/b0fb3ea1a88d
 [SSL] => True
 [token_variables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => english
 [date_created] => 2016-05-31 15:57:30
 [date_modified] => 2016-05-31 16:01:46
 )

)

DELETE CAMPAIGN - Delete a specific link or campaign from a survey.

https://restapi.surveygizmo.com/v5/survey/123456/surveycampaign/100000?_method=DELETE

ParametersExampleRequired
Authentication Credentialsapi_token=5D685159B6964FB69B044D3E7D2676D1True

Response Example (.debug format):


Array
(
 [result_ok] => 1
)