Client libraries and demo code for the Formlabs API.
API endpoint documentation is available in the api-documentation.html file.
Caution
Disclaimer: The Formlabs API And SDK are still in a pre-release "alpha" status. It is suitable for evaluation and prototyping, but expect things to change before public release.
All PreForm SDK integrations involve starting the PreFormServer background application to expose the HTTP API and then making HTTP API calls in your own code. Formlabs provides an example Python library that handles the setup and request formatting, but integrations in other languages can be made by following the same pattern:
- Run the PreFormServer application in the background. This creates a HTTP Server interface for PreForm running on localhost port 44388 by default.
- Write code that makes HTTP calls to the endpoints. Endpoints and parameters are described in the openapi.yaml specification and the htmldocs folder. There are many public tools to automatically generate libraries in your choice of programming language based on the Formlabs provided by openapi.yaml.
Note
The HTTP Server that PreForm uses to communicate is only exposed to the local network of your computer and not to the public Internet, unless you have configured your computer to expose the port running the PreForm Server to the Internet.
PreFormServer executables are available for each platform is available for MacOS, Windows, and Linux on the Github Releases page.
Download the .zip folder for your operating system, unzip it, and then move the PreFormServer executable to the folder where you want it to be installed.
If a PreFormServer application is downloaded from your browser, then it will probably be blocked from running by the MacOS security checks. You can resolve this security check by:
- Running a command from your terminal to remove the security check
cd path/to/your/PreFormServer.app
xattr -r -d com.apple.quarantine PreFormServer.app
- Manually opening and running the PreFormServer app
Locate the PreFormServer application in the Finder. Right click it and select "Open". You should see a MacOS security check like `"PreFormServer" cannot be opened because the developer cannot be verified". Click "Cancel" and then repeat the process of right clicking the application and selecting "Open". The second time you should be given the open to "Open" the application - select that. The server will start and exit without opening any window. The security check should now be resolved.
All these examples work on the example openapi.yaml
OpenAPI 3.0 Description of the Formlabs HTTP REST API.
npx @redocly/cli build-docs -o api-documentation.html openapi.yml
brew install openapi-generator
openapi-generator generate -i openapi.yml -g python -o ./python/pythonlib -c ./python/gen-config.yaml
brew install openapi-generator
openapi-generator generate -i openapi.yml -g javascript -o ./js/jslib -c ./js/gen-config.yaml
Copyright 2024 Formlabs
Released under the Apache License.