Recording

From DriveCast Wiki

Jump to: navigation, search

GET

  URL:        https://drivecast.eu/api/1.0/recording
  Methods:    GET
  Returns:    200 OK + object containing the arrays of the recordings
              401 Unauthorized
  Formats:    json (default), xml, plist

Returns the list of the UID in the recording

curl --user username:password "https://drivecast.eu/api/1.0/recording?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
 "statusdesc":"OK",
 "feedRecordings":"http://drivecast.eu/rss/recordings.php?recordings=ABCDYTRG",
 "uid":["T1MQ","j1MA"]
}
curl --user username:password "https://drivecast.eu/api/1.0/recording?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<feedRecordings>http://drivecast.eu/rss/recordings.php?recordings=ABCDYTRG</feedRecordings>
<uid>T1MQ</uid>
<uid>j1MA</uid>
curl --user username:password "https://drivecast.eu/api/1.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>OK</string>
   <key>feedRecordings</key>
   <string>http://drivecast.eu/rss/recordings.php?recordings=ABCDYTRG</string>
   <key>uid</key>
   <array>
     <string>T1MQ</string>
     <string>j1MA</string>
   </array>
 </dict>
</plist>



GET detail

  URL:        https://drivecast.eu/api/1.0/recording/<UID>
  Methods:    GET
  Returns:    200 OK + object with the info about the item identified by the UID
              401 Unauthorized
              404 recording does not exist
  Formats:    json (default), xml, plist

With GET detail returns the item detail as a single UID object

curl --user username:password "https://drivecast.eu/api/1.0/recording/<UID>?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"OK",
"title":"Salger Este",
"radio_name":"SlagerRadio",
"from_time":"2009-04-20 21:00:00",
"to_time":"2009-04-20 22:45:00",
"rectype":"on Web"
"repeat":"no_repeat/daily/weekly/mon_fri/mon_sat"
}
curl --user username:password "https://drivecast.eu/api/1.0/recording/<UID>?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<title>Salger Este</title>
<radio_name>SlagerRadio</radio_name>
<from_time>2009-04-20 21:00:00</from_time>
<to_time>2009-04-20 22:45:00</to_time>
<rectype>on Web</rectype>
<repeat>no_repeat/daily/weekly/mon_fri/mon_sat</repeat>
curl --user username:password "https://drivecast.eu/api/1.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>
   <key>title</key>
   <string>Salger Este</string>
   <key>radio_name</key>
   <string>SlagerRadio</string>
   <key>from_time</key>
   <string>2009-04-20 21:00:00</string>
   <key>to_time</key>
   <string>2009-04-20 22:45:00</string>
   <key>rectype</key>
   <string>on Web</string>
   <key>repeat</key>
   <string>no_repeat/daily/weekly/mon_fri/mon_sat</string>
 </dict>
</plist>

DELETE

   URL:        https://drivecast.eu/api/1.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 UID is removed

 curl --user username:password -X DELETE "https://drivecast.eu/api/1.0/recording/<UID>?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
 "statusdesc":"OK"
}
curl --user username:password -X DELETE "https://drivecast.eu/api/1.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/1.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 base of the object in the posted data

   URL:        https://drivecast.eu/api/1.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/1.0/recording?fmt=xml&apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"Insert OK"}
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/1.0/recording?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>Insert OK</statusdesc>
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/1.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>
 </dict>
</plist>



PUT

With PUT a UID is updated on the base of the object in the posted data

   URL:        http://drivecast.eu/api/1.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/1.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/1.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/1.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>
Personal tools