API usage examples

    Counting the number of hls/http sessions:
    curl -s -X POST -d '{ "cmd": "sessions" }' http://login:pass@tv.server.ip:port/control/|grep client_id|wc -l


    Switching input:
    (For example , turning off the channel with erotic content in the daytime)
    curl -X POST -d '{"cmd":"set-input","id":"a006","input":2}' http://login:pass@tv.server.ip:port/control/control/

    Where:
    a006 - stream id, "input":2 - input number. The numbering of the inputs begins with one.


    Create user:
    curl -X POST -d '{ "cmd": "set-user", "id": "user6541", "user": { "enable": true, "type": 3, "password": "user6541", "conlimit": "5", , "ip": "172.31.2.6","packages": ["ALL"] }}' http://login:pass@tv.server.ip:port/control/

    Where:
    "id": "user6541" - User login. Is the user id.
    "enable": true - User is active.
    "type": 3 - User group. (1 - administrator, 2 - observer, 3 - user)
    "password": "user6541" - user password
    "conlimit": "5" - Лимит на одновременные подключения.
    "ip": "172.31.2.6" - user ip address.
    "packages": ["ALL"] - Channel package available to the user.


    Get user configuration:
    curl -X POST -d '{ "cmd": "get-user", "id": "user6541"}' http://login:pass@tv.server.ip:port/control/

    Where:
    user6541 - user login.


    Create/edit stream:

    curl -X POST -d '{"cmd": "set-stream","id": "a01h","stream": {"id":"a01h","name":"test","enable": true, "type": "spts","input": ["udp://251.34.21.5:1234], "output": ["http://0:8078/fox"] } }' http://login:pass@tv.server.ip:port/control/

    Where:
    "name":"test" - stream name
    "id": "a01h" - stream id