Summary: In this article, we will guide you on creating & using Ziflow tokens that can be utilized for developing integrations between Ziflow and other platforms. The insights provided here can also aid in troubleshooting any failed Ziflow flows.
Find details on how to:
Building a listener Webhook Zibot
This is how you can find out your own tokens based on the actual information sent to/from Ziflow when Triggers/Zibots take place. Please note that this is for demonstration purposes only and we recommend that you protect your data with an API key or login.
To capture information from a specific flow (e.g., intake form processing or Zibots with desired data output), utilize a Webhook Zibot to add a "listener" functionality.
Ensure that the Webhook Zibot is positioned within the flow where the processing will reach. If you encounter difficulties with a particular Zibot still failing (indicated by a red progress bar), place this Zibot before the problematic one to ensure the listener is successfully triggered.
In the example below, I’m going to get the response from the trigger “Decision made on Proof - Accepted”
Create your “listener” Webhook Zibot:
Select POST as a request type
Please copy a unique URL from https://webhook.site/ and paste it into the URL field. To ensure accuracy, utilize the "copy" option located in the top right corner of the screen. Remember to create a new URL each time as the link expires after approximately one week.
Enter
"#{$}#”
inside the body. This returns everything related to the flow (where the flow successfully makes it to green status).
After the flow is successfully run on the webhook.site, you’ll see this:
Pulling proof details using JSONata Exerciser
To experiment with tokens from this listener result, you’ll use a JSONata Exerciser try.jsonata.org:
Copy and paste everything MINUS THE FIRST AND LAST QUOTATION MARKS
After you paste everything, click on the icon screenshotted below (middle top of the page, just over Invoice), this will add line breaks to what you pasted into the exerciser.
Type the token structure into the top right of the screen, and it will narrow down the results on the lower right (don’t put a period after the last piece of the token, or you’ll get an “
unexpected
" end of expression). Example output: https://try.jsonata.org/yPRYvCjQG
Typing in “
$.proof.versions
” narrowed down to only the versions in the right window.
Typing in “
$.proof.versions[-2]
”
Additional information:
To save or share your current work in the exerciser, click on the icon below and bookmark the resulting page. Otherwise, if you navigate away from the exerciser, your current view will be lost.
When you have # on either side of a token, that means it’s referencing JSONata instead of regular JSON. JSONata gives you a lot more information and functionality because it’s referring to a more robust library.
Exerciser for JSON: jsonpath.com
Library for JSON: https://goessner.net/articles/JsonPath/index.html#e2
Library for JSONata: http://docs.jsonata.org/overview.html
Example:
JSON to try to get to previous proof:
{$.proof.version_previous_id}
JSONata to get to previous proof:
#{$.proof.versions[-2].version_id}#