API
Introduction
Most of SubC’s products ship with a fully featured API to allow for custom integration within your workflow and product suite.
What is a REST API?
A REST API is an application programming interface (API or web API) that allows for interaction with RESTful web services.
In SubC context, REST API is a method of interacting with the SubC DVR+O using the HTTP interface.
How to use it
You can use the API via a program like Postman or if you are only using GET requests, any web browser with the properly formatted command will work.
You may also make your own program to interact with the API but keep in mind that SubC support will only be provided for the API, not your application.
Usage - GET Request
The remote control is a REST API based on the HTTP protocol. You can access it by using a browser or a program like Postman.
For example, let’s say you are running the DVR + Overlay on IP 192.168.1.20 or testing on that system itself using the loopback address (127.0.0.1) on port 8088 (8088 is the default).
If you want to find out if the DVR is recording, send the request:
Expected Results:
{“IsRecording”: false} or {“IsRecording”: true}
The result is a reply showing the IsRecording status to be true or false. The shown example displays false to indicate that no recording is started.
The drive letter must be in capitals. “d:\\folder\\etc” will not work but “D:\\folder\\etc” will.
The API uses HTTP not HTTPS
The example shows the usage of a GET request/command. The next slide shows a PUT request/command.
Usage - PUT Request
The remote control is a REST API based on the HTTP protocol. PUT commands can be used with a program like Postman.
For example, let’s say you are running the DVR + Overlay on IP 192.168.1.20 or testing on that system itself using the loopback address (127.0.0.1) on port 8088 (8088 is the default).
We can send a request to tell the DVR+O to perform an action. Let’s send the command to take:
Expected Results:
Framegrab is in location requested
JSON of the path. ({"Path":"D:\\inspection\\image_002.png"})