RICOH THETA API Update to 2.1
There is a new THETA API version 2.1. The version 2.0 API still works for now, but it is recommended that you update your apps to ensure future compatibility.
App developers: Be aware these changes may affect your previously-published app in the future and it is your responsibility to make corresponding changes to either handle both versions or remind camera owners to update their firmware.
If you want to compare the different documentation versions, you can toggle between the two different versions using the green rectangle on the main API reference page.
In your program, you can set the API version with camera.setOptions
.
{
"name": "camera.setOptions",
"parameters": {
"sessionId": "SID_0001",
"options": {
"clientVersion": 2
}
}
}
One of the major changes is that you do not have to specify the sessionId
for command execution.
version 2.0
{
"name": "camera.takePicture",
"parameters": {
"sessionId": "SID_0001"
}
}
version 2.1
{
"name": "camera.takePicture",
"parameters": {
}
}
The _listAll
command of version 2.0 has been replaced with listFiles
Example (version 2.1)
{
"name": "camera.listFiles",
"parameters": {
"fileType": "all",
"entryCount": 3,
"maxThumbSize": 640
}
}
This means that that there are now four API versions in current use for the THETA, 3 for the THETA S and one for the THETA m15.
For the THETA S, the three APIs are:
- API v2.0
- API v2.1 - which is often referred to as API v2 reference (there doesn’t appear to be a clear difference between v2.0 and v2.1 in some of the reference documentation)
- v2 USB API - this is based off of the MTP 1.1 specification not the OSC specification
You should use the API v2.1 (the WiFi) one for your applications. There is no reason to use v2.0. v2 USB API can be used if you application works better with a USB connection, which is probably only the case for an application with specialized hardware like a Raspberry Pi Zero controller.
THETA API v2.1 is compliant with Open Spherical Camera (OSC) API level 2. Here are the differences between OSC API level 1 and OSC API level 2
API level 2 key changes
- Deprecated sessionId and deprecated/modified related commands. API level 2 is designed for one client connection and camera manufacturer should make sure that only one client at any time is connected (for example via limiting only one wifi connection).
- Deprecated commands startSession / updateSession / closeSession.
- Deprecated sessionId from input of commands takePicture / getOptions / setOptions.
- Deprecated commands getImage / getMetadata.
- The absolute URL of a file is used to download directly from the HTTP server of the camera.
- Added/modified commands and options for video capture, interval image capture and live preview.
- Added commands startCapture / stopCapture / getLivePreview / reset.
- Renamed listImages to listFiles and modified inputs/outputs to handle video type as well as image type.
- Added options previewFormat, captureInterval, captureNumber, remainingVideoSeconds, clientVersion.
- Added 360 video XMP specification
- Added apiLevel field to /osc/info output.
- apiLevel: Field was added in API level 2. It is considered to be API level 1 by default when this field is missing. It is developers’ responsibility to retrieve this information and implement differently based on the value.
Result of GET to http://192.168.1.1/osc/info
Result of POST to 192.168.1.1/osc/state