Podcast

From DriveCast Wiki

Jump to: navigation, search

GET

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

Returns the list of the UID in the podcast

curl --user username:password "http://www.drivecast.eu/api/1.0/podcast?apikey=ABCDEFGHILMNOPQ"

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

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<feedPodcasts>http://drivecast.eu/rss/podcasts.php?podcasts=ABCDEFGHILMNOPQ</feedPodcasts> 
<uid>T1MQ</uid>
<uid>j1MA</uid>

curl --user username:password "https://drivecast.eu/api/1.0/podcast?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>feedPodcasts</key>
   <string>http://drivecast.eu/rss/podcasts.php?podcasts=ABCDEFGHILMNOPQ</string>
   <key>uid</key>
   <array>
     <string>T1MQ</string>
     <string>j1MA</string>
   </array>
 </dict>
</plist>



GET detail

  URL:        https://drivecast.eu/api/1.0/podcast/<UID>
  Methods:    GET
  Returns:    200 OK + object with the info about the item identified by the UID
              401 Unauthorized
              404 podcast 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/podcast/<UID>?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"OK",
"title":"Caterpillar",
"description":"Description"
}
curl --user username:password "https://drivecast.eu/api/1.0/podcast/<UID>?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<title>Caterpillar</title>
<description>Description</description>
<subscription_type>Only the last 3 episodes</subscription_type>
curl --user username:password "https://drivecast.eu/api/1.0/podcast/<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>Caterpillar</string>
   <key>description</key>
   <string>Description</string>
   <key>subscription_type</key>
   <string>Only the last 3 episodes</string>
 </dict>
</plist>

DELETE

   URL:        https://drivecast.eu/api/1.0/podcast/<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/podcast/<UID>?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"OK"
}
curl --user username:password -X DELETE "https://drivecast.eu/api/1.0/podcast/<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/podcast/<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/podcast
   Methods:    POST
   Returns:    200 OK
               401 Unauthorized
               501 Error Message
   Formats:    No other data that the HTTP status code is returned


curl --user username:password -X POST -d '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"Insert OK"}


curl --user username:password -X POST -d '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast?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 '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast?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/podcast/<UID>
   Methods:    PUT
   Returns:    200 OK
               401 Unauthorized
               404 podcast does not exis
               501 Error Message
   Formats:    No other data that the HTTP status code is returned


curl --user username:password -X PUT -d '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast/<UID>?apikey=ABCDEFGHILMNOPQ"

{"statuscode":"200",
"statusdesc":"Update OK"}


curl --user username:password -X PUT -d '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast/<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 '{"podcast_url":"http://rss.cnn.com/services/podcasting/newscast/rss.xml","podcast_title":"Cnn Title Modified","podcast_description":"Podcast Description MODIFIED"}' "https://drivecast.eu/api/1.0/podcast/<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