You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

cgeeklucky's avatar
cgeeklucky
Explorer | Level 4
7 years ago

File properties

Can anyone tell me why exactly I need to create a team to add file attributes to a file?

All I want to do is add a single attribute called "FileParentIdentifier" (which will hold a string value i.e name of folder".

It is very easy to add a custom attribute to file in Google Drive SDK.

But in Dropbox, we need to create a team, then create a template, then add file properties.

I have read the document but still confused if I need to create a Business Dropbox or not. I am currently not using business API. 

 

If I require a team, then how will this affect users of my app. 

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    A "team" refers to a Dropbox Business level collection of accounts. If you're interested, you can find more information here:

    https://www.dropbox.com/business

    Note that you don't need a Dropbox Business team to use the file properties functionality on the Dropbox API though:

    https://www.dropbox.com/developers/documentation/http/documentation#file_properties

    You can use a "full Dropbox" app to create templates that you can apply to files, whether or not the linked account is part of a Business team. (There is also a concept of templates owned by teams, but that is not required.)

    So, in short, you can:
    1. Register a full Dropbox app, if you haven't already: https://www.dropbox.com/developers/apps/create
    2. Connect a user using the OAuth flow: https://www.dropbox.com/developers/reference/oauth-guide
    3. Create a template using/2/file_properties/templates/add_for_user : https://www.dropbox.com/developers/documentation/http/documentation#file_properties-templates-add_for_user
    4. Add file properties for your template to any number of files using /2/file_properties/properties/add: https://www.dropbox.com/developers/documentation/http/documentation#file_properties-properties-add
    • cgeeklucky's avatar
      cgeeklucky
      Explorer | Level 4
      Thank you for your reply .
      I have already tried above method .
      I am using full dropbox app and using dropbox sdk.
      I tried to upload a file with property groups , (I created template, then created property field using property field init method , added to property group array. For the property group template_id, I used same template id obtained in response when creating template).
      But some how , it is failing . I could successfully upload a file, but metadata of uploaded file do not contain property group parameter.
      I was able to figure out the error. It is "template do not fit ".
      I have already googled lot for this error , but do not know what is going wrong .

      I have one more confusion, do we need to create a separate template for each file . If not, how do I obtain single template ID I already created for all files.
      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        It sounds like you're referring to the 'does_not_fit_template' error, which is documented as:

        "One or more of the supplied property fields does not conform to the template specifications."

         

        That means that the property fields that you're attempting to set for that file do not match the template you are using. You'll need to change your code to match the template you're using.

         

        You do not need to create a new template for each file. You can use a single template on any number of files. You can use /2/file_properties/templates/list_for_user to list existing templates.

         

        By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. You did mention you're using an SDK, but you didn't mention which one.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,911 PostsLatest Activity: 3 hours ago
333 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!