Message Boards Message Boards

Dropbox API version change and ServiceConnect

GROUPS:

Dropbox has updated their access API causing the

ServiceConnect["Dropbox"]

to now return an error message:

<|"Error" -> "v1_retired"|>

I deleted the cached connection info stored in ~/Library/Mathematica/Paclets associated with Dropbox and same problem.

Is there a workaround?

POSTED BY: Philip Zecher
Answer
1 month ago

Hi Philip,

We have worked on updating our connection to Dropbox following their API update. We'll be releasing an update very soon for our users.

Let me get back to you ASAP to keep you updated.

Thanks

POSTED BY: Christian Pasquel
Answer
1 month ago

Thanks for the quick reply. It's amazing how rapidly this functionality became integral to a lot of notebooks.

POSTED BY: Philip Zecher
Answer
1 month ago

Hey Philip,

Our update have gone through QA and will soon be released (hopefully today). I'll keep you updated.

POSTED BY: Christian Pasquel
Answer
1 month ago

When is the ServiceConnect framework gonna be documented (with, of course, a disclaimer on the doc pages that everything is subject to breaking changes at any time)?

I took it apart to see how it works so I could use it for my own stuff and it's turned out to be super useful to be able to make my own service connections. I'm sure I missed thing, though and I think you'd have a happy user-base if you provided them with a tutorial on it at the minimum.

POSTED BY: b3m2a1 .
Answer
1 month ago

We are actually working on a better framework that will allow users to create their own ServiceConnections easily so you won't have to dissect the code to create your own connections. That framework will be documented when it's released.

POSTED BY: Christian Pasquel
Answer
1 month ago

You can always edit the paclet to get it to work again.

Open this file:

FileNameJoin@{#,
     "Kernel",
     "Dropbox.m"
     } &@
  PacletFind["ServiceConnection_Dropbox"][[1]][
   "Location"] // SystemOpen

And patch the "URL" parameters in all of the DownValues of dropboxdata

e.g. this:

dropboxdata["RawFileRestore"] = {
        "URL"          -> (ToString@StringForm["https://api.dropbox.com/1/restore/`1`", formatrootpath[##]]&),
        "PathParameters"    -> {"Root","Path"},
        "Parameters"       -> {"rev","locale"},
        "RequiredParameters"-> {"Root","Path","rev"}, 
        "HTTPSMethod"     -> "POST",
        "ResultsFunction"   -> dropboximportjson
    }   

would turn into this (or something like it):

dropboxdata["RawFileRestore"] = {
        "URL"          -> (ToString@StringForm["https://api.dropbox.com/1/files/restore/`1`", formatrootpath[##]]&),
        "PathParameters"    -> {"Root","Path"},
        "Parameters"       -> {"rev","locale"},
        "RequiredParameters"-> {"Root","Path","rev"}, 
        "HTTPSMethod"     -> "POST",
        "ResultsFunction"   -> dropboximportjson
    }   

Is it annoying? Sure. But it'll work. And if you like the ServiceConnect framework, it's always nice to know how to customize it for your own stuff.

POSTED BY: b3m2a1 .
Answer
1 month ago

A new Dropbox paclet has been pushed live which will resolve this issue. Basically the issue was due to Dropbox has stopped version 1 api support. More information at https://blogs.dropbox.com/developers/2017/06/updated-api-v1-deprecation-timeline/ The new paclet supports v2 apis which are new and faster.

In[3]:= PacletUpdate["ServiceConnection_Dropbox"]

Out[3]= PacletManager`Paclet[
"Name" -> "ServiceConnection_Dropbox", "Version" -> "11.2.0", 
 "MathematicaVersion" -> "11.0+", 
 "Extensions" -> {{
   "Kernel", "Root" -> "Kernel", 
    "Context" -> {"Dropbox`", " DropboxLoad`"}}, {
   "Documentation", "MainPage" -> "ReferencePages/Symbols/Dropbox", 
    "Language" -> "English"}}, 
 "Location" -> "/Users/damanjits/Library/Mathematica/Paclets/\
Repository/ServiceConnection_Dropbox-11.2.0"]

In[4]:= Quit

In[1]:= RebuildPacletData[]

In[2]:= dropbox = ServiceConnect["Dropbox"]

Out[2]= ServiceObject["Dropbox", 
 "ID" -> "connection-cce5eb7df530d3b6cb6d12ac438d97c8"]

In[4]:= dropbox["UserData"]

Out[4]= <|"ReferralLink" -> "https://db.tt/G06FmxYB", 
 "Disabled" -> False, "IsPaired" -> False, 
 "Email" -> "testwolfram1@gmail.com", 
 "AccountID" -> "dbid:AAALg-wp1VzCpe-BncerqAd442vQb9PkfHo", 
 "Name" -> {"FamiliarName" -> "Test", "GivenName" -> "Test", 
   "AbbreviatedName" -> "TW", "Surname" -> "Wolfram", 
   "DisplayName" -> "Test Wolfram"}, "EmailVerified" -> True, 
 "Country" -> "US", "AccountType" -> {"Tag" -> "basic"}, 
 "Locale" -> "en"|>

In[5]:= dropbox["FileNames", "Path" -> "/WolframGraphics"]

Out[5]= Dataset[ <> ]

In[7]:= dropbox[
  "DirectoryTreePlot", {"Path" -> "/", "Recursive" -> True}] // Head

Out[7]= Graphics

Notice the change in parameters of DirectoryTreePlot, "Root" parameter is no longer used in all the requests. Instead File/Directory path should start with '/'. These minor documentation tweaks will be available soon in online documentation.

POSTED BY: Damanjit Singh
Answer
1 month ago

Thank you Wolfram Team for the quick-turn around.

POSTED BY: Philip Zecher
Answer
1 month ago

Group Abstract Group Abstract