Using Tasker on Android to Run API Commands automatically

Today, I’m going to explain how to test the RICOH THETA X model using the free mobile app HTTP Request Shortcuts and the paid mobile app Tasker for $3.49. With this combination you are able to take pictures and configure camera settings in the field with a custom workflow using an Android phone or tablet where you may be putting the camera in a car with one hand and holding the phone in your other hand. Similar apps are also available for iOS.

This may be an easy way to prototype workflows specific to the industry you are working in, before doing final development on your app.

To send HTTP Requests with HTTP Request Shortcuts I followed this article Using the THETA Web API without programming (Remote photo app) and if you need further information to reference I have an article testing the RICOH THETA Web API with HTTP Requests Shortcuts here Testing RICOH THETA Web API via Android Mobile App.

Tasker is going to be used to execute a set of API commands automatically from HTTP Request Shortcuts and group them together so we can organize a set of custom API requests into one group and press one button to set them off sequentially. We can also set that group of commands from tasker into a home screen shortcut!

From the previous articles mentioned above, now I have a set of API commands setup in HTTP Requests Shortcuts.

General Sections Overview:

  • Get Deep-linking URL from HTTP Shortcuts app

  • Tasker app API Commands tutorial

  • Adding Tasker Commands to Home Screen

  • Exporting Task as Link to share with others

Here are the sections to follow and create a group of API commands to execute in Tasker:

Get Deep-linking URL from HTTP Shortcuts app

In HTTP Shortcuts app:

  1. Enter the HTTP Shortcuts app and for a couple seconds hold down your API command, I’m doing theta info.
  2. Then press “Show Info”.

  1. Copy the Deep-Linking URL

Tasker app API Commands tutorial

In the Tasker app:

  1. Enter the Tasker App and Go to the “Tasks” tab and add a new Task and name it something like “Info and State”

  1. In the Info and State Task add a new event

  1. In the bottom area of the popup where it says “Filter” type in “Browse” and the “Browse URL” option will show, press on that option.

  1. Paste the Deep-Linking URL that we copied earlier into the URL section. Optionally you can add a Label which you can think of as naming the Action and it does make it easier to view which actions or events are currently running.

Press the Back arrow once done and now we’ve successfully added our first Task to the list!

Repeat steps 1-7 above to add more API commands to this one list.

Notice:
So far in this article I know that the Tasks automatically run when you add a “Wait 2 seconds” between each execution. I still have to test if the tasks can run without any “Wait”. Also as you can see in the screenshot below “CaptureMode Image” and “take pic” are the actions I used the label option for.

  1. To Run the list of API commands press on the Run button in the bottom left of the Screen.

Adding Tasker Commands to the Home Screen

In the Android Home Screen

  1. Swipe Up and open up the Search Screen

  1. Search for “Tasker Widget

  1. Scroll down until you see the “Widgets” category and Tasker should be in the category and Press on the first Tasker Icon you see.

  1. Scroll down until you see the shortcut Tasker option and Add a Tasker Shortcut like shown

  1. Select a Task to make into a Shortcut

  1. Select an image icon by pressing the little 3x3 icon, their are many options to choose from. I chose the “Application Icon” from RICOH THETA

  1. Press the Back arrow and now you should have a shortcut on your home screen!

Exporting Task as a Link to Share with Others

In the Tasker App

  1. Go to the Tasks Tab at the top

  1. Hold down the Task you want to share

  1. Press on “Export” at the top right and Press on “As Link”

  1. Add Tags as required, and Optionally add a description, or make it Public on Taskernet where you can view other Tasker Shares

  1. Press the back arrow and your done! Here is my Tasker Share for Info and State

Bug that I noticed:
Sometimes when you run the commands the Tasker app won’t go to the next step in sequence, in this case you should relaunch the HTTP Request Shortcuts app and try again.

@erikrod1 thanks for putting this together. I had never used tasker before and found it to be a powerful tool

I made a video walkthrough of your tutorial.