API Documentation


CamStreamer App, CamOverlay App & CamScripter App functionality can be controlled using API once the application is installed and licensed. To continue please choose the right application.



The CamScripter App is an application running inside the camera on an Axis Camera Application Platform (ACAP) and can automate all CamStreamer applications. CamScripter App functionality can be controlled using API once the application is installed and licensed.


Package format of micro-app for CamScripter App

CamScripter package is a .zip file which contains all manifest, node.js scripts, static files for UI (images, frontend js, css,...).


File manifest.json

The manifest.json is required in each package. The file contains a json object with the following attributes:

package_name,
package_menu_name,
package_version,
vendor,
required_camscripter_version,
ui_link is link to UI (optional)


Main script

The main.js is required in each package. This is the node.js script which is started once the package starts.


Environment variables

HTTP_PORT see chapter HTTP Proxy
HTTP_PORT_PUBLIC proxy without authorization. See chapter HTTP Proxy
INSTALL_PATH
PERSISTENT_DATA_PATH folder which is suitable for permanent data. All data survive restart of the camera or package upgrade
PACKAGE_NAME


Libs

All required js libraries should be part of the package.


Package configuration

The PackageConfigurations parameter is used to enable or disable packages. Value is in JSON format.

Example:

  {"package_name":{"enabled": true}}

Install package

Basic cURL usage:

curl --user USER:PASS -F file=PACKAGE_NAME http://IPADDR[:PORT]/local/camscripter/package/install.cgi

where

USER is an user name. E.g. root
PASS is a password . E.g. pass
IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package on your computer. E.g. clock.zip

Example:

    curl --user root:pass -F file=@clock.zip http://127.0.0.1:52520/local/camscripter/package/install.cgi

Remove package

http://IPADDR[:PORT]/local/camscripter/package/remove.cgi?package_name=PACKAGE_NAME

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package that you want to remove. E.g. clock

Example:

    http://127.0.0.1:52520/local/camscripter/package/remove.cgi?package_name=clock


List all installed packages

http://IPADDR[:PORT]/local/camscripter/package/list.cgi

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5

Response example of list action in JSON format.

Example:
    [{
        "package_name": "clock",
        "package_menu_name": "Clock",
        "package_version": "1.0.0",
        "vendor": "Camstreamer s.r.o.",
        "required_camscripter_version": "1.0.0",
        "ui_link": "/local/camscripter/package/clock/index.html"
    }]
            

Set or get settings for application

This is usually used from package UI. Settings should be in JSON format. JSON is stored in /package_name/localData/settings.json and is preserved while the package upgrades. SIGINT signal is sent to package if new settings are made.

http://IPADDR[:PORT]/local/camscripter/package/settings.cgi?package_name=PACKAGE_NAME&action=ACTION

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package that you want to remove. E.g. clock
ACTION can be values set and get


HTTP Proxy

Use the HTTP proxy if the package needs an API. CamScripter App forwards any HTTP(S) request coming to the default HTTP server on the camera as http://IPADDR[:PORT]/local/camscripter/proxy/PACKAGE_NAME/* to http://127.0.0.1:[PORT]/* The PORT is a unique number defined as an environment variable. The default HTTP server on the camera requires HTTP authorization (basic or digest).


Redirected to package http port.

http://IPADDR[:PORT]/proxy/PACKAGE_NAME/*

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package that you want to remove. E.g. clock

Example:

    http://127.0.0.1:52520/proxy/clock/test.cgi



Redirected to package http public port.

http://IPADDR[:PORT]/proxy_public/PACKAGE_NAME/*

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package that you want to remove. E.g. clock

Example:

    http://127.0.0.1:52520/proxy_public/clock/test.cgi



Access to path /package_name/html/

http://IPADDR[:PORT]/package/PACKAGE_NAME/*

where

IPADDR[:PORT] is an IP address:port of the camera. E.g. 192.168.1.5
PACKAGE_NAME is name of package that you want to remove. E.g. clock

Example:

    http://127.0.0.1:52520/package/clock/index.html



Feel free to contact our support in case of any problem.