Developer Guide
Rest API
REST API and the Swimlane Python Driver Library
5 min
the swimlane platform provides a rest api with numerous endpoints that allow developers to harness and extend the platform's automation and orchestration power as a developer, you can use any programming tool with an http library or capability you can also use the swimlane python driver https //swimlane python driver readthedocs io/en/stable/ documentation, which is a client library that can streamline your efforts to implement solutions in general, when authoring python scripts for swimlane, follow these guidelines when authoring scripts that will run outside of the platform, use the swimlane driver whenever possible and fall back on the unwrapped rest api when necessary tip see custom direct requests https //swimlane python driver readthedocs io/en/stable/examples/client html#custom direct requests from the swimlane python driver documentation to review the preferred method for blending these two approaches when authoring scripts that will run within swimlane, use the task api first, and then fall back on the driver and/or rest api when necessary swimlane python driver this is an example of a swimlane python driver script for connecting to swimlane and creating a new record in a specified application rest api the scripts above highlight the efficiency of scripting with swimlane python driver the examples that follow are example scripts in rest api here's a sample rest api script for connecting to swimlane and creating a new record in a specified application here is a sample script for fetching an existing record, modifying it, and persisting the changes here is the same script made more optimal by using http patch rather than http put to avoid rest api centric race conditions that can arise when two scripts are attempting to operate on the same record within the same span of time the use of patch reduces the chances of harmful, colliding alterations to the record