cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

In PHP : How to detect that DropBox won't hang?

In PHP : How to detect that DropBox won't hang?

Kevin P.22
New member | Level 1

Hi

I'm following the example PHP for authentication - no problem.

  1. you create a link for them to go to DropBox page
  2. They "allow" and are given a authorization code
  3. they paste that into your awaiting code
  4. you can the call : list($accessToken, $dropboxUserId) = $webAuth->finish($authCode); to obtain $accessToken.

BUT if the user DOES NOT authenticate and obtain a valid authorisation code from the dropbox page -
and they paste junk into your code AND you then call the above list(....

DropBox does not return at all and a blank screen is displayed.

I've tried everything to detect that it's OK to make the call - but can't find anything that would indicate $authCode is not genuine and a crash will follow.

Any ideas....???

Thanks

1 Reply 1

Re: In PHP : How to detect that DropBox won't hang?

Steve M.
Dropboxer

I assume that when you pass an invalid authorization code to finish, it raises an exception. So wrap the call in a try/catch and handle that exception.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropboxer
What do Dropbox user levels mean?
Need more support?