• June 19, 2018, 12:43:18 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Pages: 1 [2]

Author Topic: Api control or change settings with script  (Read 13523 times)

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 45150
  • D-Link Global Forum Moderator
    • New DIR-890L Router with SmartConnect™ Technology
Re: Api control or change settings with script
« Reply #15 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.
Logged
Cable:200mb/10Mb>Motorola MB7420>COVR3902>HP 24pt Gb Switch. 3xDGL-4500s,DIR-857,835,827,815,890L,880L,868L,865L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L and 960L.
Go Here>Router Troubleshooting

zdavstvuy

  • Level 1 Member
  • *
  • Posts: 2
Re: Api control or change settings with script
« Reply #16 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!
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 45150
  • D-Link Global Forum Moderator
    • New DIR-890L Router with SmartConnect™ Technology
Re: Api control or change settings with script
« Reply #17 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.
Logged
Cable:200mb/10Mb>Motorola MB7420>COVR3902>HP 24pt Gb Switch. 3xDGL-4500s,DIR-857,835,827,815,890L,880L,868L,865L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L and 960L.
Go Here>Router Troubleshooting

Dangar

  • Level 1 Member
  • *
  • Posts: 1
Re: Api control or change settings with script
« Reply #18 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

Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 45150
  • D-Link Global Forum Moderator
    • New DIR-890L Router with SmartConnect™ Technology
Re: Api control or change settings with script
« Reply #19 on: October 24, 2017, 10:02:44 AM »

Thanks for posting this info. Hope it helps future users...   ;)
Logged
Cable:200mb/10Mb>Motorola MB7420>COVR3902>HP 24pt Gb Switch. 3xDGL-4500s,DIR-857,835,827,815,890L,880L,868L,865L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L and 960L.
Go Here>Router Troubleshooting

Pain123

  • Level 1 Member
  • *
  • Posts: 2
Re: Api control or change settings with script
« Reply #20 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
« Last Edit: March 23, 2018, 11:00:07 AM by Pain123 »
Logged

rjms

  • Level 1 Member
  • *
  • Posts: 11
Re: Api control or change settings with script
« Reply #21 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  >:(  :'(  )
Logged
Pages: 1 [2]