Get started with the Contacts API
The Contacts API is a RESTful API with a .NET client wrapper that can be used in razor and bespoke projects that provides programmatic access to read and write Populo contact information.
The API has been designed to be easy to use, and this documentation assumes you are going to be using the Contacts API in razor but most of the code examples can be used in a bespoke .NET project.
Add the following import directives to access the Populo API.
Accessing information about the current contact is the main goal of the CXM. To do this you would use the following code:
Returning contact properties
Data is grouped into facets to better facilitate the user’s understanding. An example of this is that a user may have two phone numbers, one for work and one for home. To access this information we would do the following for the home number.
Note: A full list of properties available in Populo can be found in the Contact properties article.
In order to access their work number we would use the following code:
The API is designed to be as safe to use as possible, consider the following code:
Even though there is no facet called DoesNot and no property called Exist the API gracefully handles the situation and returns a null value rather than giving an error.
Was this article helpful?