Skip to main content

Node.js HTTP API Example

Use the upstream Node.js example when an integration needs to send PTZOptics HTTP API commands from Node.js and handle the camera's digest-authentication challenge.

  • Protocol: HTTP API
  • Language: Node.js
  • Task: Connect to a camera, create a digest authorization response, and send configured movement commands
  • Upstream source: example-http.js
  • License: MIT

Prerequisites​

Update the camera host and credentials in the upstream example before running it. The example uses Node.js built-in http and crypto modules to respond to the camera's digest challenge. Keep camera credentials out of source control.

Use HTTP API getting started to understand the CGI paths and request conventions. Use the complete Node.js example for the implementation.

Ask PTZOptics AI

Ask a question about PTZOptics products or documentation.