API 2.0 upload - REMOVED
From DriveCast Wiki
(Redirected from API 2.0 upload)
This API for direct upload has been removed after the introduction of the support for cloud storage ad Dropbox and box.net
POST
(step 1)
In order to insert a file to Drivecast the API requires two POST actions.
The first POST contains the attributes like: title, author, description.
URL: https://drivecast.eu/api/2.0/upload
Methods: POST
Returns: 200 OK
401 Unauthorized
Formats: json (default), xml, plist
Returned by the first POST is the a URL destination for the file to be uploaded.
curl --user username:password -X POST -d '{"file_name":"uploaded_file_name.mp3","title":"Title From API","author":"Author from API","description":"Description FROM API","convert":"default"}' "https://drivecast.eu/api/2.0/upload?apikey=ABCDEFGHILMNOPQ"
{"statuscode":"200",
"statusdesc":"OK",
"file_upload_url":http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4
}
curl --user username:password -X POST -d '{"file_name":"uploaded_file_name.mp3","title":"Title From API","author":"Author from API","description":"Description FROM API","convert":"default"}' "https://drivecast.eu/api/2.0/upload?apikey=ABCDEFGHILMNOPQ&fmt=xml"
<?xml version="1.0" encoding="UTF-8"?>
<statuscode>200</statuscode>
<file_upload_url>http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4</file_upload_url >
curl --user username:password -X POST -d '{"file_name":"uploaded_file_name.mp3","title":"Title From API","author":"Author from API","description":"Description FROM API","convert":"default"}' "https://drivecast.eu/api/2.0/upload?apikey=ABCDEFGHILMNOPQ&fmt=plist"
<?xml version="1.0" encoding="UTF-8"?>
<plist>
<dict>
<key>statuscode</key>
<string>200</string>
<key>statusdesc</key>
<string>OK</string>
<key>file_upload_url</key>
<string>http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4</string>
</dict>
</plist>
(step 2)
On the second step you POST the complete file to the URL returned by the first POST.
(using the curl command the -T switch specifies the file to be posted as content).
URL: http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4
Methods: POST
Returns: 200 OK
401 Unauthorized
501 Failed to Store Uploaded File
Formats: json (default), xml, plist
curl -X POST -T uploaded_file_name.mp3 "http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4"
{"statuscode":"200",
"statusdesc":"OK",
"file_url":"http://fb5.drivecast.eu/Fb00050001/6F/94/kcF7Aclb4aWh2OKkOB8h1c1b97A7xeSS/upload_file.mp3"
}
curl -X POST -T uploaded_file_name.mp3 "http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4?fmt=xml" <?xml version="1.0" encoding="UTF-8"?> <statuscode>200</statuscode> <statusdesc>OK</statusdesc > <file_url>http://fb5.drivecast.eu/Fb00050001/6F/94/kcF7Aclb4aWh2OKkOB8h1c1b97A7xeSS/upload_file.mp3</file_url>
curl -X POST -T uploaded_file_name.mp3 "http://fb4.drivecast.eu/Fb00020004/upload/m5oHm5aTEhANG3uTUMxu4BYAGsEipz4?fmt=plist" <?xml version="1.0" encoding="UTF-8"?> <plist> <dict> <key>statuscode</key> <string>200</string> <key>statusdesc</key> <string>OK</string> <key>file_url</key> <string>http://fb5.drivecast.eu/Fb00050001/6F/94/kcF7Aclb4aWh2OKkOB8h1c1b97A7xeSS/upload_file.mp3</string> </dict> </plist>
