Corporate LinX - Documentation Library
Introduction
This document outlines our API for our Document Management System (DMS) to illustrate how our clients can send us files for processing. These files can be used for a wide variety of business processes.
Here, we explain how to use our Corporate LinX API to transmit files. This process falls in line with our standard API guidelines, which are covered in more detail in our more general API usage documentation.
As a basic outline, you will need to:
- Ensure you are authenticated, by requesting an Auth Token
- Submit your file to a known folder location
- Request files and folders
Authentication
To submit any data to our API, you must first request an auth token. This allows the API to know who you are, and therefore who is responsible for any requests made. This process is outlined in our Getting Started documentation. The basic API call looks something like this:
HTTP POST https://www.yourportal.com/API/Account/Login
{
"User": "Your username",
"Pass": "Your Password"
}
A valid token response will look something like this:
{
"id": "8d9d9df6ae9c48dfb91d5d648916ea379f9524ec84e64ac9815d80360a98d45e",
"reason": 0,
"userName": "Paul",
"expires": "2020-11-17T10:07:07.9741177+00:00"
}
Submitting a File
Once authenticated, you will need to know your destination path and ensure that the account in question has access to it, this could be as simple as simply logging in and going to the folder in the UI.
The request would look something like this:
HTTP POST https://www.yourportal.com/API/Core/App({appId})/{path to file}
{
Authorization: bearer {token.id}
Content-Type: {mime type string}
Body: {raw file content}
}
There are a few pieces of informtion you will need in order to put this request together, which are as follows:
- AppId - This is found by examining the variable session.app within your browsers watch window
- Path - This is found by looking at the DMS UI from within the portal
- Mime Type - Global standard. The most common ones are "application/json", "application/xml" or "text/csv"
- This will be dependent on your file type
- Please contact someone at Corporate LinX directly if you require support with this
Requesting Files and Folders
We have an endpoint at ~/Api/Core/Folder for getting the data about a folder and another at ~/Api/Core/File for getting the data about files.
Adding /GetMetatdata() to either in a standard HTTP GET will give you the metadata definition of the endpoint.
If you want to download a file you can do so by using HTTP GET ~/Api/Core/App({appId})/DMS/{path to file} doing this with a path to a folder will zip up recursively the contents of that folder and send you the compressed zip package.
Finalising Sessions
As a finishing touch for security reasons we would also recommend that you logout to force the token to expire, this can be done by issuing the following request:
HTTP POST https://www.yourportal.com/API/Account/Logout
{
Authorization: bearer {token.id}
}