One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
elsigh
7 years agoHelpful | Level 5
dropboxapi.com/2/files/upload response object missing the item `.tag` key/value
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:
Dropbox-API-Arg:
`{"autorename":false,"mode":{".tag":"overwrite"},"mute":true,"path":"/songbook/Aeroplane over the Sea.pro"}`
Response:
```
{"name": "Aeroplane over the Sea.pro", "path_lower": "/songbook/aeroplane over the sea.pro", "path_display": "/SongBook/Aeroplane over the Sea.pro", "parent_shared_folder_id": "1397796772", "id": "id:HvHBCmOrUnAAAAAAAAAAbw", "client_modified": "2018-07-10T06:10:29Z", "server_modified": "2018-07-10T06:10:30Z", "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 Sea.pro","path_lower":"/songbook/aeroplane over the sea.pro","path_display":"/SongBook/Aeroplane over the Sea.pro","parent_shared_folder_id":"1397796772","id":"id:HvHBCmOrUnAAAAAAAAAAbw","client_modified":"2018-07-10T06:10:29Z","server_modified":"2018-07-10T06:10:30Z","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.
- Greg-DB
Dropbox Staff
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 8 minutes ago
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!