Videos

Videos

SAPO Videos is a free online service on which users can upload, share and watch videos.

Free subscription

Technical Overview

Videos Service

API created to allow an easy access to video different main features, such as video adding, editing and removing from the.platform. It also allows content listing using this API. The webservice access is made via BUS, at the following endpoint: http://services.sapo.pt/Videos/ The authentication in the webservice is made at the BUS side. The user, by default, only as permission to access is own contents. In case he is a superuser (contact video technical team) he can give permissions to another user to access his contents.

API Reference

Service Operation Description
Videos AddVideo Add a new video to the platform from a file located in the FTP server, loaded previously (to get a FTP server account contact the Video technical team)
AddVideoPost Add a new video to the platform and its later uploading via POST. In way to do the file POST it is necessary to get a token from BUS with the video randname as ExtraInfo parameter. This post will have the following fields: campos: - token: token obtained from the BUS; - content_file: file to upload; - redir: redirect to which the form window should go after the POST (optional, in case the parameter is not passed it is returned the result in XML; otherwise it is passed the result in error parameter from redirect.
AddVideoToPlaylist Add video to playlist
CheckPlaylist Returns the information for a specific playlist
CheckVideo Returns the information for a specific video
CreatePlaylist Create Playlist on user account
CreateUser Creates a new user
DeletePlaylist Remove a Playlist
DeleteVideo Remove a video
EditPlaylist Change the data of a specific playlist
EditVideo Change the data of a specific video
GetEncodeParameters Returns the encoding parameters of the video for a certain encoding profile
GetEncodeProfilesForUser Returns an array of encoding profiles, which can be uploaded by the user when authenticated in the webservice.
GetUserInfo Returns information about a user
GetUserInfoForDashboard GetUserInfoForDashboard
ListCategories List platform categories
ListUserPlaylists Returns a list of playlists for the current user
ListUserTags ListUserTags
ListUserVideos ListUserVideos
ListVideosFromPlaylist Returns a list of videos from a given playlist
NotifyComment Notify the video platform so it can update its countings when comments are added, changed ou removed directly at the SimpleForum platform (only users with superuser permissions can call this method)
Query Returns a list of videos with the possibility of filter applying
RemoveVideoFromPlaylist Remove video from playlist
RSS2 Returns a list of videos for the user "vitor", filter by tag "piadas", order by rating

Videos Service

Operations

AddVideo

Add a new video to the platform from a file located in the FTP server, loaded previously (to get a FTP server account contact the Video technical team)
Request Parameters
Video : VideoSubmition (required)
Email : string (optional)
Response Parameters
AddVideoResult : Video (optional)
Go to top

AddVideoPost

Add a new video to the platform and its later uploading via POST. In way to do the file POST it is necessary to get a token from BUS with the video randname as ExtraInfo parameter. This post will have the following fields: campos: - token: token obtained from the BUS; - content_file: file to upload; - redir: redirect to which the form window should go after the POST (optional, in case the parameter is not passed it is returned the result in XML; otherwise it is passed the result in error parameter from redirect.
Request Parameters
Video : VideoSubmition (required)
Email : string (optional)
Response Parameters
AddVideoPostResult : Video (optional)
Go to top

AddVideoToPlaylist

Add video to playlist
Request Parameters
Randname : string (required)
Playlist : string (required)
Email : string (optional)
Interface : string (optional)
Go to top

CheckPlaylist

Returns the information for a specific playlist
Request Parameters
PlaylistId : int (required)
Email : string (optional)
Interface : string (optional)
Response Parameters
CheckPlaylistResult : Playlist (optional)
Go to top

CheckVideo

Returns the information for a specific video
Request Parameters
VideoId : string (optional)
Email : string (optional)
VideoRandname : string (optional)
Interface : string (optional)
ShowComments : int (optional)
Response Parameters
CheckVideoResult : Video (optional)
Go to top

CreatePlaylist

Create Playlist on user account
Request Parameters
Email : string (optional)
Playlist : PlaylistSubmition (required)
Response Parameters
CreatePlaylistResult : Playlist (optional)
Go to top

CreateUser

Creates a new user
Request Parameters
Email : string (required)
Username : string (required)
NewsLetter : int (required)
Interface : string (optional)
Go to top

DeletePlaylist

Remove a Playlist
Request Parameters
PlaylistId : int (required)
Email : string (optional)
Interface : string (optional)
Go to top

DeleteVideo

Remove a video
Request Parameters
Randname : string (required)
Email : string (optional)
Interface : string (optional)
Go to top

EditPlaylist

Change the data of a specific playlist
Request Parameters
Playlist : PlaylistSubmition (required)
Email : string (optional)
Interface : string (optional)
Go to top

EditVideo

Change the data of a specific video
Request Parameters
Video : VideoSubmition (required)
Email : string (optional)
Interface : string (optional)
Go to top

GetEncodeParameters

Returns the encoding parameters of the video for a certain encoding profile
Request Parameters
EncId : int (optional)
IdVideoWidth : int (optional)
IdVideoHeight : int (optional)
IdAudioBitrate : int (optional)
IdAudioNch : int (optional)
IdVideoFps : float (optional)
Response Parameters
GetEncodeParametersResult : Params (optional)
Go to top

GetEncodeProfilesForUser

Returns an array of encoding profiles, which can be uploaded by the user when authenticated in the webservice.
Response Parameters
GetEncodeProfilesForUserResult : ArrayOfEncodeProfile (optional)
Go to top

GetUserInfo

Returns information about a user
Request Parameters
Email : string (optional)
Username : string (optional)
Response Parameters
GetUserInfoResult : User (optional)
Go to top

GetUserInfoForDashboard

GetUserInfoForDashboard
Request Parameters
Email : string (optional)
Username : string (optional)
Interface : string (optional)
Response Parameters
GetUserInfoForDashboardResult : UserForDashboad (optional)
Go to top

ListCategories

List platform categories
Response Parameters
ListCategoriesResult : ArrayOfCategory (required)
Go to top

ListUserPlaylists

Returns a list of playlists for the current user
Request Parameters
Email : string (optional)
Interface : string (optional)
Page : int (optional)
Limit : int (optional)
Order : string (optional)
Response Parameters
ListUserPlaylistsResult : ArrayOfPlaylist (optional)
Go to top

ListUserTags

ListUserTags
Request Parameters
Email : string (optional)
Interface : string (optional)
Limit : int (optional)
Response Parameters
ListUserTagsResult : ArrayOfTag (optional)
Go to top

ListUserVideos

ListUserVideos
Request Parameters
Email : string (optional)
Interface : string (optional)
Order : string (optional)
Limit : int (optional)
Page : int (optional)
Response Parameters
ListUserVideosResult : ArrayOfVideo (optional)
Go to top

ListVideosFromPlaylist

Returns a list of videos from a given playlist
Request Parameters
Playlist : string (required)
Email : string (optional)
Interface : string (optional)
Order : string (optional)
Limit : int (optional)
Page : int (optional)
Response Parameters
ListVideosFromPlaylistResult : ArrayOfVideo (optional)
Go to top

NotifyComment

Notify the video platform so it can update its countings when comments are added, changed ou removed directly at the SimpleForum platform (only users with superuser permissions can call this method)
Request Parameters
Randname : string (required)
Interface : string (optional)
Go to top

Query

Returns a list of videos with the possibility of filter applying
Request Parameters
Emails : string (optional)
Tags : string (optional)
Cos : int (optional)
Limit : int (optional)
Order : string (optional)
ViewAll : int (optional)
Interface : string (optional)
ShowTags : int (optional)
Response Parameters
QueryResult : ArrayOfVideo (optional)
Go to top

RemoveVideoFromPlaylist

Remove video from playlist
Request Parameters
Randname : string (required)
Playlist : string (required)
Email : string (optional)
Interface : string (optional)
Go to top

RSS2

Returns a list of videos for the user "vitor", filter by tag "piadas", order by rating
Examples

Returns a list of videos for the user "vitor", filter by tag "piadas", order by rating

Returns a list of videos for user "vitor", filter by the search term "piadas", ordered by number of views, limited to 10 results

Returns a list of most recent videos for the user "vitor"

Returns a list of related videos for the video identified by randname specified, limited to 10 results

Returns a video playlist with id "10" from user "olimpiadas2008", page 1 limited by 10 elements

Returns a video user list from user "olimpiadas2008", page 2 limited by 10 elements

Return a list of channels filtered by the search term "humor", limited to 10 results

Return a list of last channels for the user "olimpiadas2008", page 2 limited by 10 results
Go to top

Videos Entities

ArrayOfCategory

Attribute Name Description
List of item : Category (optional)
Go to top

ArrayOfComment

Attribute Name Description
List of item : Comment (optional)
Go to top

ArrayOfEncodeProfile

Attribute Name Description
List of item : EncodeProfile (optional)
Go to top

ArrayOfPlaylist

Attribute Name Description
List of item : Playlist (optional)
Go to top

ArrayOfTag

Attribute Name Description
List of item : Tag (optional)
Go to top

ArrayOfVideo

Attribute Name Description
List of item : Video (optional)
Go to top

Category

Attribute Name Description
Id : int
Name : string
Go to top

Comment

Attribute Name Description
Date : string
Nickname : string
Website : string
Body : string
Go to top

EncodeProfile

Attribute Name Description
Id : int
Name : string
Extension : string
ToEncode : int
Go to top

Params

Attribute Name Description
ExpWidth : int
ExpHeight : int
ScaleWidth : int
ScaleHeight : int
SoundRate : int
SoundMode : int
VideoFps : float
VideoExtension : string
VideoBitrate : int
Go to top

Playlist

Attribute Name Description
Id : int
Active : int
CreationDate : string
Description : string
Title : string
Tags : string (optional)
URL : string
Thumbnail : string
TotalVideos : int
ResultTotalPlaylists : int (optional)
Go to top

PlaylistSubmition

Attribute Name Description
Id : int (optional)
Title : string
Active : int
Description : string
Tags : string
Go to top

Tag

Attribute Name Description
Tag : string
Count : int (optional)
Go to top

User

Attribute Name Description
Id : int
Active : int
Banned : int
CommentCaptcha : int
CommentModerate : int
CommentNotify : int
CreationDate : string
Email : string
LastLogin : string
Partner : int
UploadMail : string
Username : string
ViewAll : int
Website : string
Go to top

UserForDashboad

Attribute Name Description
TotalPublicVideos : int
TotalPrivateVideos : int
TotalPublicPlaylist : int
TotalPrivatePlaylist : int
TotalComments : int
TotalFavorites : int
Go to top

Video

Attribute Name Description
Id : int
Active : int
CreationDate : string
Length : int
Pending : int (optional)
Randname : string (optional)
Subtitle : string
Synopse : string
Title : string
Username : string (optional)
URL : string
Thumbnail : string
Embed : string
Rating : string
Views : string
Comments : string
ReferedExternal : string
Tags : string (optional)
CommentsContent : ArrayOfComment (optional)
CategoryId : int (optional)
HD : int (optional)
CanPublish : int (optional)
CanShare : int (optional)
ResultTotalVideos : int (optional)
Token : string (optional)
Go to top

VideoSubmition

Attribute Name Description
Subtitle : string
Synopse : string
Title : string
Active : int
FileName : string (optional)
Randname : string (optional)
Tags : string
ReferedExternal : string (optional)
CategoryId : int (optional)
HD : int (optional)
CanPublish : int (optional)
CanShare : int (optional)
PublishDate : string (optional)
RemovalDate : string (optional)
Go to top

REST API Authentication

Authenticating REST Request

Every request must contain authentication information to establish the identity of whom making the request and a autorization token denominated ESBAccessKey.

ESB Access Key

The ESB Access Key is what will authorize the usage of the API and is available when the buying process ends. In the costumer area you can find the product details where you can generate an ESB Access Key for you usage, another user registered on SAPO Services or even for everyone.

The element ESBAccessKey must appear on the URL as a query-string

HTTP GET example using username and password:

HTTP POST username and password:

Request with ESBToken

Using a token instead of your username and password can be useful if you don't want to give your credentials to whom is using the API.

In order to generate a ESB Token you must use SAPO Security Token Service. The ESBToken is valid for 12 hours.

HTTP GET example using ESB Token:

HTTP POST ESB Token:

Parameters description

ESBCredentials are parameters used to authenticate and authorize a REST request

Elements Description
ESBUsername The e-mail of the account that is used to access the API.
ESBPassword The password that in combination with the ESBUsername is used to access the corresponding account.
ESBToken An authentication token generated by using an user name (ESBUsername) and password (ESBPassword). It should be used a ESBToken or the combination of ESBUsername and ESBPassword.
ESBAccessKey The authorization key used to authorize the request against your purchase. The account being used to access the service must be associated to this key.
Go to top

SOAP API Authentication

Authenticating SOAP Request

Every request must contain authentication information to establish the identity of whom making the request and a autorization token called ESB Access Key.

ESB Access Key

Correct with the path to the access key

The ESB Access Key is what will authorize the usage of the API and is available when the buying process ends. In the costumer area you can find the product details where you can generate an ESB Access Key for you usage, another user registered on SAPO Services or even for everyone.

The element ESBAccessKey must appear on the message SOAP Header after the complex type ESBCredentials

Example:

ESBCredentials

ESBCredentials is a complex type that is used to pass the credentials in order to authenticate a SOAP request.

Request with username and password
Elements Description
ESBUsername The e-mail of the account that is used to access the API
ESBPassword The password that in combination with the ESBUsername is used to access the corresponding account

Example:

Request with ESBToken

Using a token instead of your username and password can be useful if you don't want to give your credentials to whom is using the API.

In order to generate a ESB Token you must use SAPO Security Token Service (STS). The ESBtoken is valid for 12 hours.

Requesting with an ESBtoken
Go to top