API 2.0 radio

From DriveCast Wiki

Jump to: navigation, search

GET

  URL:        https://drivecast.eu/api/2.0/radio/[<UID>]
  Methods:    GET
  Returns:    200 OK + object containing the arrays of the recordings
              401 Unauthorized
  Formats:    json (default), xml, plist

Returns the list of the available radios and the information about the datetime of the most recent modification done to the returned radio info

curl --user username:password "https://drivecast.eu/api/2.0/radio/[<UID>]?apikey=ABCDEFGHILMNOPQ"

{
  "statuscode":"200",
  "statusdesc":"OK",
  "last_modified:"2010-07-08T10:31:44Z",
  "elements":[
     {
        "uid":"Q=M=",
        "radio_name":"Radio105",
        "country_code":"IT",
        "language_code":"IT"
     },
     {
        "uid":"g=M=",
        "radio_name":"RDS",
        "country_code":"IT",
        "language_code":"IT"
     }
  ]
}


curl --user username:password "https://drivecast.eu/api/2.0/radio/[<UID>]?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<last_modified>2010-07-08T10:31:44Z</last_modified>
<elements>
  <element>
    <uid>Q=M=</uid>
    <radio_name>Radio105</radio_name>
    <country_code>IT</country_code>
    <language_code>IT</language_code>
  </element>
  <element>
    <uid>g=M=</uid>
    <radio_name>RDS</radio_name>
    <country_code>IT</country_code>
    <language_code>IT</language_code>
  </element>
</elements>


curl --user username:password "https://drivecast.eu/api/2.0/radio/[<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>last_modified</key>
  <string>2010-07-08T10:31:44Z</string>
  <key>elements</key>
  <array><key>uid</key>
  <string>Q=M=</string>
  <key>radio_name</key>
  <string>Radio105</string>
  <key>country_code</key>
  <string>IT</string>
  <key>language_code</key>
  <string>IT</string>
  <key>uid</key>
  <string>g=M=</string>
  <key>radio_name</key>
  <string>RDS</string>
  <key>country_code</key>
  <string>IT</string>
  <key>language_code</key>
  <string>IT</string>
</array>
</dict>

CONDITIONAL GET

  URL:        https://drivecast.eu/api/2.0/radio/if_mod_since/[datetime]
  Methods:    GET
  Returns:    200 OK + object containing the arrays of the recordings
              401 Unauthorized
  Formats:    json (default), xml, plist

The conditionl radio query is designed to allow to check if the radio list a client could have stored, has been updated since it was get. If something was updated after the given datetime (specified in the ISO8601 format), the full list is returned (as from the call https://drivecast.eu/api/2.0/radio)

curl --user username:password "https://drivecast.eu/api/2.0/radio/if_mod_since/2010-07-08T10:31:44Z?apikey=ABCDEFGHILMNOPQ"

{
 "statuscode":"200",
 "statusdesc":"OK",
 "not_modified_since: 2010-07-08T10:31:44Z"
}
curl --user username:password "https://drivecast.eu/api/2.0/radio/if_mod_since?fmt=xml&apikey=ABCDEFGHILMNOPQ"

<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<statusdesc>OK</statusdesc>
<not_modified_since>2010-07-08T10:31:44Z</not_modified_since>
curl --user username:password "https://drivecast.eu/api/2.0/radio/if_mod_since?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>not_modified_since</key>
 <string>2010-07-08T10:31:44Z</string>
</dict>
Personal tools