Hi
Has anyone managed to setup a link to dropbox to upload job files using the HTTP Configurator.
I have created an app on the account and obtained a token but I keep getting "401" Uthentification errors.
Dropbox Settings
Re: Dropbox Settings
If you look at the documentation in the Scripting help for HTTP it shows how to do this in the scripting interface:
I don't see why you couldn't do the same with the HTTP element if you set the following properties:
Code: Select all
function jobArrived( s : Switch, job : Job )
{
var theHTTP = new HTTP( HTTP.SSL );
theHTTP.authScheme = HTTP.OauthAuth;
theHTTP.authorization = "authorization string";
theHTTP.setAttachedFile( job.getPath() );
theHTTP.url = "https://api-content.dropbox.com/1/files_put/auto/Test.pdf";
theHTTP.post();
job.log( 4, "Upload started", 100);
while( !theHTTP.waitForFinished( 3 ) )
{
job.log( 5, "Uploading...", theHTTP.progress() );
}
job.log( 6, "Upload finished" );
job.log( 1, "Server response: %1", theHTTP.getServerResponse().toString( "UTF-8" ) );
if( theHTTP.finishedStatus == HTTP.Ok && theHTTP.statusCode == 200 )
{
job.log( 1, "Upload completed successfully" );
}
else
{
job.fail( "Upload failed with the status code %1", theHTTP.statusCode );
return;
}
job.sendToSingle( job.getPath() );
}
- URL: https://api-content.dropbox.com/1/files ... o/Test.pdf
- Request type: POST
- Attached file (use Single-line text with variables defined to select job -> path
- Authorization scheme: OAuth
- Authorization: Your token
Re: Dropbox Settings
I'm not sure if the HTTP element uses SSL or not, that would be a possible hangup.