Page 1 of 1

Problem with add_schedule

PostPosted: Fri Sep 04, 2015 3:37 pm
by privatesam
I'm trying to use the API to add a schedule recording. I've tried using two different clients to send the POST command but neither is achieving what I want.

Firstly I'm trying to use Tasker on Android to send the command through the RESTask plugin. This allows me to specify parameters and decide between POST GET etc. However when I use this to set a schedule it doesn't work - no schedule shows up in the web client and the recording doesn't happen. When I take a look in the dlrecorder.db I see it has made an entry under the schedule table but this is what it looks like:

Image

I'm pretty sure this info is completely wrong for DVBLink to make the recording. The weird thing is the response from the server provides Status code 0 and obviously it connects sends some data, DVBLink receives it and enters stuff into its database its just the wrong kinda data? I've noticed it does the same thing whether I specify as GET or POST - the same thing happens. Do I need to specify the headers more explicitly? Anyone have any ideas?

Re: Problem with add_schedule

PostPosted: Fri Sep 04, 2015 3:56 pm
by privatesam
Also I checked my POST request with an online service and it looks like its been sent up correctly:

Image

Re: Problem with add_schedule

PostPosted: Fri Sep 04, 2015 4:03 pm
by Oberon
It looks like you are not closing the tags correctly in xml - for example
Code: Select all
<channel_id/> 11220000

has to be
Code: Select all
<channel_id>11220000</channel_id>

Re: Problem with add_schedule

PostPosted: Fri Sep 04, 2015 4:28 pm
by privatesam
Thanks Oberon thats exactly the issue. I got confused by the way the tags are laid out in the API documentation - although I'm a very beginner developer so it may well be that I was reading the documentation incorrectly. Its working now.

Another quick question - I'm ok with sqlite - is it possible to add a schedule by directly adding an entry to the schedule table in the dlrecorder.db with all the relevant fields filled?