cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Learn more about how Connie, a member of the Community, uses 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: 

Using token with API v2.

Using token with API v2.

Douglas16
Explorer | Level 4

Hello guys, I learning about API v2, I was read the API commands and testing, so in my first commad teste I have a trouble, I try type the command:

 

curl -X POST https://api.dropboxapi.com/2/files/copy --header 'Authorization: Bearer null' --header 'Content-Type: application/json' --data '{"from_path":"","to_path":""}'  

 

and the output returns:  "Error in call to API function "files/copy": The given OAuth 2 access token is malformed."

 

I've been looking for this one from OAuth and the token, in the docs of dropbox I find the OAuth guide (https://www.dropbox.com/developers/reference/oauth-guide)...hear say that I should have a token to use this OAuth,  and to I can have a token I need to create an application...I would like to know if it is possible generate a token(https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/) without create an application...just to I testing the commands of API...

 

Att:

I create an application in "My apps" section...but when I try to generate a token, 'generate access token' button in the settings section of the app I receive:  "You must be a team administrator to perform this operation."

 

So: what I need to do to be a team administrator?

 

 

Any help be apreciated, thanks in advanced!

 

1 Accepted Solution

Accepted Solutions

Re: Using token with API v2.

Greg-DB
Dropboxer

1. I'm not sure what part of my message are you referring to when you say "admins team", as I didn't use that exact term, but a Dropbox for Business team is a paid level of Dropbox service built for businesses. Some members of these teams are designated as "admins" and have additional abilities that other members don't. 

 

2. Yes, using a Dropbox API (not Business) app you can generate a token for your own account. It sounds like you're not on a Business team or trying to use Business functionality, so you should use a normal Dropbox API app.

View solution in original post

4 Replies 4

Re: Using token with API v2.

Greg-DB
Dropboxer

In order to make an API call like /2/files/copy, you do need an access token, and to get an access token, you do need to register an app. (The app registration defines what kind of access the resulting access tokens enable.) There's no harm in registering an app though. You can rename or delete it later if you want.

 

The first error you got indicates that the token you're passing (in your case the string "null") is invalid.

 

The second error you got indicates that you registered a Dropbox Business API app, which can only be linked by Dropbox Business team admins. If you're on a Business team and need to be an admin, you'll need to request that change from an existing admin.

 

If you don't need Dropbox Business API functionality though (e.g., /2/files/copy isn't only Business functionality) you can register a Dropbox API app, as opposed to a Dropbox Business API app, here:

 

https://www.dropbox.com/developers/apps/create

Re: Using token with API v2.

Douglas16
Explorer | Level 4

hmmm, ok I understood in parts...

 

1 - what is exaclyt the dropbox business "admins team"  ? 

 

2 -  So, if I create an Dropxbox API instead a Dropbox Business API I can generate a token without any problem?

 

 

Thanks for your time,friend!

Re: Using token with API v2.

Greg-DB
Dropboxer

1. I'm not sure what part of my message are you referring to when you say "admins team", as I didn't use that exact term, but a Dropbox for Business team is a paid level of Dropbox service built for businesses. Some members of these teams are designated as "admins" and have additional abilities that other members don't. 

 

2. Yes, using a Dropbox API (not Business) app you can generate a token for your own account. It sounds like you're not on a Business team or trying to use Business functionality, so you should use a normal Dropbox API app.

View solution in original post

Re: Using token with API v2.

Douglas16
Explorer | Level 4

Thanks for your time dude!

Poll
Which Dropbox integrations are you using while working from home?
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?