Contact Sub-Object

Note: Contacts records are stored within our system using the email address as the key. A single record per email address is stored per account. Email address and all standard contact fields are are stored at the account level. This means that changes to the standard contact fields of an existing contact will be made globally wherever the contact is present. For more information: http://help.surveygizmo.com/help/article/link/global-vs-campaign-contact-fields.

The following API calls are currently available for the Contact sub-object:

GET LIST - Get a list of all of your contacts for the specified survey and campaign.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000/contact
Parameters Example Required
Authentication Credentials api_token=5D685159B6964FB69B044D3E7D2676D1 True
page page=3 False
resultsperpage resultsperpage=100 False
Response Example (.debug format):
Array
(
    [result_ok] => 1
    [total_count] => 55000
    [page] => 1
    [total_pages] => 1100
    [results_per_page] => 50
    [data] => Array
        (
            [0] => Array
                (
                    [id] => 100030864
                    [semailaddress] => example@email.com
                    [sfirstname] => First
                    [slastname] => Last
                    [sorganization] => Organization
                    [sdepartment] => Department
                    [shomephone] => 123-456-7891
                    [sfaxphone] => 
                    [sbusinessphone] => 
                    [smailingaddress] => 123 Main St
                    [smailingaddress2] => 
                    [smailingaddresscity] => Anycity
                    [smailingaddressstate] => CO
                    [smailingaddresscountry] => US
                    [smailingaddresspostal] => 12345
                    [stitle] => 
                    [surl] => 
                    [scustomfield1] => 
                    [scustomfield2] => 
                    [scustomfield3] => 
                    [scustomfield4] => 
                    [scustomfield5] => 
                    [scustomfield6] => 
                    [scustomfield7] => 
                    [scustomfield8] => 
                    [scustomfield9] => 
                    [scustomfield10] => 
                    [estatus] => Active
                    [esubscriberstatus*] => Unsent
                )
               .
               .
               .
               .
            [49] => Array
                (
                   [id] => 100030864
                    [semailaddress] => example@email.com
                    [sfirstname] => First
                    [slastname] => Last
                    [sorganization] => Organization
                    [sdepartment] => Department
                    [shomephone] => 123-456-7891
                    [sfaxphone] => 
                    [sbusinessphone] => 
                    [smailingaddress] => 123 Main St
                    [smailingaddress2] => 
                    [smailingaddresscity] => Anycity
                    [smailingaddressstate] => CO
                    [smailingaddresscountry] => US
                    [smailingaddresspostal] => 12345
                    [stitle] => 
                    [surl] => 
                    [scustomfield1] => 
                    [scustomfield2] => 
                    [scustomfield3] => 
                    [scustomfield4] => 
                    [scustomfield5] => 
                    [scustomfield6] => 
                    [scustomfield7] => 
                    [scustomfield8] => 
                    [scustomfield9] => 
                    [scustomfield10] => 
                    [estatus] => Active
                    [esubscriberstatus] => Unsent
                )

        )

)

esubscriberstatus is a combination of status log response status and send status. It returns 1 of 5 values:

  • Unsent
  • Sent
  • Bounced
  • Partial - Link clicked and at least one page submitted
  • Complete - Link clicked and response completed
Back to the Top

GET CONTACT - Get a information about a specified contact.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000/contact/100030864
Parameters Example Required
Authentication Credentials api_token=5D685159B6964FB69B044D3E7D2676D1 True

Response Example (.debug format):

Array
(
    [result_ok] => 1
    [data] => Array
        (
            [id] => 100030864
            [semailaddress] => fakegizmo777+0@gmail.com
            [sfirstname] => 
            [slastname] => 
            [sorganization] => 
            [sdepartment] => 
            [shomephone] => 
            [sfaxphone] => 
            [sbusinessphone] => 
            [smailingaddress] => 
            [smailingaddress2] => 
            [smailingaddresscity] => 
            [smailingaddressstate] => 
            [smailingaddresscountry] => 
            [smailingaddresspostal] => 
            [stitle] => 
            [surl] => 
            [scustomfield1] => 
            [scustomfield2] => 
            [scustomfield3] => 
            [scustomfield4] => 
            [scustomfield5] => 
            [scustomfield6] => 
            [scustomfield7] => 
            [scustomfield8] => 
            [scustomfield9] => 
            [scustomfield10] => 
            [estatus] => Active
            [esubscriberstatus*] => Unsent
        )

)

*esubscriberstatus is a combination of status log response status and send status. It returns 1 of 5 values:

  • Unsent
  • Sent
  • Bounced
  • Partial - Link clicked and at least one page submitted
  • Complete - Link clicked and response completed
Back to the Top

CREATE CONTACT - Create a new contact.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000/contact/?_method=PUT&semailaddress=newexample@email.com
Parameters Example Required
Authentication Credentials api_token=5D685159B6964FB69B044D3E7D2676D1 True
semailaddress example@email.com True
sfirstname Firstname False
slastname Lastname False
sorganization Organization False
sdivision Division False
sdepartment Department False
steam Team False
sgroup Group False
srole Role False
shomephone 123-456-7890 False
sfaxphone 123-456-7890 False
sbusinessphone 123-456-7890 False
smailingaddress 123 Main St False
smailingaddress2 Suite 100 False
smailingaddresscity Anycity False
smailingaddressstate CO False
smailingaddresscountry US False
smailingaddresspostal 12345 False
stitle Title False
surl www.website.com False
scustomfield1-10* custom field data 1-10 False
custom[ID]† custom[15]=value False
estatus Active, Inactive False
allowdupe true False

*These are the custom fields 1-10 that are available as part of the email campaign contact list.
†These are the custom fields that are available as part of the account email lists. Learn how to get the ID number for custom fields.

Back to the Top

UPDATE CONTACT - Update a specified contact.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000/contact/100030864?_method=POST
Parameters Example Required
Authentication Credentials api_token=5D685159B6964FB69B044D3E7D2676D1 True
semailaddress example@email.com False
sfirstname Firstname False
slastname Lastname False
sorganization Organization False
sdivision Division False
sdepartment Department False
steam Team False
sgroup Group False
srole Role False
shomephone 123-456-7890 False
sfaxphone 123-456-7890 False
sbusinessphone 123-456-7890 False
smailingaddress 123 Main St False
smailingaddress2 Suite 100 False
smailingaddresscity Anycity False
smailingaddressstate CO False
smailingaddresscountry US False
smailingaddresspostal 12345 False
stitle Title False
surl www.website.com False
scustomfield1-10* custom field data 1-10 False
custom[ID]† custom[15]=value False
estatus‡ Active, Inactive False

*These are the custom fields 1-10 that are available as part of the email campaign contact list.
†These are the custom fields that are available as part of the account email lists. Learn how to get the ID number for custom fields.
‡Updating the contact status to "Inactive" will unsubscribe the contact from the email campaign.

DELETE CONTACT - Delete a specified contact.

https://restapi.surveygizmo.com/v4/survey/123456/surveycampaign/100000/contact/100030864?_method=DELETE
Parameters Example Required
Authentication Credentials api_token=5D685159B6964FB69B044D3E7D2676D1 True

Response Example (.debug format):

Array
(
    [result_ok] => 1
)

Getting Custom Field ID from Email Lists

Go to Account > Email Lists and click the link to Manage Custom Fields in the bottom left. With a web-developer tool installed on your browser right click on the desired field and click Inspect Element. This will give you the details for this field. What you are looking for is the name field. It will look like the below. The number is all you need for either a PUT or a POST.

Back to the Top