Siri/iOS and Coda Webhooks

I have long thought it would be amazingly convenient to modify a Coda doc handsfree from my iPhone. After witnessing @Eric_Koleda use Webhook automations to modify rows in a Coda doc, I figured I would give triggering automations directly from Siri a shot. I am happy to say it works quite well! Here’s how I set it up -

1.Create or select a Coda doc and find a table you would like to modify.
2,Next, Follow the same steps as in Eric’s doc to create the Webhook:

  • Add a new automation to the doc, using the trigger Webhook invoked.
  • Click the Create API token button to get a new token.
  • Copy the Webhook URL and API token and place them somewhere you can access on your phone later

Now, let’s get the iPhone part working.

  1. Download or launch the “Shortcuts” App.
  2. Select “+” to make a new Shortcut.
  3. Name the Shortcut something you can tell Siri to invoke it - I used “Talk to Coda”
  4. Now, time to build the automation:
  • To use Siri, Select Dictate Text
  • Add a URL
  • Finally, Get contents of the URL and use the POST request with the Header Key and Value and make the Request Body the Dictated Text from Siri. My initial one looked like this:

Now, back to Coda.

  1. Go back to your automation and Add Step 3
  2. I choose to add a row to a table and Set the new value with the below formula to bring in the dictated text like this -
    Screen Shot 2022-06-18 at 7.48.21 PM

When you want to want to trigger it on the iPhone, simply trigger Siri and say your Shortcut phrase (ie “talk to Coda” or whatever you named it)

It does look like this Webhook workflow will work for everything from bringing in song details with Shazam, or importing Apple Notes or Reminders, and of course, modifying Coda docs from your car. I also look forward with triggering it in different ways - when I leave a location, when I turn on DND, when I take a picture etc.

I am playing around with all kinds of things but would love to see what Shortcuts this Community creates!

Cheers!

20 Likes

Amazing work @Thomas_Baucom! This opens up so many interesting possibilities.

2 Likes

I am receiving an unauthorized message,
I have the shortcuts, get contents of URL header set to the api token generated from step 2

Edit: I was able to fix this issue, but I am now stuck on the automation rule. I will play around a bit more with this, let me know if you have any tips.
“{“statusMessage”:“Unprocessable Entity”,“statusCode”:422,“message”:“Rule is off.”}”

This just means that the automation needs to be toggled on in the UI.

image

1 Like

It is working! First time playing with Automations. I am excited to keep learning
Thank you!

1 Like

I am also getting the Unauthorized message, how did you solved it?

@Thomas_Baucom I noticed my data symbol is not text like yours, it’s a square:
image

Also, why did you jump from Step 1 to Step 3 on the automation? What goes to Step 2? I think I am doing something wrong.

I was having some issues as well, but realized for the Header, your key should be Authorization and the Value should be Bearer [token] so it should look something like Bearer asd78a8-7828-7878-asd78asd7aqs787878

The reason Step 2 is skipped is because it’s optional. You can have an in-between step that can verify the data either true or false in order to continue the automation. But in this case, we run every request to be true and fully run, so we don’t need step 2.

And don’t worry about the different looking icon, I think Coda has just updated it.

Micah Answered your question below. Here is a screencap as well.

@Micah_Lucero @Joshua_Schoenecker Thanks! It worked! I am so happy! :grin:

2 Likes

And the reason I have my Key set to Voice is because I have another shortcut that starts with the ‘Ask For Input’ action and I use the same method shown here, but the key is set to text.

I am also using another formula that that splits out each word from the value given to coda from the shortcut, as to identify a context or project mentioned to help sort my action items. when utilizing this formula though it is pulling the key from the post request which is interesting. You can see this in the screenshot.

Hey Joshua! Goot to know! Also, I tried to use Ask For Input too, but I noticed that If I don’t say anything, Siri enters in a crazy loop. Do you have this problem too?

Another thing, I believe you could automate some columns from Shortcut side, for example, you could identify and format a date inside a text and give it as another output Key to send it to Coda as a date information for a date column.

I did encounter this loop issue as well, maybe there is a way to handle this, but I am not proficient with apples shortcuts. My solution was to create a separate shortcut for this.

  1. Duplicate the siri one created from this thread. (without any extra actions like ask for input)
  2. remove the dictation action and replace with ask for input
  3. after the ask for input, add the set variable action with a variable name and the value should be set to provided input
  4. set the get contents of url request body value to the variable you created
1 Like