Dropbox Settings

Post Reply
Jamesnic7
Newbie
Posts: 6
Joined: Sat Dec 31, 2016 3:21 pm

Dropbox Settings

Post by Jamesnic7 »

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.
cstevens
Member
Posts: 40
Joined: Tue Feb 12, 2013 8:42 pm

Re: Dropbox Settings

Post by cstevens »

If you look at the documentation in the Scripting help for HTTP it shows how to do this in the scripting interface:

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() );
}
I don't see why you couldn't do the same with the HTTP element if you set the following properties:
cstevens
Member
Posts: 40
Joined: Tue Feb 12, 2013 8:42 pm

Re: Dropbox Settings

Post by cstevens »

I'm not sure if the HTTP element uses SSL or not, that would be a possible hangup.
Post Reply