Hey Siri! What is my Qonto balance?
How to Automate Your Company’s Finances With Apple’s iOS Shortcuts App and Siri
Apple’s Shortcuts app can quickly and easily run a host of tasks on your Apple Watch or iOS or iPadOS device. You can run a shortcut a number of ways:
Opening the Shortcuts app and tapping a shortcut from the main screen is the most basic option.
You can also add a Shortcuts widget to your home screen to more quickly trigger the sequence,
or integrate the app into Siri’s repertoire.
In this post, I will show you how create a shortcut too fetch latest Qonto balance and how to trigger it through Siri. Easy as 123!
1. Add a new Shortcut
Go the Shortcuts app and create a new snippet.
2. Save account balance to clipboard
We use the Qonto API in order to retrieve the latest balance of your account(See Qonto API documentation here). First thing we will do is using the organization endpoint to fetch account informations including your balance in JSON format.
Add an URL action that include the Qonto API organization endpoint (e.g: http://thirdparty.qonto.eu/v2/organizations/{id}). The ID represents the slug of your organization (e.g: acme-corp-1111).
Fetch content from this URL using Network action GET that include in the header as authorization your API login and secret as follow: {login}:{secret}
Copy this content to clipboard by using the Sharing action.
3. Make it speak!
What you have in your clipboard is JSON structured information of your account. It includes your balance but we need to properly rework the JSON into a table to fetch the balance.
To split the JSON into readable text, we will add 1 attribute per line, then split attribute and value to finally fetch the right index.
Use the JSON file you just saved in your clipboard, Split it by value separator Custom “:” and repeat for attribute separators Custom “,”.
Use Scripting action to find the right value at the right index and display the amount as a text: “Your company account balance is {Clipboard amount} euros!
Let it speak with a document Action that reads the text
All Set!
Now make it work. Save you shortcut with the name “What is my Qonto balance?” and ask it to Siri: “Hey Siri! What is my Qonto balance?”, it will triggers automatically you shortcut and answer with your latest balance. 🎉