CRUD operations with REST API
Documentation for the usage of the customer facing REST API for Database Contact insertion
Last updated
Documentation for the usage of the customer facing REST API for Database Contact insertion
Last updated
To access the API endpoints you need to acquire a Bearer token. The API uses Microsoft as an Identity Provider with Application permissions. Therefore the access can be managed similarily to the the access of the Microsoft Graph API.
If you have used UnifiedContactsPS with version lower than 1.1.0 to install Unified Contacts, you first have to perform the additional steps explained here.
NOTE: If you have initially installed Unified Contacts Pro before version 1.5.0, this is very likely the case.
Select an existing App Registration or create a new one that will be used to authenticate you when accessing the Unified Contacts REST API.
Navigate to API permissions > Add a permission > My APIs then select the Unified Contacts Admin AppRegistration. If you have not changed the default naming when deploying Unified Contacts via the ARM template the name will be in the following format:
admin-app-reg-uc-<13 random alphanumeric characters>
Select Application permissions on the top and activate the checkbox next to Contacts.Database.ReadWrite.All. Finalize the assignment by clicking "Add permissions" on the bottom.
A Cloud Application-, Application-, or Global-Admin now has to Grant admin consent for the tenant. This is done by clicking the Grant admin consent for <Tenant> button and confirming the action by clicking on Yes.
After the Admin consent is granted the AppRegistration is ready for usage.
A detailed explanation on acquiring tokens against an AppRegistration can be found here (Microsoft docs).
In the following example we will configure Postman to acquire a valid token with an Application Secret. However we recommend the usage of a Managed Identity (when applicable) or with Certificates when creating a productive/regularly running process or sync.
More details on certificate authentication can be found here (Microsoft docs).
More details on Managed Identity authentication can be found here (Microsoft docs).
Open the AppRegistration from before. Navigate to Certificates & secrets > Client secrets > New client secret. Set a description and configure the Expiry date (max. 2 years). Finalize the process by clicking "Add".
Copy and store the freshly generated client secret somewhere secure (e.g. a credential manager). NOTE: Once you leave this page you will only be able to see a censored shortened version of the secret. So if you do not store the secret properly and forget it you'll need to create a new one
Navigate to the Overview tab of the AppRegistration. Copy the ClientId for later use. Click on Endpoints and copy the OAuth 2.0 token endpoint (v2) for later use.
Navigate to API permissions select the Contacts.Database.ReadWrite.All permission and Copy the scope for later use.
Create a new Postman Collection and navigate to the Authentication tab. There select OAuth 2.0 as Type
Fill out the Configure new token category
Token Name: Any custom Name
Grant Type: Client Credentials
Access Token URL: Paste the token URL copied in Step 3
Client ID: Paste the Client Id copied in Step 3
Client Secret: Paste Secret copied in Step 2
Scope: Paste scope copied in step 4. Replace Contacts.Database.ReadWrite.All with .default
Client Authentication: Send as Basic Auth header
Your result should look something like this:
If you have configured everything correctly, you can now scroll to the bottom and click on "Get New Access Token" to acquire a new access token. All requests within the Collection can now be authenticated with that token.
You can download a sample Postman Collection here:
Id of the contact
Success
Id of the contact
Contact successfully found and returned
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Id of the contact
Request body
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Contact was successfully updated - full contact info is returned
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Id of the contact
Request body
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Contact was successfully updated - full contact info is returned
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Request body
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"
Unique identifier of the contact
"sap_28648f3b-8a60-4ded-a2df-5f303a74a17a"
Success
DisplayName of the contact
"John Doe"
JobTitle of the contact
"Software Developer"
Department of the contact
"Development"
Name of company assosiated with the contact
"Fantastic Company Inc."
Email addresses of the contact
Instant messaging addresses of the contact. Used for initiating a chat in Teams. If multiple imAddresses provided, the first one is used for intite a chat. If not provided the first eMail address of the contact is used.
Mobile phone numbers of the contact
Business phone numbers of the contact
Home phone numbers of the contact
Full address of the contact. If this is set it is used for displaying the address in the contact card. If not set the address is build from the other address properties.
"Any Street 1, 12345 Any City, Any Country"
Street address of the contact
"Any Street 1"
Postal code of the contact
"12345"
City of the contact
"Any City"
Country of the contact
"Any Country"
Sub source of the contact. This is used to identify the source of the contact if you are using multiple sources, that are synced into the database.
"SAP"