User Tools

Site Tools


api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api [2026/05/18 15:07]
nightfly
api [2026/05/19 01:45] (current)
nightfly [Read-only clients apps API]
Line 317: Line 317:
  
 We hope it is clear how it works. You can also check out a sample implementation of this API at [[https://github.com/nightflyza/Ubilling/blob/master/api/libs/api.wolfrecorder.php|this link]]. We hope it is clear how it works. You can also check out a sample implementation of this API at [[https://github.com/nightflyza/Ubilling/blob/master/api/libs/api.wolfrecorder.php|this link]].
 +
 +
 +====== Read-only clients apps API ======
 +
 +Works same way, but requires only login+password or login+authtoken(md5 hash of password) instead of WolfRecorder serial.
 +
 +You can set user credentials as raw GET variables or inside keys in "data" POST array.
 +
 +<code>
 +curl -s -X POST 'https://yourhost/wr/?module=remoteapi&action=clientrest&channels=getall' --data-urlencode 'data={"login":"admin","password":"demo"}'
 +</code>
 +
 +or
 +
 +<code>
 +curl -s -X POST 'https://yourhost/wr/?module=remoteapi&action=clientrest&channels=getall&login=admin&password=demo'
 +</code>
 +
 +
 +====== Supported objects and methods list ======
 +
 +^ Object ^ Method ^ Parameters required ^ Action/Reply ^cified user |
 +| channels   | getall |  login+password or login+authtoken   | returns array of all accessible by user channels info |
 +
 +
 +====== Usage examples ======
 +
 +===== Normal request =====
 +<code>
 +curl -s -X POST 'https://yourhost/wr/?module=remoteapi&action=clientrest&channels=getall' --data-urlencode 'data={"login":"admin","password":"demo"}'
 +</code>
 +
 +<code json>
 +{
 +
 +    "error":0,
 +    "channels":[
 +        {
 +            "id":"randomchannelid01",
 +            "comment":"Just test cam",
 +            "active":0,
 +            "recording":0,
 +            "mainstream":0,
 +            "substream":0,
 +            "screenshot":"skins/chanblock.gif"
 +        },
 +        {
 +            "id":"randomchannelid02",
 +            "comment":"Another cam",
 +            "active":1,
 +            "recording":1,
 +            "mainstream":1,
 +            "substream":0,
 +            "screenshot":"howl/chanshots/randomchannelid02.jpg"
 +        }
 +    ]
 +
 +}
 +</code>
 +
 +===== Wrong credentials =====
 +
 +<code>
 +curl -s -X POST 'https://yourhost/wr/?module=remoteapi&action=clientrest&channels=getall&login=admin&password=wrongpassword'
 +</code>
 +
 +<code>
 +{
 +
 +    "error":6,
 +    "message":"Wrong credentials"
 +
 +}
 +</code>
 +
 +
 +===== Wrong request format =====
 +
 +<code>
 +curl -s -X POST 'https://yourhost/wr/?module=remoteapi&action=clientrest&channels=getall'
 +</code>
 +
 +<code>
 +{
 +
 +    "error":3,
 +    "message":"Wrong request data"
 +
 +}
 +</code>
 +
 +
  
api.1779106070.txt.gz · Last modified: 2026/05/18 15:07 by nightfly