Once you have been able to successfully upload data files into your PrecisionLender account, you may decide to automate the upload of these files on a scheduled basis. This article outlines the steps to be completed to create a batch file for uploads via cUrl.
- Prepare your file in the correct format required by the API endpoint. All of which are detailed within the PrecisionLender API documentation (API v2-> Assumptions).
- Install cUrl on the machine or server you wish to use to upload the files to PrecisionLender. Details for downloading cUrl and further documentation are available within the cUrl library.
- In order to use the PrecisionLender API, at least one Service User account will need to be setup and enabled. Follow steps available within the Service User Account Access For PrecisionLender API support article to complete service user setup.
- After setting up your service user, replace the credentials in the sample cURL script below with your own, and specify the file path.
- This batch file can then be executed either manually by double clicking, or by setting up an automated task using Windows Task Scheduler.
Sample Batch File
:: Enter your credentials here:
:: Enter the location of the folder containing your files here:
set FilePath=\\fileserver\shared folders\Precision Lender\Funding Curves
:: Nothing below this line should need to be changed
:: Upload the funding curve data
curl --request PATCH \
--url https://api.precisionlender.com/v2/assumptions/fundingcurves \
-H 'Authorization: Basic %serviceUserName%:%ServiceUserKey%' \
-H 'ClientId: %clientId%' \