Apiguide

Video

Retrieving Video from the enVision K150S

The /video endpoint provides a mechanism for creating videos to attach to transactions and retrieving the locally saved video.

This endpoint requires the device to be in either Video Only Mode or Video With Measurement Mode. Otherwise all requests will return unauthorized. This can be changed on the Configuration Page
The IP address of the device is required to call this endpoint. Check the Integration Guide for details on determining the device IP address.

The response to a call to the /video endpoint is a video stream from the device of current locally saved video. If there is no video then a Not Found error is returned.

Start Video

Request the device to begin color video recording. This can be accessed with the following endpoint

/api/v1/video/start
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video/start" \
-X POST
Example Response
HTTP/1.1 200 OK
Content-Length: 0
Date: Fri, 16 May 2025 18:34:52 GMT
Server: Kestrel
api-supported-versions: 1.0

Request Parameters

The start video request has multiple optional query strings to help pass custom values and reference transactions. All parameters are optional.

Note that these parameters are only effective in Video Only mode as they will be overwritten otherwise during a measurement.

Queries

PropertyData TypeDescription
TransactionReferencestringa host-supplied transaction reference for tracking purposes. This can be any value you wish to supply as something that will be tracked with the video operation in enVision Cloud and returned in the response. Possible values are an Order ID, Tracking Number or Barcoded identifier.
CustomReference1stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.
CustomReference2stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.
CustomReference3stringa custom host-supplied reference. This value will be tagged to the transaction stored in enVision Cloud.

Example Query Request

An example request to measure with the query parameters

Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video/start?transactionReference=ABCD123&customReference1=XYZ123&customReference2=XYZ123&customReference3=XYZ123" \
-X POST

Stop Video

Requests the video to stop and encode. This endpoint will only work in Video Only mode. To trigger a stop in Video with Measurement mode trigger a measurement. When the video is stopped it will be saved as a transaction to enVision Cloud using the queries called using the Start Video command. The stop endpoint can be accessed at the following location.

/api/v1/video/stop
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video/stop" \
-X POST
Example Response
HTTP/1.1 200 OK
Content-Length: 0
Date: Fri, 16 May 2025 18:34:52 GMT
Server: Kestrel
api-supported-versions: 1.0

Cancel Video

Requests the video to stop and clear all saved video data in memory and local storage on the enVision K150S device. This can be accessed at the following endpoint

/api/v1/video/cancel
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video/cancel" \
-X POST
Example Response
HTTP/1.1 200 OK
Content-Length: 0
Date: Fri, 16 May 2025 18:34:52 GMT
Server: Kestrel
api-supported-versions: 1.0

Stream Video

Requests for the video saved locally on the enVision K150S device and streams it instead of downloading all the data at once. This will return a video stream or the HTTP Partial Content (206) Status Code.

The video will be accessible after a Stop and Encode Command in Video Only mode or after a failed transaction in Video Measurement mode. Otherwise there will be no accessible video

This can be accessed at the following endpoints

/api/v1/video
/api/v1/video/stream
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video" \
-X GET \
--output "output_video.mp4"

Download Video

Requests for the video saved locally on the enVision K150S device and downloads all the video data. This will return a video download or the HTTP OK (200) Status Code.

The video will be accessible after a Stop and Encode Command in Video Only mode or after a failed transaction in Video Measurement mode. Otherwise there will be no accessible video

This can be accessed at the following endpoint

/api/v1/video/download
Request
curl -i "http://<YOUR_DEVICE_ADDRESS>/api/v1/video/download" \
-X GET \
--output "output_video.mp4"

Copyright © PHD Solutions 2024