SurveyCampaign Sub-Object

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/v4/survey/123456/surveycampaign
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
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
 [_type] => SurveyCampaign
 [_subtype] => link
 [__subtype] => standard
 [status] => Active
 [name] => Default Link
 [uri] => {publish link}
 [SSL] => False
 [tokenvariables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => Auto
 [datecreated] => 2012-04-30 13:22:35
 [datemodified] => 2012-04-30 13:22:35
 )

 [1] => Array
 (
 [id] => 100001
 [_type] => SurveyCampaign
 [_subtype] => email
 [__subtype] => standard
 [status] => Deleted
 [name] => My New Email Campaign
 [uri] => {publish link}
 [SSL] => False
 [tokenvariables] => 
 [limit_responses] => 
 [close_message] => This survey is now closed.
 [language] => Auto
 [datecreated] => 2012-05-03 15:20:41
 [datemodified] => 2012-05-03 15:21:25

Back to the Top

GET CAMPAIGN - Get information about specified link or campaign.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [data] => Array
 (
 [id] => 100000
 [_type] => SurveyCampaign
 [_subtype] => link
 [__subtype] => standard
 [status] => Active
 [name] => Default Link
 [uri] => {publish link}
 [SSL] => False
 [tokenvariables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => Auto
 [datecreated] => 2012-04-30 13:22:35
 [datemodified] => 2012-04-30 13:22:35
 )

)

Back to the Top

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/v4/survey/123456/surveycampaign?_method=PUT&type=link&name=New Link Name
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
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
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] => 100000
 [_type] => SurveyCampaign
 [_subtype] => link
 [__subtype] => standard
 [status] => Active
 [name] => NewLink
 [uri] => {publish link}
 [SSL] => False
 [tokenvariables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => 
 [datecreated] => 2013-01-08 13:17:44
 [datemodified] => 2013-01-08 13:17:44
 )

)

Back to the Top

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

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000?_method=POST
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
nameUpdatedLinkNameFalse
languageauto, english, etc.False
statusactive, closed, deletedFalse
slug (link only)updatedlinkslugFalse
subtype (link only)standard, private, shortlinkFalse
privatename (link only)*awesomesurveys.comFalse
tokenvariablesvar%3Dvalue%26var2%3d=valueFalse
copytrueFalse

*v4 only

Response Example (.debug format):


Array
(
 [result_ok] => 1
 [data] => Array
 (
 [id] => 100000
 [_type] => SurveyCampaign
 [_subtype] => link
 [__subtype] => standard
 [status] => Active
 [name] => UpdatedLinkName
 [uri] => {publish link}
 [SSL] => False
 [tokenvariables] => 
 [limit_responses] => 
 [close_message] => 
 [language] => 
 [datecreated] => 2013-01-08 12:40:47
 [datemodified] => 2013-01-08 13:53:35
 )

)

DELETE CAMPAIGN - Delete specified link or campaign.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000?_method=DELETE
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True

Response Example (.debug format):


Array
(
 [result_ok] => 1
)

Back to the Top