Forum Software 3rd Party Software API discovery and documentationn

This topic contains 5 replies, has 3 voices, and was last updated by  rhatguy 3 weeks, 6 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #202339

    rhatguy
    Participant

    Greetings. Given my disgust with Reolink not providing any API documentation I started trying to uncover some things myself. I found the following link which mentions a few examples of how to query for a list of recordings from the API.
    /wp-content/uploads/2017/01/Reolink-CGI-command-v1.61.pdf

    I was able to use the instructions to successfully query my RLC-410-5MP for its list of recordings using the google advanced rest client. I was able to query the exact name of each file as shown in the document.

    Next I started a wireshark packet capture and performed a web login using firefox to one of my cameras. Wireshark was able to capture a number of calls to the api.cgi file that are able to query a good amount of information. The commands I’ve been able to document so far all follow the standard shown below and require being sent as a POST header as shown in the documentation.
    http://xx.xx.xx.xx/cgi-bin/api.cgi?cmd=GetAbility&rs=test&user=username&password=password

    Snap
    Search
    GetAbility
    GetIrLights
    GetDevInfo
    GetLocalLink
    GetOsd
    GetEnc
    GetImage
    GetIsp

    A few of these commands require you to also include some additional parameters in the body of the POST request usually to specify the channel to query. GetOsd is one such example.
    [{
    “cmd”:”GetOsd”,
    “action”:0,
    “param”:{
    “channel”: 0
    }
    }]

    You can peck around by changing the URL. I’ve tried various things like cmd=Status and things like that, but so far have come up blank. You’ll know if you find something that works because the response will be something different than “cmd” : “Unknown”. My purpose behind this is to find how to query to determine if the camera has recently detected motion so I can integrate that into HomeAssistant.

    Reolink’s lack of documentation around the API is ridiculous in this day and age. The fact that a customer who has purchased multiple cameras is having to result to packet sniffing across a network is not good. Hopefully this thread can become the start of a community based documentation that Reolink doesn’t seem to be willing to provide.

    #202357

    rhatguy
    Participant

    Another interesting query:

    http://xx.xx.xx.xx/cgi-bin/api.cgi?cmd=GetAlarm&rs=test&user=user&password=password

    POST Body:
    [{
    “cmd”:”GetAlarm”,
    “action”:1,
    “param”:{
    “Alarm”:{
    “channel”: 0,
    “type”: “md”
    }
    }
    }]

    Output: (notice the interesting ASCII art of my actual motion detection mask)

    [
    {
    “cmd” : “GetAlarm”,
    “code” : 0,
    “initial” : {
    “Alarm” : {
    “action” : {
    “mail” : 1,
    “push” : 1,
    “recChannel” : [ 0 ]
    },
    “channel” : 0,
    “enable” : 1,
    “schedule” : {
    “table” : “111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111”
    },
    “scope” : {
    “cols” : 80,
    “rows” : 60,
    “table” : “111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111”
    },
    “sens” : [
    {
    “beginHour” : 0,
    “beginMin” : 0,
    “endHour” : 6,
    “endMin” : 0,
    “sensitivity” : 10
    },
    {
    “beginHour” : 6,
    “beginMin” : 0,
    “endHour” : 12,
    “endMin” : 0,
    “sensitivity” : 10
    },
    {
    “beginHour” : 12,
    “beginMin” : 0,
    “endHour” : 18,
    “endMin” : 0,
    “sensitivity” : 10
    },
    {
    “beginHour” : 18,
    “beginMin” : 0,
    “endHour” : 23,
    “endMin” : 59,
    “sensitivity” : 10
    }
    ],
    “type” : “md”
    }
    },
    “range” : {
    “Alarm” : {
    “action” : {
    “mail” : “boolean”,
    “push” : “boolean”,
    “recChannel” : [ 0 ]
    },
    “channel” : 0,
    “enable” : “boolean”,
    “schedule” : {
    “table” : {
    “maxLen” : 168,
    “minLen” : 168
    }
    },
    “scope” : {
    “cols” : {
    “max” : 80,
    “min” : 80
    },
    “rows” : {
    “max” : 60,
    “min” : 60
    },
    “table” : {
    “maxLen” : 6399
    }
    },
    “sens” : [
    {
    “beginHour” : {
    “max” : 23,
    “min” : 0
    },
    “beginMin” : {
    “max” : 59,
    “min” : 0
    },
    “endHour” : {
    “max” : 23,
    “min” : 0
    },
    “endMin” : {
    “max” : 59,
    “min” : 0
    },
    “id” : 0,
    “sensitivity” : {
    “max” : 50,
    “min” : 1
    }
    },
    {
    “beginHour” : {
    “max” : 23,
    “min” : 0
    },
    “beginMin” : {
    “max” : 59,
    “min” : 0
    },
    “endHour” : {
    “max” : 23,
    “min” : 0
    },
    “endMin” : {
    “max” : 59,
    “min” : 0
    },
    “id” : 1,
    “sensitivity” : {
    “max” : 50,
    “min” : 1
    }
    },
    {
    “beginHour” : {
    “max” : 23,
    “min” : 0
    },
    “beginMin” : {
    “max” : 59,
    “min” : 0
    },
    “endHour” : {
    “max” : 23,
    “min” : 0
    },
    “endMin” : {
    “max” : 59,
    “min” : 0
    },
    “id” : 2,
    “sensitivity” : {
    “max” : 50,
    “min” : 1
    }
    },
    {
    “beginHour” : {
    “max” : 23,
    “min” : 0
    },
    “beginMin” : {
    “max” : 59,
    “min” : 0
    },
    “endHour” : {
    “max” : 23,
    “min” : 0
    },
    “endMin” : {
    “max” : 59,
    “min” : 0
    },
    “id” : 3,
    “sensitivity” : {
    “max” : 50,
    “min” : 1
    }
    }
    ],
    “type” : “md”
    }
    },
    “value” : {
    “Alarm” : {
    “action” : {
    “mail” : 1,
    “push” : 1,
    “recChannel” : [ 0 ]
    },
    “channel” : 0,
    “enable” : 1,
    “schedule” : {
    “table” : “111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111”
    },
    “scope” : {
    “cols” : 80,
    “rows” : 60,
    “table” : “000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111100000000000000000000000000000000000000000000000000000111111111111111111111111111111111111000000000000000000000000000000000000000011111111111111111111111111111111111111111111100000000000000000000000000000011111111111111111111111111111111111111111111111111111100000000000000000000000011111111111111111111111111111111111111111111111111111111110000000000000000001111111111111111111111111111111111111111111111111111111111111111000000000011111111111111111111111111111111111111111111111111111111111111111111111111000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111”
    },
    “sens” : [
    {
    “beginHour” : 0,
    “beginMin” : 0,
    “endHour” : 6,
    “endMin” : 0,
    “id” : 0,
    “sensitivity” : 25
    },
    {
    “beginHour” : 6,
    “beginMin” : 0,
    “endHour” : 12,
    “endMin” : 0,
    “id” : 1,
    “sensitivity” : 25
    },
    {
    “beginHour” : 12,
    “beginMin” : 0,
    “endHour” : 18,
    “endMin” : 0,
    “id” : 2,
    “sensitivity” : 25
    },
    {
    “beginHour” : 18,
    “beginMin” : 0,
    “endHour” : 23,
    “endMin” : 59,
    “id” : 3,
    “sensitivity” : 25
    }
    ],
    “type” : “md”
    }
    }
    }
    ]

    #202388

    rhatguy
    Participant

    Another example for those of you needing to reboot your cameras remotely. A simple call to the url below will initiate an immediate reboot assuming the webserver on the camera is still working. Also, it doesn’t appear to matter what url you actually call, as in my example below I called foobar.cgi and was able to issue an API call to get the performance counters (CPU and codec rate). You can even call these by just pasting the URL into your browser or calling with CURL or wget as they don’t take any input…easy!

    http://xx.xx.xx.xx/cgi-bin/api.cgi?cmd=Reboot&rs=test&user=user&password=password
    http://xx.xx.xx.xx/foobar.cgi?cmd=GetPerformance&rs=test&user=user&password=password

    #202504

    Carl
    Keymaster

    Another example for those of you needing to reboot your cameras remotely. A simple call to the url below will initiate an immediate reboot assuming the webserver on the camera is still working. Also, it doesn’t appear to matter what url you actually call, as in my example below I called foobar.cgi and was able to issue an API call to get the performance counters (CPU and codec rate). You can even call these by just pasting the URL into your browser or calling with CURL or wget as they don’t take any input…easy!

    http://xx.xx.xx.xx/cgi-bin/api.cgi?cmd=Reboot&rs=test&user=user&password=password
    http://xx.xx.xx.xx/foobar.cgi?cmd=GetPerformance&rs=test&user=user&password=password

    Hi rhatguy, thanks for your post. Sorry for that we don’t suggest using the CGI commands that we didn’t publish. For the CGI commands, it is an advanced way to use the camera and requires the users have basic IT knowledge. Reolink cameras are aimed at the regular users and hope they are easy to use, so we don’ provide the full documentation about the APIs. Also, we got the demand now and I’ll feedback to the PM and R&D to check if we could get some solution for your needs. If you need more help, please contact our support team at https://support.reolink.com/hc/en-us/requests/new.

    #203025

    booking
    Participant

    Dear rhatguy
    Thank you for you API insights & discovery
    API documentation should be indeed mandatory & open!!
    We will test those call one on Argus Pro model
    But before do you know what variable is expected into the rs variable ?
    Thanks

    #203029

    rhatguy
    Participant

    The RS variable doesn’t appear to be used. You can put anything you want in it.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.