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.
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.
Attribute | Our value | Details |
---|---|---|
CommitBlock | 1 | We only want the contact record to be added IF all entries are successful. |
EnforceTagExistance | 1 | Let's make sure all the tags are correct. |
UpdateFlag | 0 | We want to insert a new contact record. That means we are setting this to import only. |
Entity | Individual | The entities must be configured in the NLS client prior to using the API. In this case, we have configured the entity of Individual already. |
CIFPortfolioName | default | We are using the default portfolio. This must be enabled in the NLS client. We are also escaping the <``> characters. |
ShortName | Freddie Castle | |
FirstName1 | Freddie | Note there are multiple ways to import the full name. |
LastName1 | Castle | |
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="<default>"
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.
We can see the contact record in the app:
Updated over 3 years ago