Forum Software 3rd Party Software API discovery and documentationn

This topic contains 14 replies, has 7 voices, and was last updated by  sammyboy405 2 months, 4 weeks ago.

Viewing 15 posts - 1 through 15 (of 15 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.

    #219657

    suto norbert
    Participant

    This api calls working with Argus series? I try some, but no success...

    #220319

    rhatguy
    Participant

    suto: unfortunately I don't have any details about the Argus as I don't own any. Also unfortunately I've been unsuccessful in my ultimate goal of finding a page that simply tells if the camera has recently detected motion. Seems like such a basic function that is addressed simply in many of the access methods, but alas I haven't been able to find a way to query it.

    #220961

    Sloma
    Participant

    Great idea!!!

    Is there any way to integrate motion notifications using these commands i.e. by creating command line sensor in Home Assistant? I came across some that works with different camera but if possible below could be modified:

    – platform: command_line
    name: “camera bedroom motion”
    device_class: switch
    command: curl -k –silent “http://:/get_status.cgi?loginuse=&loginpas=” | grep -oP “(alarm_status=).*?(;)”
    value_template: >-
    {%- if value == “alarm_status=0;” -%}
    off
    {%- elif value == “alarm_status=1;” -%}
    on
    {%- endif -%}
    scan_interval: 1.5

    Unfortunately, I don't know much about it so I wonder if it is actually possible?

    #220983

    rhatguy
    Participant

    Unfortunately there doesn't seem to be a ”get_status” url that anyone has been able to find or that Reolink will let us know about. It seems like a very basic function, but with no API documentation and no way to find what functions the camera supports, we're left to either sniff the network or try to break open a firmware file to understand what functionality is actually there.

    #220985

    Sloma
    Participant

    This is why I'm getting more and more dissappointed with Reolink, pretty basic stuff is missing!!! Shame on you Reolink.

    #223421

    suto norbert
    Participant

    suto: unfortunately I don't have any details about the Argus as I don't own any. Also unfortunately I've been unsuccessful in my ultimate goal of finding a page that simply tells if the camera has recently detected motion. Seems like such a basic function that is addressed simply in many of the access methods, but alas I haven't been able to find a way to query it.

    My goal is really simple. I would like a option/API/trigger/IFTTT... ANYTHING to send my Argus 2 camera to start recording and/or take a picture.

    I ask the support many times and the latest conversation, they said that they plan to use IFTTT at 2th quarter of 2019... I hope it is true. (but it not mean that the necessary action will be avalaible)

    #231169

    Linas
    Participant

    Same here, really need some basic API calls to enable/disable E-mail alerts, FTP uploads and Alarm sound.
    Reolink, if you're reading this, the cameras are good, but you need to step up the game on integration and fast, everything's connected these days.

    #235035

    Carl
    Keymaster

    Hi all, thanks so much for all your good suggestions and ideas.
    We will collect and forward all your great ideas to our senior engineer for future development.

    #317974

    sammyboy405
    Participant

    Hi all, thanks so much for all your good suggestions and ideas.
    We will collect and forward all your great ideas to our senior engineer for future development.

    They say this alot, but never seem to act on anything said. API Documentation, a must. HTML5 Support (or a Flash Replacement) a Must.

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

You must be logged in to reply to this topic.