cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dropboxapi.com/2/files/upload response object missing the item `.tag` key/value

dropboxapi.com/2/files/upload response object missing the item `.tag` key/value

elsigh
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:
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.
 
 
1 Reply 1

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?