Showing results for 
Show  only  | Search instead for 
Did you mean: 
Update: Find information on Dropbox support during COVID-19 here

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted response object missing the item `.tag` key/value

Helpful | Level 5

I'm saving a text file in "overwrite" mode, but the response object I get back for the item is missing it's `.tag` property (here, it should be file).


Example (bits copied from chrome dev console)


Request URL:
`{"autorename":false,"mode":{".tag":"overwrite"},"mute":true,"path":"/songbook/Aeroplane over the"}`
{"name": "Aeroplane over the", "path_lower": "/songbook/aeroplane over the", "path_display": "/SongBook/Aeroplane over the", "parent_shared_folder_id": "1397796772", "id": "id:HvHBCmOrUnAAAAAAAAAAbw", "client_modified": "2018-07-10T06:10:29Z", "server_modified": "2018-07-10T06:10Z", "rev": "1f15350afa4", "size": 1670, "sharing_info": {"read_only": false, "parent_shared_folder_id": "1397796772", "modified_by": "dbid:AAC7xJh2VcDvncsSSMKnV9xJNEFqtltu0i4"}, "content_hash": "5c4350e6e6ed022b9f1a8f08ba159d10632939f0255735224fccafe899288773"}
Prior response when doing a list_folder returned that file object like this:
{".tag":"file","name":"Aeroplane over the","path_lower":"/songbook/aeroplane over the","path_display":"/SongBook/Aeroplane over the","parent_shared_folder_id":"1397796772","id":"id:HvHBCmOrUnAAAAAAAAAAbw","client_modified":"2018-07-10T06:10:29Z","server_modified":"2018-07-10T06:10Z","rev":"1f15350afa4","size":1670,"sharing_info":{"read_only":false,"parent_shared_folder_id":"1397796772","modified_by":"dbid:AAC7xJh2VcDvncsSSMKnV9xJNEFqtltu0i4"},"content_hash":"5c4350e6e6ed022b9f1a8f08ba159d10632939f0255735224fccafe899288773"}```
(notice the above has a `.tag` property)
I'm writing a web application and blindly trying to use the dropbox response objects as the source of truth. 
The problem is that if I lose `.tag` in the API responses, when I try to save a second time I get a `409` error for `/upload` - when `.tag` is set to file it works.
1 Reply 1

Re: response object missing the item `.tag` key/value


This is working as expected. The /2/files/list_folder endpoint returns a List of Metadata. Metadata is a datatype with subtypes that can be any of: FileMetadata, FolderMetadata, DeletedMetadata. The '.tag' identifies the subtype.


The /2/files/upload endpoint only returns a FileMetadata, so no '.tag' is needed or returned. 


When uploading using /2/files/upload, you should only supply the documented parameters. If something goes wrong, you'll get an error response, such as the 409 you mentioned, in which case you should check the response body, as it will contain a more useful error message.

Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?