Upload line of credit document

How to upload a document to a line of credit account.

This request is a bit different from our others listed here in our documentation. This request requires two steps. (Pretty exciting, right?) The first step is acquiring a URL to send the upload file to. Then, the second step is actually uploading the file to your account through the URL.

Step 1 - Generate Upload URL

The first step to adding a line of credit document is generating a URL. Here, you'll send a POST request to the following URL:

https://loanpro.simnang.com/api/public/api/1/LineOfCredits({ID})/document/upload

This step requires a JSON payload, and the payload should be formatted like the following example:

{
  "sectionId": 1, // This is the ID of the "section"——or category——that the document is filed under. You can create your own sections.
  "fileName": "file.jpg",
  "customFileName": "Line of Credit Document"
}
Authorization:<Bearer token>
Autopal-Instance-Id:<Tenant ID>
Content-Type:application/json

A successful request will result in a response like the following:

{
  "d": {
    "id": "89",
    "fileName": "file.jpg",
    "uploadUrl": "{uploadUrl}",
    "customFileName": "Line of Credit Document",
    "mime": "image/jpeg"
  }
}

This response includes a uploadUrl field. This field holds the URL used in the next step.

⚠️

URL Expiration

The uploadURL will expire after 45 minutes. Complete the upload process before the time limit.

Step 2 - Upload Document

This step is where you'll actually upload the document to your account.

🚧

Note

This step does not require authentication. You will not use any headers.

To upload the document, send a PUT request to the uploadUrl returned by the request in the step above. Here are examples of the payload in both cURL and Python:

curl

--upload-file "C:\Users\filepath\file.jpg" 

"uploadUrl": "{uploadUrl}"
import requests

url = "https://autopal-fandora.s3.amazonaws.com/tenants/5200243/fileAttachments/LineOfCreditDocuments/9/..."

file = open(r'C:\Users\filepath\file.jpg', 'rb')

response = requests.put(url, data=file)

print('Status:', request.status_code)
print(response.text)

If you're a Postman user, you can upload files by selecting the 'Binary' body type and using the 'Upload File' button.