We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

torarne's avatar
torarne
Explorer | Level 3
3 months ago

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

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.

  • 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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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's avatar
      torarne
      Explorer | Level 3

      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 🙂

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API

Make connections with other developers

795 PostsLatest Activity: 5 days ago
192 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!