The API workflow block is one of Oomnitza's most powerful tool. It not only lets you make calls to external endpoints but it can also be used to make calls to Oomnitza's API, effectively functioning as an advanced extension of the Update Workflow Block.
The API Workflow Block
Like Oomnitza's other Workflow blocks, the API Workflow is triggered by the parameters that are set in the Begin block. Unlike other blocks, rather than affect a pre-set object, you can use the API block to make changes to nearly anything with a public API.
With the correct implementation, you can use do things not otherwise possible through Workflow Blocks.
The API Block works in the same way as Oomnitza's other workflow blocks. To utilize it, navigate to the workflow you wish to add it to, drag the block into the workflow sandbox, and connect it in the appropriate place.
When you've done that, you can populate the following fields:
Name: This is the name of the Block, as it appears in the Workflow sandbox. It's best to include as descriptive a name as possible, so it's clear what the block is doing.
Type: What type of call is being made. Can be Get, Post, Put, Patch, or Delete.
URL: The URL you want to make a call to.
Select a metadata field...: Lets you specify fields from the object that triggers the workflow. The above example includes the asset's Equipment ID in the URL, and the asset's Assigned To in body.
Headers: Any headers that you want to include in the call. In the above screenshot, I'm using the headers to pass along my auth token.
Params: Any parameters you want to include in the call.
Body: The body of the request.
Test Request: Tests the request. Please bote that it may fail if you're using metadata fields because they will not be filled.
Making Calls to External Services
The primary purpose of the API Block is to allow changes in Oomnitza to trigger changes in any external system that allows it.
This also allows you to use workflows much like you would webhooks, in order to effectively create a subscription to any set of changes you opt to isolate in the Begin Block.
While not obvious at first, this can greatly expand Oomnitza's reach, allowing it to not only aggregate data on all of your things but also allow those changes to dictate changes in other systems.
Using the API Block to Call Oomnitza's API
One powerful ability that the API Block offers is the ability to make calls to Oomnitza's own API. This allows savvy users to bypass a few safety valves that we put on our standard workflow blocks. using our API allows you to delete assets using a Delete call.
Creating Cascading Workflows
With the exception of scheduled begin blocks, Oomnitza workflows will not trigger other workflows. While this prevents the accidental creation of infinite loops, it prevents users from creating Cascading workflows. The API block is an exception to this rule.
By using an API block to make changes to your own Oomnitza instance, your changes will trigger subsequent workflows, allowing for cascades of changes.