Mawg
Mawg

Reputation: 40145

Seeking simple coding example for Axis webcam using Vapix

I should probably ask at the official Axis developer forum, but it seems that several have tried that with no success.

Searching through Stack Overflow, I find a few references to Axis cameras and the Vapix API which is a fairly simple-looking HTTP interface - for instance this question - so hopefully someone reading this site will be able to help.

The interface looks quite straightforward, but when I execute a GET using JQuery I always end up getting 401 not authorized.

I can't find anything in the available documentation to cover authorization - do I login once, or must I supply user name & password params on each request? (I tried that & it still 401ed)

It seems that the simplest might be if someone can post a few lines of code doing something simple with an Axis (211W) webcam using the Vapix API and I can extrapolate form there.

Anyone? ...

Upvotes: 1

Views: 10236

Answers (2)

hornetbzz
hornetbzz

Reputation: 9367

You should have a look at the API VAPIX doc as it is quite exhaustive.

For example in bash, you can curl the API to get parameter values :

COMMAND="http://$IP:$PORT/axis-cgi/admin/param.cgi?action=list&group=$PARAMETER_TO_GET"
VALUE=$(curl --silent --user "$USER:$PASS" "$COMMAND" | cut -d"=" -f2)

You can also transpose this to JQuery or whatever you need.

You only may have to adapt a bit the request, for example using this url format:

http://user:password@cam_ip:cam_port/your_command

Looking at the code of the camera http server, you'll retrieve this principle in javascript as well.

Note: Path depends on your model and firmware. (/admin is deprecated)

Upvotes: 2

Tim Brown
Tim Brown

Reputation: 11

You probably need to set the user settings to allow anonymous viewer login and ptz control. On my camera (axis q6034-E) this is in the setup menu under"system options"

Upvotes: 1

Related Questions