Dropbox Livecode Library

Find out what's going on with LiveCode (the company), product releases, announcements, and events.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

sphere
Posts: 710
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: Dropbox Livecode Library

Post by sphere » Sat May 16, 2015 9:40 pm

Great ! That would be very good news!

Thanks for sharing Mikey.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

sphere
Posts: 710
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: Dropbox Livecode Library

Post by sphere » Tue Jun 16, 2015 9:39 pm

Hi,

i sometimes have issues writing to dropbox. Now i made the windows program so that when sending a text file to dropbox that it will be read out again. Just to check that has actually send to dropbox.
And it does return the text i wrote. But sometimes after a refresh and reading out again, i do not get the text which was previously checked. So that's strange.
So partly it works. Maybe it has to do on what network you are. At home i have almost no problems(except that it is rather slow, but ok). On my job i get sometimes the error can't read, allthough the connection is ok.

So that's a bit weird and also difficult to check out where the actual fault may be.

Also not to quick sending a text file after each other does help a bit.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

gmccarthy
Posts: 62
Joined: Sat Feb 17, 2007 4:56 am
Location: Australia

Re: Dropbox Livecode Library

Post by gmccarthy » Mon Oct 19, 2015 11:15 am

In the App console in dropbox there is a button to Generate an access token.
The info popup next to it says:
By generating an access token, you will be able to make API calls for your own account without going through the authorization flow. To obtain access tokens for other users, use the standard OAuth flow.

Now, I would like to use this access token for API calls, instead of going through the auth flow using Connect and Authorize that are in the test stack that comes in phxDropboxLib.zip
Can anyone tell me how to use this access token?
gmcrev

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Dropbox Livecode Library

Post by gpb01 » Mon Oct 19, 2015 12:21 pm

@ gmccarthy:

My library use OAuth 1 and I suppose you can't use the access token valid for OAuth 2.

Anyway, remember that, as Dropbox points out, by generating an access token, you will be able to make API calls for your own account without going through the authorization flow. To obtain access tokens for other users, use the standard OAuth flow.

So, in a real application for "users" ... you have to use the standard OAuth flow ;)

Guglielmo

gmccarthy
Posts: 62
Joined: Sat Feb 17, 2007 4:56 am
Location: Australia

Re: Dropbox Livecode Library

Post by gmccarthy » Mon Oct 19, 2015 12:57 pm

The real life situtaion that I am working with involves a group of about 20 people who would have a livecode built desktop application that would access a dropbox designed just for the group. The desktop application would automatically copy certain files from the dropbox to their computer. The people in the group would enter new data and upload a new file containing that to the dropbox.

One of the group would setup the dropbox account. The rest would not have dropbox accounts. I would like their desktop application to do the authorization automatically as if the dropbox account was theirs. Hence avoiding standard OAuth flow.

Can anyone help with a modfication to the library to enable use of the access token of which I referred?
gmcrev

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Dropbox Livecode Library

Post by gpb01 » Mon Oct 19, 2015 1:14 pm

gmccarthy wrote: ... One of the group would setup the dropbox account. ...
This you can already do ... just authorize one time on the first system and copy the tokens on all the others ;)

Guglielmo

gmccarthy
Posts: 62
Joined: Sat Feb 17, 2007 4:56 am
Location: Australia

Re: Dropbox Livecode Library

Post by gmccarthy » Mon Oct 19, 2015 1:18 pm

OK, I'll give that a try.
Thanks.
gmcrev

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Mon Oct 19, 2015 1:30 pm

This is exactly what we are doing, with multiple apps. We don't copy the files to each user's machine so that they can find and break it. We import the files into a local database in LC, and then push them back up to dropbox. So, dropbox is being used as, in effect, a cheap man's online database, or version control system, etc.

Just so you are aware, Monte also has Dropbox externals. I would suspect he's using Oauth2, since it was required for the mergGoogle external he wrote for us. The advantage of his externals is that everything is asynchronous, so there's no waiting for your app to sync. The bad news is that you would have to pay for the externals...

makeshyft
Posts: 187
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Dropbox Livecode Library

Post by makeshyft » Sat May 28, 2016 5:30 pm

Thank you for this!
Tom @
http://www.makeshyft.com
---------------------------------
Changing the Future, Today!

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Sat May 28, 2016 9:48 pm

Everyone,
Two weeks ago, Dropbox made some changes. Now, the phx_dropboxAvailable function will not work. The way it worked was to send Dropbox a malformed URL so that it would get an error message back. Since the library got a reply, it knew Dropbox was available. With the new behavior, the error is not returned, so the function will fail. The solution is to stop using the function, until someone rewrites it.

Guillermo is no longer working on the library, so it will be up to us to do it.

gmccarthy
Posts: 62
Joined: Sat Feb 17, 2007 4:56 am
Location: Australia

Re: Dropbox Livecode Library

Post by gmccarthy » Sat May 28, 2016 11:28 pm

Also, if there are those who would like to continue my work on my shared stack for dropbox API v2 that would be great for the community.
See: http://livecodeshare.runrev.com/stack/794/DropboxAPI_2
gmcrev

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Dropbox Livecode Library

Post by gpb01 » Sun May 29, 2016 10:40 am

Mikey wrote:Everyone,
Two weeks ago, Dropbox made some changes. Now, the phx_dropboxAvailable function will not work....
This is true ... verified ... :)
Mikey wrote: Guglielmo is no longer working on the library, so it will be up to us to do it.
... not totally correct ;) ... let's say that I have very little time to devote to it, but ... this was quite easy to fix, just creating a valid request with missing parameters to get the error :)

New version 1.09 attached ... please test and report if this work. Thanks :)

Guglielmo
Attachments
phxDropBoxLib.zip
(14.13 KiB) Downloaded 110 times

sphere
Posts: 710
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: Dropbox Livecode Library

Post by sphere » Sun May 29, 2016 4:44 pm

This is great!

Thank you very much Guglielmo :D !
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Sun May 29, 2016 5:13 pm

My apologies, Gug. From our email exchange, I thought you were not working on it anymore.

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Dropbox Livecode Library

Post by gpb01 » Sun May 29, 2016 6:26 pm

Mikey wrote:My apologies, Gug. From our email exchange, I thought you were not working on it anymore.
Absolutely no problems Mike :) ... as I wrote I really have few time for this, but ... in this case the solution was quite easy and fast ...
... hoping that it works :D :D :D

Guglielmo

Post Reply

Return to “Announcements”