Adding a contact

Super simple example of adding a contact

In this example, we will be using Postman to add a contact. Follow the Using Postman to test endpoints if you need to configure it.

To add a contact we will be using the NLS XML Import endpoint.

We will also be looking at the XML Import Spec for details on the elements needed to add a contact.

1302

XML Import Spec focused on CIF (contact records)

🚧

XML Import Spec has required and version specific attributes

Some attributes are version specific such as Cifno in the screenshot above which needs NLS version 5.27 or higher.

For our example, we are going to set the following attributes:

  • Note that some of those attributes are on the NLS element.
AttributeOur valueDetails
CommitBlock1We only want the contact record to be added IF all entries are successful.
EnforceTagExistance1Let's make sure all the tags are correct.
UpdateFlag0We want to insert a new contact record. That means we are setting this to import only.
EntityIndividualThe entities must be configured in the NLS client prior to using the API. In this case, we have configured the entity of Individual already.
CIFPortfolioNamedefaultWe are using the default portfolio. This must be enabled in the NLS client. We are also escaping the <``> characters.
ShortNameFreddie Castle
FirstName1FreddieNote there are multiple ways to import the full name.
LastName1Castle
EmailAddress1[email protected]

🚧

Some attributes need to be configured in the NLS app

Some attributes, like Entity must be configured first in the app itself before being able to add a contact programmatically.

Our XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<NLS CommitBlock="1" EnforceTagExistence="1">
	<CIF 
  UpdateFlag="0"
  Entity="Individual"
  CIFPortfolioName="&lt;default&gt;" 
  ShortName="Freddie Castle"
  FirstName1="Freddie"
  LastName1="Castle"
  EmailAddress1="[email protected]"
  >
	</CIF>
</NLS>

Now let's add the contact record using the NLS XML Import endpoint in Postman.

🚧

Authenticate first

Remember to generate a new token (authenticate) prior to sending the request.

πŸ“˜

Set test parameter to FALSE

If you are following along with this example, remember to edit Query Params in Postman. test value must be set to false to commit the data sent.

2018

XML Import endpoint with the contact payload we configured above, along with the success response.

We can see the contact record in the app:

1472