API Endpoints in Skylar Automation

Download this manual as a PDF file 

Skylar Automation (formerly PowerFlow) includes an API that is available after you install the Skylar Automation system.

Interacting with the API

To view the full documentation for the Skylar Automation API:

  1. From the Skylar Automation system , copy the /opt/iservices/scripts/swagger.yml file to your local computer.
  2. Open a browser session and go to editor.swagger.io.
  3. In the Swagger Editor, open the File menu, select Import File, and import the file swagger.yml. The right pane in the Swagger Editor displays the API documentation.

You can also access the full documentation for the Skylar Automation API by going to the endpoint /api/v1/docs. The documentation can be downloaded if needed by going to /api/v1/swagger?download=true.

You can also access the full documentation for the Skylar Automation API in the Skylar Automation user interface:

  1. Click on your username in the top right corner of Skylar Automation.

  2. Select About from the drop-down menu.

  3. Click API Documentation. This will open a new tab with the full Skylar Automation API documentation.

Available Endpoints

POST

/api/v1/apikeys/. Add a new API key.

/api/v1/applications. Add a new application or overwrite an existing application.

/api/v1/applications/{appName}/run. Run a single application by name with saved or provided configurations.

/api/v1/applications/run. Run a single application by name. 

/api/v1/configurations. Add a new configuration or overwrite an existing configuration.

/api/v1/roles/owner. Add a new owner assigned a specific role.

/api/v1/schedule. Add a new scheduled Skylar Automation application.

/api/v1/status. Runs the "Skylar Automation Control Tower HealthCheck" application to generate health status data.

/api/v1/steps. Add a new step or overwrite an existing step.

/api/v1/steps/run. Run a single step by name.

/api/v1/syncpacks/{syncpackName}/install. Install a specific SyncPack version by name.

/api/v1/tasks/{taskId}/replay. Replay a specific Skylar Automation application. Replayed applications run with the same application variables, configuration, and queue as the originally executed application.

/api/v1/tasks/{taskId}/revoke. Terminate a specific task or application. By default, this command will not terminate the current running task.

/api/v1/tasks/{appId}/revoke. Terminate all tasks associated with a specific application.

/api/v1/me/widgets/{widget_id}. Creates a new widget or updates a existing widget used on the Skylar Automation Control Tower page.

Querying for the State of a Skylar Automation Application

When triggering a Skylar Automation application from the applications/run endpoint, you can query for the state of that application in two ways:

  1. Asynchronously. When you POST a run of a Skylar Automation application to /applications/run, the response is an integration status with a Task ID, such as: isap-23233-df2f24-etc. At any time, you can query for the current state of that task from the endpoint /api/v1/tasks/isap-23233-df2f24-etc. The response includes all of the steps run by the application, along with the status of the steps, and URL links to additional info, such as logs for each step.
  2. Synchronously. When you POST a run of an application, you can tell Skylar Automation to wait responding until the application is complete by adding the wait argument. For example, /api/v1/applications/run?wait=20 will wait for 20 seconds before responding. The maximum wait time is 30 seconds. When the application completes, or 30 seconds has passed, the API returns the current status of the integration run. This process works the same as if you had manually queried /api/v1/tasks/isapp-w2ef2f2f. Please note that while the API is waiting for your application to complete, you are holding on to a thread. If you have multiple applications that run for a long period of time, do not use a synchronous query unless you have no other option. ScienceLogic recommends using an asynchronous query whenever possible.

GET

/api/v1/about. Retrieve version information about the packages used by this Skylar Automation system, including the version of Skylar Automation.

/api/v1/apikeys. Retrieve all available API keys saved in the Skylar Automation system.

/api/v1/apikeys/{api_key}. Get details of a single API key.

/api/v1/applications. Retrieve a list of all available applications on this Skylar Automation system.

/api/v1/applications/{appName}. Retrieve a specific application.

/api/v1/applications/{appName}/logs. Retrieve the logs for the specified application.

/api/v1/cache/{cache_id}. Retrieve a specific cache to gather information about the user interface and the Skylar Automation applications.

/api/v1/cache/{cache_key}. Retrieve cache documents, but only if this cache document was explicitly saved to be exposed to the API. You will need to save the cache document using the latest version of the "SaveToCache" step in the Base Steps SyncPack. This step has a step parameter called "read_from_api" that lets you decide whether the cache document can be requested from the API.

/api/v1/configurations. Retrieve a list of all configurations on this Skylar Automation system.

/api/v1/configurations/{configName}. Retrieve a specific configuration.

/api/v1/license?type=platform. Retrieve license data for this Skylar Automation system.

/api/v1/reports. Retrieve a list of paginated reports.

/api/v1/reports/{reportId}. Retrieve a specific report by ID.

/api/v1/roles. Retrieve a list of available roles on this Skylar Automation system.

/api/v1/roles/owner. Retrieve a list of roles assigned to owners on this Skylar Automation system.

/api/v1/roles/owner/{owner}. Retrieve the role assigned to a specific owner.

/api/v1/sessions. Retrieve a list of sessions for this Skylar Automation system.

/api/v1/sessions/status. Retrieve the Session Management status for this Skylar Automation system.

/api/v1/sessions/username/{username}. Retrieve the session IDs for a specific user.

/api/v1/sessions/{session_id}. Retrieve a specific session from Session Management for this Skylar Automation system.

/api/v1/schedule. Retrieve a list of all scheduled applications on this Skylar Automation system.

/api/v1/status. Retrieve all the health status cache documents without running the "Skylar Automation Control Tower HealthCheck" application.

/api/v1/status?all=true. Retrieve all health metrics for Skylar Automation services and merge all the health status cache documents to return only one JSON response.

/api/v1/status/{service}. Retrieve all health metrics for a specific Skylar Automation service, including the following services: contentapi, couchbase, dexserver, iservices_syncpack_steprunner, iservices_syncpacks_steprunner, skyautocontrol_output, rabbitmq, redis, steprunner. Starting with PowerFlow version 2.6.0, you can run a GET api/v1/status operation that returns all the health status cache documents without running the HealthCheck application.

/api/v1/steps. Retrieve a list of all steps on this Skylar Automation system.

/api/v1/steps/{stepName}. Retrieve a specific step.

/api/v1/docs/. Swagger user interface to display Skylar Automation API documentation

/api/v1/swagger. Swagger file in JSON format that is consumed by the Swagger UI

/api/v1/swagger?download=true. Swagger in .yml format to download it as a file

/api/v1/swagger?download=true&force_reload=true. Force reload the Swagger file in .yml format to download. If this is not used, the file is cached.

/api/v1/syncpacks. Retrieve a list of all SyncPacks on this Skylar Automation system.

/api/v1/syncpacks/{synpackName}. Retrieve the full details about a specific SyncPack.

/api/v1/syncpacks?only_installed=true. Retrieve a list of only the installed SyncPacks on this system.

/api/v1/syncpacks?only_activated=true. Retrieve a list of only the activated SyncPacks on this system.

/api/v1/tasks/{taskId}. Retrieve a specific task.

/api/v1/webhooks. Retrieve all available webhooks saved in the Skylar Automation system.

/api/v1/me/widgets. Returns a list of all installed widgets used on the Skylar Automation Control Tower page.

/api/v1/me/widgets/{widget_id}. Returns a specific widget using the specified widget ID.

DELETE

/api/v1/apikeys/{api_key}. Delete an API key.

/api/v1/applications/{appName}. Delete a Skylar Automation application by name.

/api/v1/cache/{cache_id}. Delete a cache entry by name.

/api/v1/configurations/{configName}. Delete a configuration by name.

/api/v1/license?type=platform. Delete license data for this Skylar Automation system.

/api/v1/me/widgets/{widget_id}. Delete the specified widget used on the Skylar Automation Control Tower page.

/api/v1/roles/owner. Delete a specific owner role.

/api/v1/schedule. Delete a scheduled Skylar Automation application by ID.

/api/v1/sessions. Delete a list of sessions for this Skylar Automation system.

/api/v1/sessions?all=true. Delete all sessions for this Skylar Automation system.

/api/v1/sessions/status. Delete the Session Management status for this Skylar Automation system.

/api/v1/sessions/username/{username}. Delete the session IDs for a specific user.

/api/v1/sessions/{session_id}. Delete a specific session from Session Management for this Skylar Automation system.

/api/v1/reports/{appName}. Delete a specific report by name.

/api/v1/reports/{reportId}. Delete a specific report by report ID.

/api/v1/steps/{stepName}. Delete a specific step by name.

/api/v1/syncpacks/{spName}. Delete a specific SyncPack by name.