cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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

Steve M.
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?