Contacts

Searching for contacts

You can search for contacts in a workspace by passing valid search criteria. The search criteria usually can be any of the contact elements (field names) and will be sent as part of the URI as query parameters.

This searching mechanism can be useful for seeing if any contacts exist in the system with a specific email address, phone number, job role and so on. In short, the API can help you search for any contact using any attribute associated with the contact.

The key parameters that are required on the URL to facilitate this search are as follows:

URI request elements as query params

fieldname

String

Specifies the field name of the contact object. The field name could be anything as long as it's a valid contact object.

Example:
http://api..whispir.com/contacts?apikey=&firstName=Sam

sortOrder

String

The order in which you require the results to be returned. Either ‘asc’ or ‘desc’.

sortFields

String

The fields that you require the ordering to be performed on. Multiple fields can be provided, separated by a comma.

Example:
http://api..whispir.com/contacts?apikey=&firstName=Sam&sortFields=lastName,jobTitle

The search can also be done inside a specific workspace, if needed, by adding the workspace information to the URI.

Note: There is no global search feature available where you can search on all the workspaces present in the system (under allowed user permission). So when no workspace is provided, the search is performed on your default workspace.

  • JSON
  • XML

Searching for contacts

Users can easily use further query parameters to search for specific contacts within Whispir.

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/contacts?apikey=<your_api_key>&firstName=Sam&sortOrder=desc&sortFields=workEmailAddressPrimary

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.contact-v1+json

{{codeEnd}}

Searching for contacts with custom fields

Whispir supports extension of the default contact profile through the use of custom fields. There may be cases where you want to search for contacts that contain these specific fields. For example, the Whispir API supports searching for contacts using these custom fields.

Any custom field can be searched by adding custom_ to the name. For example, if the field name is StaffId, the URL would search for:

/contacts?custom_StaffId=12345

  • JSON
  • XML

Searching for contacts using custom fields

Within Whispir, contacts can have custom fields to store data that is not supported on the default contact profile. Users can search for contacts using this data using the API.

HTTP 1.1 GET https://api.<region>.whispir.com/contacts?apikey=<your_api_key>&custom_staffID=123456
Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk
x-api-key: your_api_key
Accept: application/vnd.whispir.contact-v1+json