D-Link Forums

D-Link IP Cameras for Home => DCS-933L => Topic started by: Pain123 on August 26, 2014, 06:48:00 AM

Title: Api control or change settings with script
Post by: Pain123 on August 26, 2014, 06:48:00 AM
Hello! I'm searching for a way to enable/disable motion detection or email notification without using web Ui. Is there a way to do this? I have found a document for Api control but cant get it to work. The easy way to do it by http request call, or making a script and use Get/Post to change settings.
I have dcs-932l, dcs-933l and dcs-5020.

/Andreas
Title: Re: Api control or change settings with script
Post by: josepa2mander on November 17, 2014, 02:11:21 PM
This is a very interesting question! Did you find a way to enable disable the motion detection with http request (GET/POST)?
I'm very interesting in that!
I've found some request that work but not the motion detection activation!  :(
Code: [Select]
http://192.168...yourIP/motion.cgi
http://192.168...yourIP/image.jpg
http://192.168...yourIP/config/stream_info.cgi
http://192.168...yourIP/common/info.cgi
Title: Re: Api control or change settings with script
Post by: HWAM on January 12, 2015, 11:56:56 PM
Is possible yes!!! Here you go:

Led On:
http://admin:PW@URL-CAM:port/setDayNightMode?DayNightMode=3&ReplySuccessPage=night.htm&ReplyErrorPage=errrnght.htm&ConfigDayNightMode=Save
/setDayNightMode


Led Off:
http://admin:PW@URL-CAM:port/setDayNightMode?DayNightMode=2&ReplySuccessPage=night.htm&ReplyErrorPage=errrnght.htm&ConfigDayNightMode=Save
/setDayNightMode

Motion On:
http://admin:PW@URL-CAM:port/setSystemMotion?ReplySuccessPage=motion.htm&ReplyErrorPage=motion.htm&MotionDetectionEnable=1&ConfigSystemMotion=Save
/setSystemMotion

Motion Off:
http://admin:PW@URL-CAM:port/setSystemMotion?ReplySuccessPage=motion.htm&ReplyErrorPage=motion.htm&MotionDetectionEnable=0&ConfigSystemMotion=Save

admin is account
PW = password
URL-CAM = IP Cam web address
port = port number

If you need info, please ask!!

Good luck, I use this for a long time now. Perfect!!

Title: Re: Api control or change settings with script
Post by: josepa2mander on January 13, 2015, 12:22:34 AM
Thank you very much HWAM!
Tested and it work, this is Christmas for me! :)
Title: Re: Api control or change settings with script
Post by: CF76 on March 11, 2015, 09:03:11 AM
Many thanks HWAM ;D ;D
can you post also the Api control for email Time Schedule for picture and video?

Thanks
Title: Re: Api control or change settings with script
Post by: HWAM on March 14, 2015, 12:32:13 AM
I don't have the command but I will try to find it asap.

Also very useful.
Title: Re: Api control or change settings with script
Post by: HWAM on March 16, 2015, 04:15:34 AM
I found the switches to enable / disable the images and video emailing. But watch the source html page of the CAM and you can find more.

Enable the emailing of images to an email account = Yes

http://admin:PW@URL-CAM:port/setSystemEmail?ReplySuccessPage=email.htm&ReplyErrorPage=errreml.htm&EmailScheduleEnable=1&ConfigSystemEmail=Save

Enable the emailing of images to an email account = No

http://admin:PW@URL-CAM:port/setSystemEmail?ReplySuccessPage=email.htm&ReplyErrorPage=errreml.htm&EmailScheduleEnable=0&ConfigSystemEmail=Save

Enable the emailing of video clip to an email account = Yes

http://admin:PW@URL-CAM:port/setSystemEmail?ReplySuccessPage=email.htm&ReplyErrorPage=errreml.htm&EmailScheduleEnableVideo=1&ConfigSystemEmail=Save

Enable the emailing of video clip to an email account = No

http://admin:PW@URL-CAM:port/setSystemEmail?ReplySuccessPage=email.htm&ReplyErrorPage=errreml.htm&EmailScheduleEnableVideo=0&ConfigSystemEmail=Save

Success.
Title: Re: Api control or change settings with script
Post by: CF76 on April 14, 2015, 01:07:00 AM
Thanks again HWAM. can you explain how can you write the api command looking the html source code?
I just buy the new 935L and I want to do the same you did with 932/3L.
can you help me?
thanks a lot
Title: Re: Api control or change settings with script
Post by: HWAM on April 14, 2015, 01:44:35 AM
You must use the "View page source" option (right-click-mouse) in the Internet Explorer. With this option you see the html source and all the parameters. Just a matter of searching for the right information. Hard to explain.

Are you satisfied with the 935L?

Success.
Title: Re: Api control or change settings with script
Post by: CF76 on April 14, 2015, 06:02:06 AM
hard to explain and hard to understand...

I write a small comment on 935L page.
Title: Re: Api control or change settings with script
Post by: HWAM on April 14, 2015, 06:05:13 AM
Search for "FORM ACTION" in the source, there you can find the parameters:

<FORM ACTION="/setSystemEmail" METHOD="POST" autocomplete="off">
        <input type="hidden" name="ReplySuccessPage" value="email.htm">
        <input type="hidden" name="ReplyErrorPage" value="errreml.htm">
        <input type="hidden" id="EmailScheduleEnable" name="EmailScheduleEnable" value="0">
        <input type="hidden" id="EmailScheduleDay" name="EmailScheduleDay" value="0">
        <input type="hidden" id="EmailScheduleEnableVideo" name="EmailScheduleEnableVideo" value="0">
        <input type="hidden" id="EmailScheduleDayVideo" name="EmailScheduleDayVideo" value="0">
        <div align=center>
Title: Re: Api control or change settings with script
Post by: bowmansupport on December 05, 2016, 12:22:30 PM
Hey HWAM, I'm looking for something similar. I need to be able to mute/unmute the mic on the fly. Can you assist?
Title: Re: Api control or change settings with script
Post by: bowmansupport on December 05, 2016, 01:37:58 PM
I have figured it out!

Mic off = http://ADMIN:PW@IPADDR/cgi/admin/audiovideo.cgi?MicEnable=0
Mic on = http://ADMIN:PW@IPADDR/cgi/admin/audiovideo.cgi?MicEnable=1
Title: Re: Api control or change settings with script (HOW TO)
Post by: FurryNutz on December 05, 2016, 01:59:55 PM
Thank you for posting the info. Glad you got it working.

Enjoy.  ;)
Title: Re: Api control or change settings with script
Post by: sierratango on January 01, 2017, 03:13:36 PM
In the latest DCS-932L firmware (1.14.04), direct access to these URLs are no longer possible and results in the message: "The request is forbidden."

Has anyone figured out a way around this that they could share? I have tried downgrading the firmware but then you cannot use the mydlink remote viewing service.
Title: Re: Api control or change settings with script
Post by: FurryNutz on January 02, 2017, 09:46:33 AM
D-Link may have removed script support due to security reasons.

In the latest DCS-932L firmware (1.14.04), direct access to these URLs are no longer possible and results in the message: "The request is forbidden."

Has anyone figured out a way around this that they could share? I have tried downgrading the firmware but then you cannot use the mydlink remote viewing service.
Title: Re: Api control or change settings with script
Post by: zdavstvuy on February 09, 2017, 07:32:48 PM
I wanted to write a program on Linux that can get motion alerts. How do they work? Does the camera visit a link at the DLink site and provide its ID number, which is hashed to my mydlink account only (thus making this impossible)? Or can I somehow receive the data from the camera to my software? If the latter is the case, how? Many thanks!
Title: Re: Api control or change settings with script
Post by: FurryNutz on February 10, 2017, 06:54:04 AM
You have it right. There is a unique ID number for D-Link products that get associated to there Cloud services.
Title: Re: Api control or change settings with script
Post by: Dangar on October 24, 2017, 01:58:24 AM
In the latest DCS-932L firmware (1.14.04), direct access to these URLs are no longer possible and results in the message: "The request is forbidden."

Has anyone figured out a way around this that they could share? I have tried downgrading the firmware but then you cannot use the mydlink remote viewing service.

I think you have to add

--referer http://URL-CAM/email.htm

I had similar problem with enabling/disabling motion detection and in this case referer url was motion.htm

Title: Re: Api control or change settings with script
Post by: FurryNutz on October 24, 2017, 10:02:44 AM
Thanks for posting this info. Hope it helps future users...   ;)
Title: Re: Api control or change settings with script
Post by: Pain123 on March 23, 2018, 06:30:19 AM
In the latest DCS-932L firmware (1.14.04), direct access to these URLs are no longer possible and results in the message: "The request is forbidden."

Has anyone figured out a way around this that they could share? I have tried downgrading the firmware but then you cannot use the mydlink remote viewing service.

I think you have to add

--referer http://URL-CAM/email.htm

I had similar problem with enabling/disabling motion detection and in this case referer url was motion.htm

Hello, im back on this project and cant get it to work with Day/Night Mode.

Motion works fine with "http://admin:PASSWORD@192.168.0.XX/motion.cgi?MotionDetectionEnable=0&MotionDetectionSensitivity=75&ConfigReboot=No&ConfigSystemMotion=Save".
Both for setting Sensitivity and activate/deactivate motion.

What must i do to activate/deactivate Night Mode? The only response i get is "The request is forbidden.".
It dont matter if i add "--referer http://your_camera_ip/night.htm" in the call.
Can someone help me out?  :)

Best regards Andreas
Title: Re: Api control or change settings with script
Post by: rjms on April 06, 2018, 04:25:33 PM
with curl, this works for me:

Code: [Select]
USER=admin
PW=yourpassword
# HOST is whatever is your cam IP, below is example
HOST=192.168.1.150

# Day/Night modes DN
# 0 = Auto
# 1 = Manual
# 2 = Always Day Mode
# 3 = Always Night Mode
# (mode 4 is for schedule, I'll leave to you the details...)
DN = 2

# Define this to keep things short
ipCamDNOpt="DayNightMode=$DN&ReplySuccessPage=night.htm&ReplyErrorPage=errrnght.htm&ConfigDayNightMode=Save"

# We can now proceed
curl --user $USER:$PW http://$HOST/setDayNightMode --referer http://$HOST --data "$ipCamDNOpt" >/dev/null 2>&1

(Note: --referer http://$HOST/night.htm also works... in fact even --referer http://$HOST/fake.htm works! It's the host origin that's important)

Let's hope this still works in an upcoming firmware (which hopefully will come because KRACK attack vulnerability still isn't fixed for DCS-930L/933L and many others  :o  >:(  :'(  )