Release Notes for Laserfiche API Server

September 18, 2024 | KB: 1014404
Laserfiche API Server 1.0, Laserfiche API Server 1.1

Summary

The Laserfiche API Server provides programmatic access to Laserfiche for self-hosted systems.

The self-hosted Laserfiche API Server can be installed to connect with your self-hosted Laserfiche Server. The APIs available are almost the same as the APIs available for Cloud. We also provide client libraries you can use to speed up the development process when integrating with Laserfiche using the Laserfiche APIs. The same client libraries can be used for both Cloud and Self-Hosted. For more information, please visit https://developer.laserfiche.com/.

Differences between Cloud and Self-Hosted Laserfiche API

  • Authentication: The Cloud Laserfiche API follows the OAuth 2.0 authorization model whereas the Laserfiche API Server for self-hosted systems supports username/password authentication.
  • APIs: The deprecated Cloud ServerSession APIs are not available in the Laserfiche API Server for self-hosted systems.
  • Volume Support: The Laserfiche API Server supports choosing volumes when creating new entries while the Laserfiche API in Cloud does not.

Laserfiche API Server Requirements

This section lists the system requirements for the Laserfiche API Server.

  • Operating System: 64-bit Windows Server 2012 R2 or later, Windows 10 or later.
  • Internet Information Services (IIS)
  • .NET 6
  • The Laserfiche API Server supports connecting to Laserfiche Server 11 repositories.

Installation Information

This section documents initial configuration information for the Laserfiche API Server.

  1. In IIS Manager, configure HTTPS bindings (required) for the website containing "LFRepositoryAPI" web application.
  2. Navigate to the directory "%ProgramData%\Laserfiche\API Server\LFRepositoryAPI" and open "appsettings.json" using a text editor as an administrator.
  3. In "appsettings.json", set the value of "LaserficheServerName" to the fully qualified domain name of your Laserfiche Server in your network. If your Laserfiche Server is using a non-default port, append the port to the fully qualified domain name (e.g., "myLaserficheServer.myOrganization.com:123").
  4. (Optional) In "appsettings.json", set the value of "EnableLaserficheServerSSL" to false if the connection to the Laserfiche server is not secured using TLS/SSL.
  5. (Optional) In "appsettings.json", set the value of "EnableGetRepositoryListApi" to true if you would like to enable the GET /Repositories API that returns the list of repositories. Note that using this API does not require an access token.
  6. (Optional) In "appsettings.json", set the value of "KeyedConcurrentLicense" to your "Keyed Concurrent License".
  7. (Optional) In "appsettings.json", set the value of "LaserficheWebClientHostUrl" to your "Laserfiche Web Client Host URL" (e.g., "https://{LaserficheWebClientHostName}/laserfiche").
  8. (Optional) To override the default log settings, navigate to the installation directory (e.g., "C:\Program Files\Laserfiche\API Server\LFRepositoryAPI") and open "nlog.config" using a text editor as an administrator. For example, the last logging rule's "minLevel" can be increased to reduce trace logging.
  9. Save "appsettings.json" and restart IIS Server.

To verify the Laserfiche API Server is running, navigate to the API Server Swagger page by opening IIS Manager and navigating to the website containing "LFRepositoryAPI" and click browse application. This should open the following page https://{APIServerName}/LFRepositoryAPI/swagger/index.html.

Troubleshooting the Installation

  • Verify the ASP.NET Core Runtime (v6.0 or later) - Hosting Bundle is installed correctly. If not, manually install the runtime again.
  • Verify the value of "LaserficheServerName" is set correctly in "appsettings.json" and the configuration settings printed to the logs are correct. The logs can be found in the directory "%ProgramData%\Laserfiche\API Server\LFRepositoryAPI\Logs".
  • If the installation fails, please verify that in IIS Manager, a website with ID "1" is present.

Authenticating with the Self-Hosted Laserfiche API

To start using the self-hosted Laserfiche APIs, you will need an access token to send with each request. The request to get an access token requires the repository ID associated with your Laserfiche Server and a username and password to sign in.

POST https://{APIServerHostName}/LFRepositoryAPI/v1/Repositories/{repositoryId}/Token
Content-Type: application/x-www-form-urlencoded

grant_type=password&username={username}&password={password}

Note: You can make this request from the Swagger Playground. Navigate to the installed Laserfiche API Server Swagger Playground page: https://{APIServerHostName}/LFRepositoryAPI/swagger/index.html and expand the Token section to find the /Token API. Click the Try it out button and fill in the request parameters to send the request.

If successful, the API will return a 200 HTTP response status code and the response body will contain an access token.

HTTP 200 OK
{
"access_token": "...",
"expires_in": 900,
"token_type": "bearer"
}

Include the access token in the Bearer Authorization header when accessing the Laserfiche API like so:

GET https://{APIServerHostName}/LFRepositoryAPI/v1/Repositories/{repositoryId}/Entries/{entryId}
Authorization: Bearer {accessToken}

Note: To add the access token to each request on the Swagger Playground, scroll to the top of the page, click the Authorize button, and enter the access token in the dialog box.

Now you're ready to make Laserfiche API calls.

Sample Project

Try our Sample Projects to learn how to use our client libraries to access your self-hosted Laserfiche API Server.

Known Issues

  • Document import through the Laserfiche API Server may return a "The page was not displayed because the request entity is too large." error. With certain network configurations, the default value for the IIS uploadReadAheadSize value may not be sufficient.
    1. On the computer hosting the Laserfiche API Server, open Internet Information Services (IIS) Manager.
    2. Under Default Web Site, select LFRepositoryAPI.
    3. In the features view, under the Management section, double-click Configuration Editor.
    4. In the Section dropdown list, select system.webServer/serverRuntime.
    5. Increase the uploadReadAheadSize value. The default value is 49152 bytes.

Updates

  • November 2, 2022
    • Laserfiche API Server 1.0 released
  • February 23, 2023
    • Laserfiche API Server 1.1 released as part of 1014424.