Using API Credentials in Shortcuts
Shortcuts on iOS can do incredibly powerful things, and with a little bit of extra magic you can connect to most API’s as well. Pulling data from API’s, manipulating it, and extending your shortcuts is really powerful. However, you need to have a good way to manage the authentication tokens and secrets for those APIs.
Most Shortcuts I have seen use a Text variable and put the token in that variable. Itβs then used throughout the Shortcut. This works, but it exposes problems if you share that Shortcut. It also has issues if you use the same API in multiple Shortcuts. You are now copying that token in numerous places.
Another approach that I prefer is to create Shortcuts that do nothing but return those tokens. You can then call those Shortcuts from another Shortcut to get the token. I prefix these Shortcuts with the prefix “Secret”.
Then when I need to use an token for an API I call the Shortcut and then reference the magic variable returned from it. You can even hide the execution of that second Shortcut.
In addition to reuse, you also get other benefits from this approach. Your Secret Shortcut can have some logic. For example, I access Working Copy from Shortcuts and it does so with a local URL call, protected with a random key. That key is specific to each iOS device. So, rather than try to synchronize the keys I have the Secret shortcut return whatever key is right for the device that is running.
I do a similar thing with MailChimp’s API token that requires some encoding be applied to it.
I find this a better way to manage these secret tokens, get reuse, and make it easier to change them. π
This post is part of the Shortcuts Collection.
Tammy and I had an amazing dinner at Popol Vuh last night. Guacamole, Jicama Salad, Costilla, and Carne Asada. Everything was delicious and so flavorful! The drinks were amazing as well!
Updating firmware FTW! This time the Joule Sous Vide.
Tammyβs sisters and my brother-in-laws escaped Breakout - Operation: Casino in 45 minutes! ππͺπ Room 25!
I’ve used an Airport Express (Gen 1) with an auto-switching amp to get AirPlay audio. The Airport Express is discontinued now. Sonos Amp does what I want, but is 3 times the cost. Recommendations on better solutions?
Quiet Friday night putting together tomorrows issue of the Weekly Thing. π¨βπ»
Closed on the sale of our old house. Now done with the moving stuff. Time to get settled into the new house. π
Got a 2nd HomePod and am trying out a stereo pair. They sound incredibly good for the size.
Is there anything useful to do with 1,500+ CDs and 200+ DVDs? Going thru stuff after move and filtering. Is there an option better than garbage?
Gorgeous day for a smoking session on the Big Green Egg! First smoke at the new house! π₯
I just preordered Cal Newportβs Digital Minimalism. I was going to buy it anyway so the additional benefits he added were a bonus! π
Moving and going back to Xfinity I lose fiber performance. Upside is back on IPv6. π€·πΌββοΈ
Took my new Ratio Eight Coffee Maker and Baratza Virtuoso grinder for a first run this morning, paired with Sump Coffee beans. Itβs like an automatic Chemex, delicious brew! βοΈ Awesome surprise from my amazing and thoughtful wife. π₯°
I have no idea what Iβm doing with this 3D Printer! But itβs still fun!
Today is moving day! π¦ππ π₯³
Internet service up and running at the new house! π₯³
Moving Day
Today the movers will be showing up to move all the big things to our new house! Itβs been nearly 9 years since we last moved. It is the first time that our kids are part of the moving process, making it a completely new experience for them.
We have really loved this house and the neighborhood. Itβs been a great 9 years, without any reservations.
Tammy and I have watched a couple of episodes of Tidying Up on Netflix. Marie Kondo takes a moment in the beginning of each episode to introduce herself to the house. Itβs humorous to see the homeowners in each episode react to her meditatively sitting on the floor doing this. It seems both odd and entirely fitting to communicate with the house.
In my own way, I would like to send a message to our home for the last nine years on Morgan Ave. “Thank you. You have been a great place for our family to grow, have fun, and be happy together.”
UGears Locomotive
Over the holidays I assembled the UGears Steam Locomotive moving model. It was my second UGears project. I assembled the Chronograph a couple years ago. UGears models are very intricate and the working gears, mostly driven my rubber bands, add a fun aspect to them.
The Chronograph was 107 parts and the Locomotive is four times more at 443. I found the Chronograph directions confusing numerous times. The Locomotive was much more complex, but UGears has vastly improved their manuals.
I made one mistake with the side panels, putting them on the wrong side and reversing the text. I realized too late and didnβt want to try and disassemble it to fix it.
The Locomotive has an impressive set of gears. I havenβt had great luck getting the rubber bad βengineβ to smoothly move the gears. You use a lot of candle wax as lubricant for the wooden gears, but mine catches too much to work reliably.
The coal car has doors that rise up when you move the lever on the side.
The doors that open and even a retractable ladder are nice details.
Here is the Locomotive sitting next to the Chronograph.
Family friends joined us and we beat the Diagonal Alley room at Trapped North Loop. The room was exceptionally well done, highly recommended! π§© Room 24!