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: 

PHP Login with Dropbox issues.

PHP Login with Dropbox issues.

SAFCLiam
New member | Level 2

Hello, im following the guide on how to use the APIs so my app can use Login with Dropbox. But im having issues getting a token.

This is my code to see why im getting the following error.

<?php

$request = new HttpRequest();
$request->setUrl('https://api.dropboxapi.com/2/auth/token/from_oauth1');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'postman-token' => '273abf8c-7816-67c2-0949-f24bfc57383c',
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'authorization' => 'Basic m1qbv920v0xwxlm:xxxxxx'
));

$request->setBody('{
    "oauth1_token": "m1qbv920v0xwxlm",
    "oauth1_token_secret": "xxxxx"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

This is the error.

{
    "error_summary": "invalid_oauth1_token_info/.",
    "error": {
        ".tag": "invalid_oauth1_token_info"
    }
}
1 Reply 1

TaylorKrusen
Dropbox Staff

The specific /2/auth/token/from_oauth1 endpoint you're using is only be for migrating legacy OAuth 1 access tokens to OAuth 2. If you're just building your app now, you wouldn't have any OAuth 1 access tokens so you wouldn't need to use that endpoint.


The full documentation for the Dropbox OAuth endpoints can be found here. Another helpful resource is our OAuth developer guide

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    TaylorKrusen Dropbox Staff
What do Dropbox user levels mean?