Search Unity

Question Is there a way to modify an existing entry path using a Management API endpoint?

Discussion in 'Unity Cloud Content Delivery' started by halvaren_nugadog, Nov 29, 2022.

  1. halvaren_nugadog

    halvaren_nugadog

    Joined:
    Feb 16, 2022
    Posts:
    31
    I can see in the Management API docs two endpoints for modifying existing entries, one identifying the entry by its ID and the other one identifying the entry by its path. I thought that using the first one should let you modify the entry path, but the model for the body doesn't include a field for specifying the new path? So, is there a way to modify the path of an existing entry or you have to create a new one and delete the old one?

    upload_2022-11-29_13-53-39.png
     
  2. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    130
    Hi,

    An entry is basically a path. We have the concept of versions which is when a path has different content. When you PUT an entry you are basically creating a new version of the filepath (usually because you want to change the contents of the file).

    To create a new path you create a new entry (POST) rather than updating (PUT). Behind the scenes we try to only store one copy of a given file if you specify the content_hash. If you create a new entry with the same content_hash as a previously uploaded entry, when you create the entry you should see the field "complete" set to true. In that case you don't have to re-upload the file.

    Apologies if this is too much information.
     
  3. halvaren_nugadog

    halvaren_nugadog

    Joined:
    Feb 16, 2022
    Posts:
    31
    No, it's quite okay. It is just what I imagined.

    Thank you for the response!