API – Do Not Call

Introduction

In the event that you wish to mark a particular phone number as "Do Not Call", you can do so through the API or by changing the status in the UI. If you wish to make the change in the UI, reference the article Customer Phone Number for instructions on how to do so. Here, we explain to make the change using the API.

Changing the status to "Do Not Call" will remove the phone number from any TCN phone calls. It can also be used to notify your employees not to contact the Customer via that method. Changing the status of a phone to "Do Not Call" via the API is a 2 step process. Step 1 is to GET the phone number entity for the customer you're working with, and step 2 is to update the status to "Do Not Call". 

API Calls

Step 1:

Use a GET API call to pull the needed phone information from LoanPro. You will send the request to the following endpoint: 

GET https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(531)?$expand=Phones 

In this example, we use the Customer ID of 308. Remember to change this to your own selected ID when you try this request yourself.

This request's response will then provide all of the IDs for the phone numbers that are tied to the customer. The ID of the phone number that needs to be marked as "Do Not Call" will be used in step 2.

Step 2:

Next, send a PUT request to set the Do Not Call setting for the customer. Send the request to the following URL:

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(531) 

In this step, you again use the Customers endpoint. Then, in the payload, you will reference the ID of the phone number. In the example listed below, we use the phone number ID of 771.

Payload:

{
  "Phones": {
    "results": [
      {
"id": "771",
"dndEnabled": 1,
"__update": 1,
"__id": "771"
      }
    ]
  }
}
In this example, we use the phone number ID of 771. Remember to change this to your own selected ID when you try this request yourself.

Here's a breakdown of the parameters used in the body of this request:

Parameter

Description

id

The ID of the customer's phone number.

dndEnabled

This determines whether the phone number should be listed as "Do Not Call".

__update

This updates the phone number.

__id

This is the ID of the phone number being updated.


How did we do?


Powered by HelpDocs (opens in a new tab)