cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

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.

Highlighted

PHP Login with Dropbox issues.

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 m1qbv920v0xwxlmxxxxx'
));

$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
Highlighted

Re: PHP Login with Dropbox issues.

Dropboxer

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

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?