<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: File properties in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288690#M17677</link>
    <description>&lt;P&gt;So template itself is custom attribute. (I was dumb to understand that). &lt;BR /&gt;I corrected the code and uploaded a file, uploaded with no error. However, propertyGroups from metadata (upload response) is nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;response from uploading file looks like this.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
    "client_modified" = "2018-08-03T04:34:16Z";
    "content_hash" = fea824f165374189797de317f75058467ddbec03b95755eee30e9612b6c6929e;
    id = "id:vPJIFqqKgdAAAAAAAAABiQ";
    name = "153327085668483.png";
    "path_display" = "/AppFolder/153327085668483.png";
    "path_lower" = "/appfolder/153327085668483.png";
    rev = 2feb83ead00;
    "server_modified" = "2018-08-03T04:34:29Z";
    size = 250930;
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;When I tried to print metadata?.propertyGroups, it returns nil &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more confusion, Is template id constant ? (&amp;nbsp;Can I store the templateID in my realm database, so that I don't have to call&lt;/P&gt;
&lt;P class="p1"&gt;templatesListForUser method again and again )&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 04:49:18 GMT</pubDate>
    <dc:creator>cgeeklucky</dc:creator>
    <dc:date>2018-08-03T04:49:18Z</dc:date>
    <item>
      <title>File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288255#M17635</link>
      <description>&lt;P&gt;Can anyone tell me why exactly I need to create a &lt;STRONG&gt;team&lt;/STRONG&gt; to add file attributes to a file?&lt;/P&gt;&lt;P&gt;All I want to do is add a single attribute called "FileParentIdentifier" (which will hold a string value i.e name of folder".&lt;/P&gt;&lt;P&gt;It is very easy to add a custom attribute to file in Google Drive SDK.&lt;/P&gt;&lt;P&gt;But in Dropbox, we need to create a team, then create a template, then add file properties.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I require a team, then how will this&amp;nbsp;affect users of my app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:11:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288255#M17635</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2019-05-29T09:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288376#M17638</link>
      <description>A "team" refers to a Dropbox Business level collection of accounts. If you're interested, you can find more information here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/business" target="_blank"&gt;https://www.dropbox.com/business&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Note that you don't need a Dropbox Business team to use the file properties functionality on the Dropbox API though:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_properties" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#file_properties&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;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.)&lt;BR /&gt;&lt;BR /&gt;So, in short, you can:&lt;BR /&gt;1. Register a full Dropbox app, if you haven't already: &lt;A href="https://www.dropbox.com/developers/apps/create" target="_blank"&gt;https://www.dropbox.com/developers/apps/create&lt;/A&gt;&lt;BR /&gt;2. Connect a user using the OAuth flow: &lt;A href="https://www.dropbox.com/developers/reference/oauth-guide" target="_blank"&gt;https://www.dropbox.com/developers/reference/oauth-guide&lt;/A&gt;&lt;BR /&gt;3. Create a template using/2/file_properties/templates/add_for_user : &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_properties-templates-add_for_user" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#file_properties-templates-add_for_user&lt;/A&gt;&lt;BR /&gt;4. Add file properties for your template to any number of files using /2/file_properties/properties/add: &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_properties-properties-add" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#file_properties-properties-add&lt;/A&gt;</description>
      <pubDate>Wed, 01 Aug 2018 16:16:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288376#M17638</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-01T16:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288390#M17642</link>
      <description>Thank you for your reply .&lt;BR /&gt;I have already tried above method .&lt;BR /&gt;I am using full dropbox app and using dropbox sdk.&lt;BR /&gt;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).&lt;BR /&gt;But some how , it is failing . I could successfully upload a file, but metadata of uploaded file do not contain property group parameter.&lt;BR /&gt;I was able to figure out the error. It is "template do not fit ".&lt;BR /&gt;I have already googled lot for this error , but do not know what is going wrong .&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Wed, 01 Aug 2018 16:41:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288390#M17642</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2018-08-01T16:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288397#M17644</link>
      <description>&lt;P&gt;It sounds like you're referring to the 'does_not_fit_template' error, which is &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_properties-properties-add" target="_blank"&gt;documented&lt;/A&gt; as:&lt;/P&gt;
&lt;P&gt;"One or more of the supplied property fields does not conform to the template specifications."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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 &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#file_properties-templates-list_for_user" target="_self"&gt;/2/file_properties/templates/list_for_user&lt;/A&gt; to list existing templates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of &lt;A href="https://www.dropbox.com/developers/documentation" target="_self"&gt;the official SDKs&lt;/A&gt; 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.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 17:57:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288397#M17644</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-01T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288481#M17647</link>
      <description>&lt;P&gt;Dropbox SDK I am using is "SwiftyDropbox"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is code snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;               //create template
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let template = FileProperties.PropertyFieldTemplate(name: "FileTemplate", description_: "File's Custom Properties Here", type: .string_)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //add template
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; client?.file_properties.templatesAddForUser(name: "User", description_: "Template for User", fields: [template]).response(completionHandler: { (templateResult, error) in
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if let templateID = templateResult?.templateId {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //upload file using property groups
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //create custom file attribute using property field
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let field = FileProperties.PropertyField(name: "ParentFolderID", value: "123456")
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //create property group, add template id and fields
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let propertyGroup = FileProperties.PropertyGroup(templateId: templateID, fields: [field])

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //upload file with above property group
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let url = AppDirectory.albums.locationUrl.appendingPathComponent("15331256694236.png")

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; client?.files.upload(path: "/AppFolder/\(Date().toString).png", mode: .add, autorename: false, clientModified: Date(), mute: true, propertyGroups: [propertyGroup], input: url).response(completionHandler: { (metadata, error) in

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(metadata)

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I am getting 'does_not_fit_template' error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have followed the same steps. Rather than adding property groups separately using properties/add,&amp;nbsp; I am adding groups while uploading a file. Am I missing anything?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 04:35:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288481#M17647</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2018-08-02T04:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288610#M17668</link>
      <description>&lt;P&gt;It looks like the issue is that you're using a different field name when creating the template and then when trying to apply it later. I.e.:&lt;/P&gt;
&lt;PRE&gt;let template = FileProperties.PropertyFieldTemplate(name: "FileTemplate", description_: "File's Custom Properties Here", type: .string_)
&lt;/PRE&gt;
&lt;P&gt;But then:&lt;/P&gt;
&lt;PRE&gt;let field = FileProperties.PropertyField(name: "ParentFolderID", value: "123456")
&lt;/PRE&gt;
&lt;P&gt;That name "ParentFolderID" should be "FileTemplate" (or whatever you want it to be, as long as you're consistent).&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 18:28:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288610#M17668</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-02T18:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288690#M17677</link>
      <description>&lt;P&gt;So template itself is custom attribute. (I was dumb to understand that). &lt;BR /&gt;I corrected the code and uploaded a file, uploaded with no error. However, propertyGroups from metadata (upload response) is nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;response from uploading file looks like this.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
    "client_modified" = "2018-08-03T04:34:16Z";
    "content_hash" = fea824f165374189797de317f75058467ddbec03b95755eee30e9612b6c6929e;
    id = "id:vPJIFqqKgdAAAAAAAAABiQ";
    name = "153327085668483.png";
    "path_display" = "/AppFolder/153327085668483.png";
    "path_lower" = "/appfolder/153327085668483.png";
    rev = 2feb83ead00;
    "server_modified" = "2018-08-03T04:34:29Z";
    size = 250930;
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;When I tried to print metadata?.propertyGroups, it returns nil &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more confusion, Is template id constant ? (&amp;nbsp;Can I store the templateID in my realm database, so that I don't have to call&lt;/P&gt;
&lt;P class="p1"&gt;templatesListForUser method again and again )&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 04:49:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288690#M17677</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2018-08-03T04:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288691#M17678</link>
      <description>&lt;P&gt;It looks like property groups are added successfully , but it isn't showing in metadata of uploaded file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to get metadata of same file using below method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; client?.files.getMetadata(path: "/Ninja/153327085668483.png", includeMediaInfo: true, includeDeleted: false, includeHasExplicitSharedMembers: false, includePropertyGroups: FileProperties.TemplateFilterBase.filterSome(["ptid:LNRGA28Fu5AAAAAAAAAAtg"])).response(completionHandler: { (meta, error) in
                                    print(meta)
                                })&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;response&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;{
    "client_modified" = "2018-08-03T04:34:16Z";
    "content_hash" = fea824f165374189797de317f75058467ddbec03b95755eee30e9612b6c6929e;
    id = "id:vPJIFqqKgdAAAAAAAAABiQ";
    name = "153327085668483.png";
    "path_display" = "/Ninja/153327085668483.png";
    "path_lower" = "/ninja/153327085668483.png";
    "property_groups" =     (
                {
            fields =             (
                                {
                    name = ParentFolderID;
                    value = A123456;
                }
            );
            "template_id" = "ptid:LNRGA28Fu5AAAAAAAAAAtg";
        }
    );
    rev = 2feb83ead00;
    "server_modified" = "2018-08-03T04:34:29Z";
    size = 250930;
}&lt;/PRE&gt;
&lt;P&gt;Thank you Greg for your&amp;nbsp;replies &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 05:07:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288691#M17678</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2018-08-03T05:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288804#M17688</link>
      <description>Yes, that's expected. The property values won't be returned in the metadata from the upload itself. A successful response as you're receiving does indicate that is was successfully submitted though.&lt;BR /&gt;&lt;BR /&gt;You need to call and explicitly request the property values, as you have done.&lt;BR /&gt;&lt;BR /&gt;And yes, the template ID for a given template doesn't change, so you can and should store and re-use it.</description>
      <pubDate>Fri, 03 Aug 2018 15:41:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288804#M17688</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-03T15:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: File properties</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288809#M17691</link>
      <description>Okay... Thank you. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;</description>
      <pubDate>Fri, 03 Aug 2018 16:14:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/File-properties/m-p/288809#M17691</guid>
      <dc:creator>cgeeklucky</dc:creator>
      <dc:date>2018-08-03T16:14:04Z</dc:date>
    </item>
  </channel>
</rss>

