FAQ  •  Register  •  Login

serviidb restful api

<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 1:53 pm

serviidb restful api

I am starting to work on the restful api. Let me know what you guys think. I have already gotten some feedback from Will.


will wrote:Yes I should send one request and get everything back in one go

At first lets just go for me sending the title that I want (ignore case but match ordering) with optional filters. Later we could expand it so that I can query for a list of services

e.g
1) "the simpsons" will return all feeds with "the simpsons" might give 4oD - The Simpsons and Hulu - The simpsons
2) "the simpsosn" plus filters e.g. region=GB will just give 4oD - The Simpsons

so the request for 2) would look like title="the simpsons", region="GB"

Ideally, I will be able to call /rest/langages and /rest/regions to get a list of the avialable ones which I can then present via a drop down box for users. Might be worth moving this to a thread on the serviio forum so that we can partially involve zip in doing the spec for the queries.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Feb 16, 2012 2:05 pm

Re: serviidb restful api

Before we start this, could you list all the database fields that you have and then we can list what we would want to filter against.

At first it will be a simple search, but I could see a more advanced browse serviidb activity in the future where users can filter through the content.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16709

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Feb 16, 2012 4:22 pm

Re: serviidb restful api

will it include the plugin as well if needed? the API could return a zip package including the plugin and description data as a bundle and I'd add an API to store the plugin in the plugins folder.
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 7:50 pm

Re: serviidb restful api

That is what we are discussing what all it needs to do. Yes I think we can include the plugin if needed.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Feb 16, 2012 8:13 pm

Re: serviidb restful api

Will installing plugins support a url, or will it be local only?

As per my post in one of the earlier threads, having access to the installed plugins (and their versions) will also be very useful as I can then say to the user, you also need to install this, or you need to update this first.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 8:46 pm

Re: serviidb restful api

will wrote:Will installing plugins support a url, or will it be local only?
I am not sure what you mean?

I think it would probably be the safest, to have a resource to download the file and then the requesting app would copy it to the desired folder.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 9:14 pm

Re: serviidb restful api

Has anyone used a XMLRPC server. I can use a REST server or a XMLRPC server.

The reason I am asking is that last night at work, I enabled the XMLRPC server and keep on working on the site. Then I saw that I did not have the REST server enabled so I enabled it and disabled the XMLRPC server. As soon as I hit save configuration, I got bounced off the site due to my companies firewall. So basically if I use REST server, I will not be able to even login at work (work 12 hours sitting at desk with nothing to do most of the time), or if I use the XMLRPC server I can keep working on the site entering data and maintaining the database.

If the REST server is best for connecting to the database then that would be how it is.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Feb 16, 2012 9:33 pm

Re: serviidb restful api

Personally I would prefer REST as it means I don't need another library and json is so easy to work with.

Can you not make changes through the site while the rest server is enabled?
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 9:44 pm

Re: serviidb restful api

I can make changes to the site from home with the Rest server is running, but not at work, I hit the firewall as soon as I enabled the rest server.

But once I get the site up the way we like it I will not be connecting to it that much at work.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16709

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Feb 16, 2012 10:20 pm

Re: serviidb restful api

That's weird, REST is just HTTP protocol, usually even on port 80, so like normal browsing. Definitely REST, if it's nor REST I won't even bother :-D
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Feb 16, 2012 10:35 pm

Re: serviidb restful api

I am off until Saturday, I will try it again.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Fri Feb 17, 2012 8:58 am

Re: serviidb restful api

I have the REST server up. Here is some of the information about it. Let me know if you need anything changed or added. I am trying to figure out how to add a search.

  Code:
$endpoint = new stdClass;
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'rest';
$endpoint->server = 'rest_server';
$endpoint->path = 'rest';
$endpoint->authentication = array(
  'services' => 'services',
);
$endpoint->server_settings = array(
  'rest_server' => array(
    'formatters' => array(
      'bencode' => TRUE,
      'ical' => TRUE,
      'json' => TRUE,
      'jsonp' => TRUE,
      'php' => TRUE,
      'plist' => TRUE,
      'rss' => TRUE,
      'xcal' => TRUE,
      'xml' => TRUE,
      'xmlplist' => TRUE,
      'yaml' => TRUE,
    ),
    'parsers' => array(
      'application/json' => TRUE,
      'application/plist' => TRUE,
      'application/plist+xml' => TRUE,
      'application/vnd.php.serialized' => TRUE,
      'application/x-www-form-urlencoded' => TRUE,
      'application/x-yaml' => TRUE,
      'multipart/form-data' => TRUE,
    ),
  ),
);
$endpoint->resources = array(
  'comment' => array(
    'alias' => 'comment',
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
    'actions' => array(
      'countAll' => array(
        'enabled' => 1,
      ),
      'countNew' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'file' => array(
    'alias' => 'file',
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'node' => array(
    'alias' => 'node',
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
    'relationships' => array(
      'files' => array(
        'enabled' => 1,
      ),
      'comments' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'system' => array(
    'alias' => 'system',
    'actions' => array(
      'connect' => array(
        'enabled' => 1,
      ),
      'get_variable' => array(
        'enabled' => 1,
      ),
      'set_variable' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'taxonomy_term' => array(
    'alias' => 'term',
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
    'actions' => array(
      'selectNodes' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'taxonomy_vocabulary' => array(
    'alias' => 'vocabulary',
    'operations' => array(
      'retrieve' => array(
        'enabled' => 1,
      ),
      'index' => array(
        'enabled' => 1,
      ),
    ),
    'actions' => array(
      'getTree' => array(
        'enabled' => 1,
      ),
    ),
  ),
  'user' => array(
    'alias' => 'user',
  ),
);
$endpoint->debug = 1;
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

Xmantium

User avatar

DLNA master

Posts: 1418

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sat Feb 18, 2012 5:33 pm

Re: serviidb restful api

zip wrote:That's weird, REST is just HTTP protocol, usually even on port 80, so like normal browsing. Definitely REST, if it's nor REST I won't even bother :-D

Zip has REST his case :lol: (it was more funnier in my head)

Good work moltra. Just to note aswell, each URL should also specify weather it HD or SD
Have you figured out the maximum thumbnail resolution size for video streams?
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sat Feb 18, 2012 6:32 pm

Re: serviidb restful api

Xmantium wrote:Good work moltra. Just to note aswell, each URL should also specify weather it HD or SD
Have you figured out the maximum thumbnail resolution size for video streams?


should the URL have the HD/SD or should you be able to sort a list of feeds by HD/SD?

I have the following fields setup to allow sorting by it. Drupal the Content Management System (CMS) I am using calls them Taxonomy terms.

Category (movie, music,video feed/art,youtube) plus more to be added as needed.

Region (US, UK, Germany, Worldwide) more added as needed.

Language
Media Source (RSS, Web Resource)
Media Type (Audio,image,video)
Plugin (none,name_rev)
Resolution(SD,HD)

I am not sure that I want to put all those terms in the URL. That is why I have it setup right now like the following.

http://serviidb.com/video-feeds/wildlife/nature-pbs

It says it is a video feed, about wildlife and the name is Nature-pbs.

I could change it to
  Code:
http://serviidb.com/video-feeds/wildlife/HD/nature-pbs

but then should I make it like the following
  Code:
http://serviidb.com/video-feeds/wildlife/HD/US/worldwide/nature-pbs


Since I have 7 terms at this time that I can sort/filter on do we need to add some or all to the URL?

Have you figured out the maximum thumbnail resolution size for video streams
What are you asking about the max thubmnail resolution size? Right now the site only takes what you input into it and it converts it to a thumbnail 160x120. Are you talking about making that size bigger?
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16709

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Feb 18, 2012 7:35 pm

Re: serviidb restful api

I'd make it easy -

  Code:
.../search?query=the+simpsons


for optional filters you can add


  Code:
.../search?query=the+simpsons&region=uk&q=sd
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16709

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Feb 18, 2012 7:36 pm

Re: serviidb restful api

zip wrote:I'd make it easy -

  Code:
.../search?query=the+simpsons


for optional filters you can add


  Code:
.../search?query=the+simpsons&region=uk&q=sd


You could filter on resource type (feed, libe, etc), but the user is hardly interested in this.
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sat Feb 18, 2012 7:56 pm

Re: serviidb restful api

zip wrote:
zip wrote:I'd make it easy -

  Code:
.../search?query=the+simpsons


for optional filters you can add


  Code:
.../search?query=the+simpsons&region=uk&q=sd


You could filter on resource type (feed, libe, etc), but the user is hardly interested in this.


I will work on the REST search tomorrow at home, I can get to the site through a remote desktop to a terminal server inside the company network, but cannot from my computer. Strange the firewall should be the same.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

kairoh

DLNA master

Posts: 178

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Sat Feb 18, 2012 9:59 pm

Re: serviidb restful api

If you want an example of a successful REST website, there is this one and its documentation.
You may copy some idea. ;)
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sat Feb 18, 2012 11:00 pm

Re: serviidb restful api

Thanks I will look at it this evening, I am new at building a REST server.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.