API 2.0 recording
From DriveCast Wiki
GET
URL: https://drivecast.eu/api/2.0/recording/[<UID>]
Methods: GET
Returns: 200 OK + object containing the arrays of the recordings
401 Unauthorized
Formats: json (default), xml, plist
Returns the list of recordings
curl --user username:password "https://drivecast.eu/api/2.0/recording/[<UID>]?apikey=ABCDEFGHILMNOPQ"
{
"statuscode":"200",
"statusdesc":"OK",
"elements":[
{
"uid":"D5NA",
"title":"Slager Este",
"radio_name":"SlagerRadio",
"from_time":"2009-06-12 21:01:00",
"to_time":"2009-06-12 22:30:00",
"rectype":"on Web",
"repeat":"daily"
},
{
"uid":"DyNQ",
"title":"Deli Kronika",
"radio_name":"KossuthRadio",
"from_time":"2009-06-23 12:01:00",
"to_time":"2009-06-23 12:31:00",
"rectype":"on Web",
"repeat":"daily"
}
]
}
curl --user username:password "https://drivecast.eu/api/2.0/recording/[<UID>]?fmt=xml&apikey=ABCDEFGHILMNOPQ"
<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<elements>
<element>
<uid>D5NA</uid>
<title>Slager Este</title>
<radio_name>SlagerRadio</radio_name>
<from_time>2009-06-12 21:01:00</from_time>
<to_time>2009-06-12 22:30:00</to_time>
<rectype>on Web</rectype>
<repeat>daily</repeat>
</element>
<element>
<uid>DyNQ</uid>
<title>Deli Kronika</title>
<radio_name>KossuthRadio</radio_name>
<from_time>2009-06-23 12:01:00</from_time>
<to_time>2009-06-23 12:31:00</to_time>
<rectype>on Web</rectype>
<repeat>daily</repeat>
</element>
</elements>
curl --user username:password "https://drivecast.eu/api/2.0/recording/[<UID>]?fmt=plist&apikey=ABCDEFGHILMNOPQ" <?xml version="1.0" encoding="UTF-8"?> <dict> <key>statuscode</key> <string>200</string> <key>statusdesc</key> <string>OK</string> <key>elements</key> <array> <key>uid</key> <string>D5NA</string> <key>title</key> <string>Slager Este</string> <key>radio_name</key> <string>SlagerRadio</string> <key>from_time</key> <string>2009-06-12 21:01:00</string> <key>to_time</key> <string>2009-06-12 22:30:00</string> <key>rectype</key> <string>on Web</string> <key>repeat</key><string>daily</string> <key>uid</key> <string>DyNQ</string> <key>title</key> <string>Deli Kronika</string> <key>radio_name</key> <string>KossuthRadio</string> <key>from_time</key> <string>2009-06-23 12:01:00</string> <key>to_time</key> <string>2009-06-23 12:31:00</string> <key>rectype</key> <string>on Web</string> <key>repeat</key> <string>daily</string> </array> </dict>
DELETE
URL: https://drivecast.eu/api/2.0/recording/<UID>
Methods: DELETE
Returns: 200 OK
401 Unauthorized
404 UID does not exist
Formats: No other data that the HTTP status code is returned
With DELETE the recording associated to the UID is removed
curl --user username:password -X DELETE "https://drivecast.eu/api/2.0/recording/<UID>?apikey=ABCDEFGHILMNOPQ"
{"statuscode":"200",
"statusdesc":"OK"
}
curl --user username:password -X DELETE "https://drivecast.eu/api/2.0/library/<UID>?fmt=xml&apikey=ABCDEFGHILMNOPQ" <?xml version="1.0" encoding="UTF-8"?> <statuscode>200</statuscode> <statusdesc>OK</statusdesc>
curl --user username:password -X DELETE "https://drivecast.eu/api/2.0/recording/<UID>?fmt=plist&apikey=ABCDEFGHILMNOPQ" <?xml version="1.0" encoding="UTF-8"?> <plist> <dict> <key>statuscode</key> <string>200</string> <key>statusdesc</key> <string>OK</string> </dict> </plist>
POST
With POST a new record is inserted on the base of the object in the posted data
URL: https://drivecast.eu/api/2.0/recording
Methods: POST
Returns: 200 OK
401 Unauthorized
501 Error Message
Formats: No other data that the HTTP status code is returned
If the user wants to insert a stream, the "radio_idname" value must be: "Radio Stream" and new parameter: "radio_fullname" is mandatory, and that contains the stream url.
curl --user username:password -X POST -d '{"radio_idname":"KossuthRadio","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording?fmt=xml&apikey=ABCDEFGHILMNOPQ"
{"statuscode":"200",
"statusdesc":"Insert OK",
"uid":"T1NE"}
curl --user username:password -X POST -d '{"radio_idname":"KossuthRadio","timezone_used":"user","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording?fmt=xml&apikey=ABCDEFGHILMNOPQ"
<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>Insert OK</statusdesc>
<uid>T1NE</uid>
curl --user username:password -X POST -d '{"radio_idname":"KossuthRadio","timezone_used":"user","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording?fmt=plist&apikey=ABCDEFGHILMNOPQ"
<?xml version="1.0" encoding="UTF-8"?>
<plist>
<dict>
<key>statuscode</key>
<string>200</string>
<key>statusdesc</key>
<string>Insert OK</string>
<key>uid</key>
<string>T1NE</string>
</dict>
</plist>
PUT
With PUT a UID is updated on the base of the object in the posted data
URL: http://drivecast.eu/api/2.0/recording/<UID>
Methods: PUT
Returns: 200 OK
401 Unauthorized
404 recording does not exist
501 Error Message
Formats: No other data that the HTTP status code is returned
curl --user username:password -X PUT -d '{"radio_idname":"KossuthRadio","timezone_used":"radio","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording/<UID>?fmt=xml&apikey=ABCDEFGHILMNOPQ"
{"statuscode":"200",
"statusdesc":"Update OK"}
curl --user username:password -X PUT -d '{"radio_idname":"KossuthRadio","timezone_used":"user","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording/<UID>?fmt=xml&apikey=ABCDEFGHILMNOPQ"
<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>Update OK</statusdesc>
curl --user username:password -X PUT -d '{"radio_idname":"KossuthRadio","timezone_used":"user","from_time":"2009-05-24 10:11:12","to_time":"2009-05-24 11:10:12","repeat":"weekly","rectype":"on cloud","keep":"2","title":"szia UJ"}' "https://drivecast.eu/api/2.0/recording/<UID>?fmt=plist&apikey=ABCDEFGHILMNOPQ"
<?xml version="1.0" encoding="UTF-8"?>
<plist>
<dict>
<key>statuscode</key>
<string>200</string>
<key>statusdesc</key>
<string>Update OK</string>
</dict>
</plist>
