cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Discuss Dropbox Developer & API

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

Subject: Issues Adding Tags to Files Using Dropbox API with Refresh Token and Appropriate Scopes

Subject: Issues Adding Tags to Files Using Dropbox API with Refresh Token and Appropriate Scopes

torarne
Explorer | Level 3
Go to solution

Hello Dropbox Community,


I'm encountering an issue when trying to add tags to files using the Dropbox API. Here’s a brief overview of my setup and the problem I’m facing:

Setup:

- API Version: Dropbox API v2
- Authentication: OAuth 2.0 with a refresh token
- Scopes: My app is configured with the necessary individual scopes, including `files.metadata.write` and `file_properties.write`.
- Functionality: I’m attempting to add custom tags to files using the `/file_properties/properties/add` endpoint.

Problem:

Despite having all the necessary permissions and the access token being generated via a refresh token with the correct scopes, I’m unable to successfully add tags to files. The API call fails, and I receive an error response, which suggests that the operation is not permitted or that there is an issue with my setup.

Here is a summary of the steps I’m taking:

1. Authorization: I authenticate using a refresh token to obtain an access token.
2. API Request: I send a POST request to the `https://api.dropboxapi.com/2/file_properties/properties/add` endpoint with the required parameters:
- `path`: The path to the file where I want to add the tag.
- `property_groups`: The tag information, including the template ID and the tag value.
3. Error: The API responds with an error indicating that the tag cannot be added.

What I’ve Tried:

- Ensured that the access token is valid and has the required scopes.
- Verified that the file path and template ID are correct.
- Tested the API call with both shared and non-shared files, and ensured that the file is accessible with the current token.

Question:

Has anyone else encountered a similar issue with adding tags using the Dropbox API? Is there something I might be missing in my setup or the API call? Any insights or suggestions would be greatly appreciated.

Thank you in advance for your help!

---

Feel free to post this in the Dropbox community forums. This detailed description should provide enough context for others to understand your issue and offer potential solutions.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Please share the actual API call request and response so we can take a look at the particular parameters you're using and the exact error you're getting. Be sure to redact your access token though.

 

From the description however, it sounds similar to this thread, so I suggest taking a look at that.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

Please share the actual API call request and response so we can take a look at the particular parameters you're using and the exact error you're getting. Be sure to redact your access token though.

 

From the description however, it sounds similar to this thread, so I suggest taking a look at that.

torarne
Explorer | Level 3
Go to solution

This was the case, I had use postman to create the 

 "template_id": "ptid:dfafddsfdsfdasdf" with the dropbox token. 

I think it should be a warning for users abot this 🙂
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    torarne Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?