Contacts
A contact is a record in the user database that contains at least an e-mail address and is not associated with any survey on the account.
To add a respondent to a survey, a contact must be created. A contact is a link between a respondent entity and a survey.
Both contacts and respondents do not have to be unique within a user account.
Operations on respondents are located in the next section called Respondents
List of operations for the resource
Name | URL | Description |
| Returns a list of contacts. Contacts are sorted alphabetically by email address. | |
| Searches for contacts by criteria passed in the | |
| Adds a contact to the contact list of the logged-in user. | |
| Adds a contact to the contact list (for offline distribution, email is not required). |
Description of response parameters
Name/path | Description | Possible values |
| Contact ID | |
| E-mail address | |
| Value of the first optional attribute. The attribute is active if it has been defined in the user account. | |
| Value of subsequent optional attributes (from 2 to 15). The attribute is active if it has been defined in the user account. |
List of contacts
URL
(GET) https://app.customerhero.com/api/v2/contactsOptional parameters (POST)
Name | Description |
| Limit on the number of completions |
| List offset |
Example response
{
"total":"20",
"list":[{
"id":100824,
"email":"jan@kowalski.pl",
"label1":"Jan",
"label2":"Kowalski",
"label3":"600 700 800",
"label4":"",
"label5":""
},{
...
}]
}Returned errors
401 Unauthorized– If the user references a foreign resource.404 Not Found– If no contacts are found.
Searching for contacts
URL
(GET) https://app.customerhero.com/api/v2/contacts/searchOptional parameters (POST)
Name | Description |
| Limit on the number of completions |
| List offset |
| Searching for a respondent by email address |
| Searching for a respondent by the value of attribute 1 |
| Searching for a respondent by the value of attribute n |
Example response
{
"total":"20",
"list":[{
"id":100824,
"email":"jan@kowalski.pl",
"label1":"Jan",
"label2":"Kowalski",
"label3":"600 700 800",
"label4":"",
"label5":""
},{
...
}]
}Returned errors
401 Unauthorized– If the user references a foreign resource.
Adding contacts
URL
(GET) https://app.customerhero.com/api/v2/contacts/addParameters (POST)
Name | Description |
| E-mail address (mandatory parameter) |
| Value of attribute 1 |
| Value of attribute n |
Example response
{
"id_contact":"149768"
}Returned errors
406 Not Acceptable– If mandatory parameters are not passed.
Adding offline contacts (without an e-mail address)
URL
(GET) https://app.customerhero.com/api/v2/contacts/addParameters (POST)
Name | Description |
| User token (mandatory parameter) |
| Value of attribute 1 |
| Value of attribute n |
Example response
{
"id_contact":"149768"
}Returned errors
406 Not Acceptable– If mandatory parameters are not passed.