Communicating with the API

General

The LoanPro API is based off of HTTP and uses TLS 1.1+ to encrypt it’s communication channel. As a result, any TCP library and TLS library can be used to communicate with the LoanPro API. Many languages, such as PHP and Javascript, come with these libraries built in, making it easy to communicate with the LoanPro API.

This article will go over the basic format for the HTTP request header used in communicating with the LoanPro API and will cover the general format of the request body.

Authentication

The LoanPro API will look for three special headers to authenticate your request. They are the “Authorization”, “Autopal-Instance-ID”, and “Content-Type” headers.

The Authorization header has the following format:

Authorization: Bearer your_api_token

Remember to replace “your_api_token” with your actual token. The “Bearer ” part is required before the API token.

The Autopal-Instance-ID header has the following format:

Autopal-Instance-ID: your_tenant_id

Remember to replace “your_tenant_id” with your actual tenant ID.

The specific API Token and Tenant Id for your company can be found inside of the UI of your LoanPro Tenant at Settings>Company>API>Overview. Please remember to NEVER share your API Token via email or any unsecured method.

Finally, the  Content-Type header has the following format:

Content-Type: application/json

Sending Data

Sending data is done through the body of the request call. All data sent to LoanPro must be in a JSON format. Below is an example of a body that will send the information for a cat to the server (please note that there is no endpoint in LoanPro that will accept this data; this is an example of how JSON works):

{
   "name":"Fluffy",
   "legs":"four",
   "fur":"yes",
   "birthdate":"2015-01-29",
   "Owner":{
      "name":"Janet",
      "address":"123 Oak Ln",
      "phone":"5555555555"
   }
}

The above will send information about a cat to the server. The server will then know the following information:

  • The cat’s name is Fluffy
  • The cat has four legs
  • The cat does have fur
  • The cat was born January 29, 2015
  • The cat has an Owner named Janet who lives at 123 Oak Ln and has the phone number 5555555555

To see a list of all of the available endpoints and the JSON requests for them, visit http://local.fandora.com/restler/.

Related Articles

Leave A Comment?