Version 7.4.1

RESTful Examples

Getting Project Info

Note: This service has been introduced as a favorable alternative to GetVodPlayerInfo. Together with the new GetPrograms service, projects and their programs can be retrieved much more efficiently. The idea is to use GetProject to retrieve basic project information, then make a subsequent call to GetPrograms to receive a paginated list of programs to display on a page. This will greatly reduce the load time of projects with hundreds of programs!

Getting info on a specific project is accomplished by using the GetProject service. This will return basic project metadata, embed code, rss links, as well as any categories inside of the project (if applicable). The basic URL is:

http://player.piksel.com/ws/get_project/api/{app_token}/p/{project_uuid}

Getting Programs

Note: This service has been introduced as a favorable alternative to GetProgramsByCategory. Wheras GetProgramsByCategory could only retrieve programs from a category project, the new GetPrograms service accepts both non-category and category projects.

Getting programs from a specific project is a common task. The function GetPrograms is available to accomplish this. The URL format is:

http://player.piksel.com/ws/get_programs/api/{app_token}/p/{project_uuid}

This will simply get all of the programs from the requested project. If the project contains categories, programs from the first category found will be returned. If programs from a specific category are desired instead, the category can be specified by the optional {category_id} parameter.

get_programs/api/{app_token}/p/{category_project_uuid}/catid/{category_id}/

On a project with hundreds of programs, these requests can take quite some time to process and download. The optional {start} and {end} parameters control the number of programs that are returned.

get_programs/api/{app_token}/p/{project_uuid}/start/{start}/end/{end}

Simply replace {start} with the desired start program index and {end} with the desired end index. This will result in the SQL clause LIMIT start, end-start.

In fact, many service calls support {start} and {end} parameters.

Getting Detailed Program Info

So you have made a call to GetPrograms to show a page of available videos, and now a user has clicked on a video to view. The GetProgramInfo service provides detailed information for a specific program so that it may be played. To see the format of the response, take a look at the GetProgramInfo docs page.

Generating Thumbnails

The Thumbnail generation service is reached at a slightly different URL than other RESTful services. There is no /ws/ directory in the full URL:

http://player.piksel.com/thumbs/

This service makes it easy to resize a thumbnail. All you need is an existing URL of the thumbnail. Take this one for example:

http://player.piksel.com/thumbs/aid/w/640/h/360/t1328726009/13.jpg

As you can see, the width and height are embedded as get parameters w and h. If you wanted to resize the thumbnail, you could parse the URL and change the numbers directly. However, this service makes it easier. Simply pass in a width and height at the end like so

http://player.piksel.com/thumbs/aid/w/640/h/360/t1328726009/13.jpg?w=320&h=180

These additional paramaters will override the existing width and height, and you will get a resized thumbnail. In this case, 320x180 pixels. Note that this service does not support stretching images. If width is provided, the height is disregarded and scaled accordingly.