Page 5 of 19

Re: serviidb.com

PostPosted: Thu Apr 12, 2012 4:18 pm
by moltra
OK I will setup another response type with those fields.
what should we call it?

Re: serviidb.com

PostPosted: Thu Apr 12, 2012 4:22 pm
by will
Something like /api/templates or /api/url-templates should be fine for now.

Re: serviidb.com

PostPosted: Thu Apr 12, 2012 4:25 pm
by moltra
will wrote:Something like /api/templates or /api/url-templates should be fine for now.


will go with the api/templates

I am starting on the API documentation now, so I can put it all in there. I am also thinking about setting up a version control on the api, so I can make changes and the clients can pick what version they want to use, but I will probably only maintain the latest version.

Re: serviidb.com

PostPosted: Thu Apr 12, 2012 5:00 pm
by will
Could you also add a 'name' which will be used for displaying the available templates in a list e.g. 4oD, YouTube search term, Picasa etc...

Versioning could work, if it is not too much of a pain, although there probably won't be too many changes after release.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 9:24 am
by will
One other thing, would it be a pain to have a /api/media (or similar) that searches images, audio and video?

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 10:58 am
by moltra
no, it would not be a problem.

Sent from my DROID RAZR using Tapatalk 2

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 11:12 am
by will
Ok thanks, I want to have a 'simple mode' which searchs for any media type with any region against the plugin name or the media title, and then advanced mode which allows you to refine by media type, region, and search just title or just plugin name.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 3:45 pm
by moltra
I understand and will call it "media".

I will try and get media and template resources setup tonight.

In the future if I add a variable being returned by the API will that affect your code, or will it be ignored until you decide to start using it.

Also on the feedback to serviidb on what is "Installed into serviio" besides client, and nid (unique id of item) do you think anything else would be beneficial to send back to serviidb.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 3:55 pm
by will
If you add something to the response, I just won't see it, so it is fine for you to add stuff. The only thing to look out for is you expecting additional parameters for me sending stuff back, as they won't be present.

Re-installed I cannot think of anything else. Although if you want to make serviidb use ratings and installs, then you could always add that to the api, so you get title, url, plugin, resourceType, installCount, rating.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 4:06 pm
by moltra
I am currently just thinking about a way we can see what client is installing what items. That lets me make sure I can support the load in the future, and allows me to show the installCount of the media resouces.

Plus I will be able to give you and the other Dev's how often and how their clients are being used to add plugins, and media resources.

The information back would be in a restful put format.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 5:38 pm
by will
Remember, you will need to add an extra filed to the item response called mediaType=[video|audio|image] so that you can have the combined /api/media, but proably best to add it to /video etc.. for consistancy as well. Also I assume there will need to be a thumbnailUrl for live streams?

The bandwidth required won't be that much from the API so you shouldn't have a problem for a while.

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 6:18 pm
by moltra
Extra filed? Sorry short on phone

Sent from my DROID RAZR using Tapatalk 2

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 6:21 pm
by will
At the moment /api/video gives {"resource":"video".......,"items":[...]}, for each item, there is no mention that it is a video, which is fine for /video /image /audio, but won't be fine for a combined /media.

E.g. you will need {"show":"Blip TV Photoshop Users TV","region":"UK","url":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS Atom feed","plugin":"Blip TV", "mediaType":"video"}

Re: serviidb.com

PostPosted: Fri Apr 13, 2012 6:40 pm
by moltra
ok easy to add

Sent from my DROID RAZR using Tapatalk 2

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 1:16 pm
by will
Made some good progress this morning. The API seems pretty responsive (much more than when loading the website). I guess the items are comming out in the order they were added in to the databaase, if it is easier to do it at your end, then it might be nice to sort them a bit first.

I think you should definately add installCount and rating to the response, maybe even add the extra info such as resolution, category and langues as well. If you later extend the API, i can let people rate a show via the app.

This is what I have so far, obviously the UI needs sorting out properly (missing text and sizing in general), and I need buttons to add to library, but I think it should work really well.

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 3:10 pm
by will
The API gives a Task XXX not found error if you run a search which doesn't match any items e.g. http://serviidb.com/apidev/video.json?title=hello Can you fix that please?

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 4:47 pm
by moltra
will wrote:The API gives a Task XXX not found error if you run a search which doesn't match any items e.g. http://serviidb.com/apidev/video.json?title=hello Can you fix that please?



Yes, I can do you want it to send an empty list or just a completion code?

Right now I am not sending the ratings from serviidb via the API do you want me to add that field?

I did not read your full post was looking at the graphics on how you had it set up. I will return everything, about the media resource. Resolution, language, both ratings,

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 4:59 pm
by will
moltra wrote:Yes, I can do you want it to send an empty list or just a completion code?

Right now I am not sending the ratings from serviidb via the API do you want me to add that field?

I did not read your full post was looking at the graphics on how you had it set up. I will return everything, about the media resource. Resolution, language, both ratings,


It should be a propper response, with totalSize set to 0 and an empty items list.

Yes I think you might as well send it all, it isn't very bandwith heavy, and its easy enough to parse. You can always remove it later as long as you give me a bit of warning to update the app.

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 5:02 pm
by moltra
I can also return these codes.

    OK = 200,
    CREATED = 201,
    NOCONTENT = 204,
    MOVEDPERMANENTLY = 301,
    FOUND = 302,
    SEEOTHER = 303,
    NOTMODIFIED = 304,
    TEMPORARYREDIRECT = 307,
    BADREQUEST = 400,
    UNAUTHORIZED = 401,
    FORBIDDEN = 403,
    NOTFOUND = 404,
    METHODNOTALLOWED = 405,
    NOTACCEPTABLE = 406,
    GONE = 410,
    LENGTHREQUIRED = 411,
    PRECONDITIONFAILED = 412,
    UNSUPPORTEDMEDIATYPE = 415,
    INTERNALSERVERERROR = 500;

Re: serviidb.com

PostPosted: Sat Apr 14, 2012 7:10 pm
by zip
moltra wrote:I can also return these codes.

    OK = 200,
    CREATED = 201,
    NOCONTENT = 204,
    MOVEDPERMANENTLY = 301,
    FOUND = 302,
    SEEOTHER = 303,
    NOTMODIFIED = 304,
    TEMPORARYREDIRECT = 307,
    BADREQUEST = 400,
    UNAUTHORIZED = 401,
    FORBIDDEN = 403,
    NOTFOUND = 404,
    METHODNOTALLOWED = 405,
    NOTACCEPTABLE = 406,
    GONE = 410,
    LENGTHREQUIRED = 411,
    PRECONDITIONFAILED = 412,
    UNSUPPORTEDMEDIATYPE = 415,
    INTERNALSERVERERROR = 500;

Those should be used for the HTTP response status codes. usually 200 for any OK response, 400 if the API call is not valid and possibly 404 if you have API call to retrieve something by its ID.