PhotoMesh provides a REST API to create a project queue and then activate, monitor, and manage queue processing. The project queue is created using the addProjects API method, which submits a JSON file defining one or more projects and the tasks to execute for each project.
The Queue API is exposed and documented through interactive Swagger documentation. Swagger provides:
- Queue, Project, and Manager endpoints
- Request and response schemas, along with JSON request examples for common workflows
- Parameter descriptions
- The ability to execute API calls directly against a running PhotoMesh instance
You can access the Queue API Swagger documentation from within PhotoMesh. Opening Swagger from PhotoMesh launches the Swagger interface already connected to the current PhotoMesh environment. This allows you to review the API and execute requests immediately against the active PhotoMesh instance, without additional configuration. The Queue API Swagger documentation can also be opened independently in a web browser. This option is useful for reviewing the API structure and examples without running the PhotoMesh user interface.
To test out the Project Queue Editor and Queue Manager on your local PhotoMesh:
- From the Start page, open the Automation Dashboard and in the Project Queue section, click Project Queue.
To view documentation of the REST API:
- From the Start page, open the Automation Dashboard and in the Project Queue section, click Reference Guide.
Using the PhotoMesh Project Queue API with Python
The Project Queue API streamlines the management of automation tasks, including project creation, build triggers, and report retrieval. This article provides a step-by-step guide with sample data for using a Python script to run the Project Queue API.
Version 8.1.0 Update: This guide reflects major updates introduced in PhotoMesh 8.1.0, including a revised API structure and enhanced automation capabilities.
Step 1: Download and save the example files
- Download this example project, extract its files and save them in the following folder: C:\MyProject. Check that the Photos folder from the zip file is directly under the MyProject folder.
- Download the QueueTutorial.zip attached to this article, extract its files, and save them in the same folder: C:\MyProject.
Step 2: Run the Python script
- Check that Python is installed on your computer. If it isn't, download it from python.org and install it.
-
Navigate to your script's directory using the command prompt. E.g., if the script is saved in C:\MyProject, use:
cd C:\MyProject -
Make sure PhotoMesh is running. Then execute the following command in the command prompt in order to run the script:
python scriptPmQueue.py -
When you run the Python script:
The JSON file is loaded into the Project Queue.
The queue creates a new project, loads the photos, and performs an initial AT-only build.
The next task (a Python script) retrieves the latest AT results and checks the median error against the defined threshold.
If the error is within the limit, the script reorders the queue to skip the aggressive AT build and proceed to the next task.
If the error exceeds the threshold, the script ends and the queue continues normally, triggering the aggressive AT build.
-
You can monitor project progress in either of the following ways:
Queue Manager:
http://localhost:8087/ProjectQueue/managerServer-Side Events:
http://localhost:8087/ProjectQueue/api/queue/events