.. _SystemIntegration_HandlingWebcam: ###### Webcam ###### Take an image snapshot ********************** Returns an image as a result of a snapshot taken by the webcam in the desired image format and with a specified resolution and compression factor. **URL parameters** * **hostIp**: ip address of the API host. * **deviceId**: id of the device. * **format**: image file format. possible values: - 0 = jpeg * **resolution**: resolution of image. possible values: - 0 = r1024x768 - 1 = r640x480 - 2 = r384x288 * **compression_factor** (optional): range = [50,95], default compression 70 is used on linux devices .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/webcam/snapshot?format={format}&resolution={resolution}&compression_factor={compression_factor} **Example request**: .. sourcecode:: http GET /hal/devices/webcam1/webcam/snapshot?format={format}&resolution={resolution}&compression_factor={compression_factor} HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 "Base64 string of binary image" :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) .. note:: Note that 70 is the preferred value for the **compression_factor** (best quality vs size ratio). .. attention:: The **compression_factor** parameter is NOT SUPPORTED if the halapi is hosted on a Windows machine.