Using the THETA Web API without programming (Remote photo app)

This might help those who don’t program. I have a Ricoh Theta SC, but it should work with other models. This method may enable you to interact with your camera, and with other Apps such as Tasker and IFTTT. You can also create shortcut icons on your Android desktop. This example shows how to make a shortcut to remotely take a picture.

You can use the THETA Web API without programming. The “Info” protocol (I would have called it a command), can be accessed using your Browser because it uses the GET method,

  1. Connect your Theta via Wifi to your Smartphone
  2. Into your Browser, enter the Theta server address and GET command:
    http://192.168.1.1/osc/info
  3. If everything works correctly, your Browser screen will show information supplied by your Theta camera.

Unfortunately, other Theta Web API commands use the POST method and JSON, which can not be formatted correctly using your Browser. You could use Javascript, but not if you don’t want to program.

The solution is to use an App that can send POST JSON to the Theta Web server, and ideally save such snippets. I can recommend “HTTP Request Shortcuts” (unfortunately there is no iOS version, but there may be similar Apps).

GET Info request shortcut

Once the App is installed, here is how you can replicate the GET Info request.

  1. Run HTTP Shortcuts
  2. Click the blue (+) in the bottom right corner of the screen to start to Create New Shortcut.
  3. Click Regular Shortcut
  4. Enter a Shortcut Name, eg. Theta Info. Optionally enter a description.
  5. Click Basic Request Settings, and set:
    Method to: GET
    URL to: http://192.168.1.1/osc/info
    Click ← (top left) to return
  6. Click Post Request Actions, and set Response Type to: Response in Window, and click ← to return
  7. Click ✓ (top right) to confirm.

As long as you are connected to your camera via WiFi, you can test your shortcut by tapping its name, and receive a block of information from your camera.

Click an hold the shortcut name for other options, such as creating an Android desktop shortcut, or to edit it.

Post State request shortcut

You can find out the Theta API State of your camera using the State command, which must be a POST request. This is where the App solves the shortcoming of your Browser:

  1. Click the blue (+) in the bottom right corner of the screen to start to Create New Shortcut.
  2. Click Regular Shortcut
  3. Enter a Shortcut Name, eg. Theta State. Optionally enter a description.
  4. Click Basic Request Settings, and set:
    Method to: POST
    URL to: http://192.168.1.1/osc/state
    Click ← (top left) to return
  5. Click Post Request Actions, and set Response Type to: Response in Window, and click ← to return
  6. Click ✓ (top right) to confirm.

There are no parameters required, so when you try this, you will see some basic state information.

Post Session shortcut

If you read the Theta API Getting Started guide, you will find that when your camera is switched on, it is configured for API version 2.0, but you ideally want to select API version 2.1 for most flexibility. To do this is a two-step process (1) First you have to start a session, and then (2) you set the API version.

  1. Click the blue (+) in the bottom right corner of the screen to start to Create New Shortcut.
  2. Click Regular Shortcut
  3. Enter a Shortcut Name, eg. Theta Session setup. Optionally enter a description.
  4. Click Basic Request Settings, and set:
    Method to: POST
    URL to: http://192.168.1.1/osc/commands/execute
    Click ← (top left) to return
  5. Click Request Body/Parameters and set:
    Request Body Type to: Custom Text
    Content Type to: text/json
    Request Body to:
{
    "name": "camera.startSession",
    "parameters": {}
}
  1. Click Post Request Actions, and set Response Type to: Response in Window, and click ← to return
  2. Click ✓ (top right) to confirm.

The camera will respond that the command had “done”, and provide a session ID

Post API set version shortcut

Similar to the above, but create a new shortcut with the setOptions command set as follows:

{
    "name": "camera.setOptions",
    "parameters": {
        "sessionId": "SID_0001",
        "options": {
            "clientVersion": 2
        }
    }
}

Note that the Session IDs match. No we can do something useful.

Post API Take Picture shortcut
Create a new shortcut similar to the above, but with the camera.takePicture command as follows:

{
    "name": "camera.takePicture",
    "parameters": {}
}

Now just press the three shortcuts to setup the camera, and then click the Take Photo shortcut to take a photo. Click the Take Photo shortcut again, and if the camera is read, it will take another photo.

##ends##

1 Like

Hey, this is great. Thanks for sharing this tip.

This might also be quite useful for people that want to reset all their settings on the camera. I think that sometimes the settings might be saved in a weird state that causes problems.