Faucet API Specification
Faucet provides a REST API at the url: http://www.vcast.it/faucetpvr/api/1.0/server_rest.phpAuthorization: Basic ZnJlZDp0aGF0cyBtZQ==Where the ending string is the pair <username>:<password> coded base64
URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/channels method: GET Querystring: type=video Returns: 200 OK & JSON object containing the array of the channels 401 UnauthorizedThe client can set a filter on the channel type (radio or tv), but currently the request returns the whole list containing both types in any request. That's because the list parsing is performed by the client.
[ {"name":"Rai1","type":"video"},
{"name":"Rai2","type":"video"},
{"name":"Rai3","type":"video"},
...... ]
2 - Get the recordings list.URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/recordings method: GET Querystring: no parameters needed Returns: 200 OK & JSON object containing the array of the recordings 401 UnauthorizedThe JSON object is an array whose elements are the parameters describing the recording:
[
{
"id_rec":"411202",
"channel":"Rai2",
"channel_type":"video",
"title":"Mattino",
"from_time":"2008-02-04 09:00:00",
"to_time":"2008-02-04 10:00:00",
"rec_time":"00:00",
"repeat":"no_repeat",
"retention":"3",
"format":"mp3",
"faucetacc":"http://www.vcast.it/faucetpvr/update.php?qwt=w=HMgTzN"
},
{
"id_rec":"411201",
"channel":"Rai1",
"channel_type":"video",
"title":"Tg1",
"from_time":"2008-02-04 20:00:00",
"to_time":"2008-02-04 20:30:00",
"rec_time":"00:00",
"repeat":"daily",
"retention":"3",
"format":"portable",
"faucetacc":"http://www.vcast.it/faucetpvr/update.php?qwt=w=NRUTzN"
},
{
"id_rec":"411204",
"channel":"La7",
"channel_type":"video",
"title":"Reservoir dogs",
"from_time":"2008-02-04 21:00:00",
"to_time":"2008-02-04 23:30:00",
"rec_time":"00:00",
"repeat":"no_repeat",
"retention":"3",
"format":"h264",
"faucetacc":"http://www.vcast.it/faucetpvr/update.php?qwt=w=TMQTzN"
}
]
3 - Create a new recording.
URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/recordings
method: POST
Request Body: JSON object containing the parameters of the recording to add.
Returns: 201 Created
400 Bad request in those cases in which some of the parameters are
not provided, or the channel type is not 'video',
or if the recording time is longer than 3 hours.
401 Unauthorized
Note that different error cases that rise a 400 HTTP message are checked on client side and notified to the user before
the insert HTTP request is sent.
{
"from_time":"2008-02-04 11:00:00",
"ch_name":"Mtv",
"to_time":"2008-02-04 12:30:00",
"ch_type":"video",
"retention":"3",
"repeat":"no_repeat",
"format":"portable",
"title":"Into the music"
}
The allowed value for the different field are:
URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/recordings
method: POST
Request Body: JSON object containing the parameters of the recording to change, and the id
of the recording that is going to be modified
Returns: 200 OK
401 Unauthorized
500 Internal server error in case some modification errors occur (that is any
error that can occur during the insert method, used in conjuction with the
delete method to do the modify)
An example of the JSON object sent to the server to specify the modification of some given parameters is:
{
"id_rec":"411206",
"ch_type":"video",
"repeat":"weekly",
"from_time":"2008-02-04 12:30:00",
"ch_name":"Mtv",
"retention":"3",
"title":"Into the music",
"format":"portable",
"to_time":"2008-02-04 11:00:00"
}
5 - Delete an existing recording.URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/delete_recording method: GET Querystring: id_rec identification number of the recording to delete Returns: 200 OK (Delete Done) 401 Unauthorized 404 Not found if the user tries to delete a non-existent recording6 - Return Faucet RSS feed for the user.
URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/feed
method: GET
Querystring: no parameters needed
Returns: 200 OK & JSON object containing the URL for the Faucet RSS feed (podcast)
containing the recorder items
401 Unauthorized
An example of the JSON object returned by the server is the following:
{
"feed_url":"http://www.vcast.it/JPodcast/Vfaucet/........"
}
7 - Return Faucet internal user identifier.URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/faucetid method: GET Querystring: no parameters needed Returns: 200 OK & JSON object containing Faucet unique id_usr 401 UnauthorizedAn example of the JSON object returned by the server is the following:
{
"id_usr":"411202"
}
8 - Return the URL that publishes the list of the active recording criteria.URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/activerecfeedurl method: GET Querystring: no parameters needed Returns: 200 OK & JSON object containing the array of the recordings 401 UnauthorizedAn example of the JSON object returned by the server is the following:
{
"active_rec_url":"http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/activerecordings?K=yreorpeutrreuqirpqwiu"
}
9 - Enable a faucet user.URL: http://www.vcast.it/faucetpvr/api/1.0/server_rest.php/enableuser method: GET Returns: 200 OK (Enable user done) 401 Unauthorized 400 Faucet user already exists
Faucet API License
VCAST FAUCET, API LICENSE AGREEMENT