cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

Re: To use properties/update, am I required to first do properties/add first?

To use properties/update, am I required to first do properties/add first?

toki4004
Explorer | Level 4
Go to solution

In order to use properties/update, am I required to first do properties/add on a file?

Reading your description for the "update", it seems it should "Add, update or remove properties associated" with the file. But when when I try to use "update" on new file, it doest not work - it only works for a file for which I had previously added the property to.

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hm..:thinking_face: @toki4004, Let's imagine you're famous painter. :winking_face: You have expositions in many galeries (think for the galeries as files). You may expose not only completely ready pictures, but also some drafts (count all pictures and drafts as properties). Of course from time to time you may update your drafts - add a flower, for instance (the same like properties update). Let's start thinking... would it be possible for you to update some draft that doesn't exist yet; never got started be painted at all (the same like a property not added yet)? 🧐... :hushed_face::grinning_face:

Hope this gives direction... of thinking.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hm..:thinking_face: @toki4004, Let's imagine you're famous painter. :winking_face: You have expositions in many galeries (think for the galeries as files). You may expose not only completely ready pictures, but also some drafts (count all pictures and drafts as properties). Of course from time to time you may update your drafts - add a flower, for instance (the same like properties update). Let's start thinking... would it be possible for you to update some draft that doesn't exist yet; never got started be painted at all (the same like a property not added yet)? 🧐... :hushed_face::grinning_face:

Hope this gives direction... of thinking.

toki4004
Explorer | Level 4
Go to solution

Ok, that's what I thought. The description language implies that the property would be added if it doesn't exist - the way I read it.

Здравко
Legendary | Level 20

@toki4004 wrote:

... The description language implies that the property would be added if it doesn't exist - the way I read it.


Hi again @toki4004,

Yes, you are correct - it implies so. You have just hit a big Dropbox pain - the documentation!!! It's not just about the documentation actually - here some conceptual design bugs bring up (and followup implementation mistakes).

Usually when something is going to be added: if missing - would be just added, if existing - may be error or may be updated/overwritten. Here, Ok - if exists, error is assumed to be (in spite in file upload is assumed to be update). On other side when there is explicit method to update/overwrite something, it usually mean exactly update or overwrite and nothing more (a good idea would be if you try any other operation to result in error). Here, by design is just opposite (usually assumed as error, in spite not mandatory) and implemented correct (probably by mistake :beaming_face_with_smiling_eyes: - example of a good mistake).

There is one more... inconsistency: That what you're looking for may be found in /2/file_properties/properties/overwrite. It's not mentioned, but here when particular property is missing (property group actually), it's gonna be created. It's not certain that such behavior matches design, but is implemented so (usually assumed as bad practice 🤷). Whatever it's assumed as, it's so... The only clear thing is that documentation doesn't match to the actual endpoints behavior (no completely, at least).

Hope this adds some piece of extra clarity.

Need more support?