Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted How to get Entry Object for Create Entry API [POST]

Discussion in 'Unity Cloud Content Delivery' started by roshaantariq, Oct 12, 2020.

  1. roshaantariq

    roshaantariq

    Joined:
    Dec 6, 2017
    Posts:
    26
    Hi,
    I want to get the entry object data as mentioned in this API. If or has anyone completed this API before, please share the solution for this, any help would be appreciated, thanks!
     
  2. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    61
    Are you looking to use a C# client to access the data?
     
  3. roshaantariq

    roshaantariq

    Joined:
    Dec 6, 2017
    Posts:
    26
    I'm trying to create my own tool for my own project using the REST APIs in Unity. So I'm a bit confused about the Entry Object and it's values
     
  4. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    61
    It's just a JSON POST body. Set the content type to application/json and your both to something that looks like this:

    {
    "content_hash": "c76580fa26181bfa8d8952826bd334d5",
    "content_size": 1234567,
    "content_type": "image/jpeg",
    "labels": [
    "string"
    ],
    "metadata": {},
    "path": "ios/character1.bundle"
    }

    content_hash is the md5sum of the file. Once you've created the Entry you have to upload the content in a separate step. That is PATCH request against /buckets/{bucketid}/entries/{entryid}/content/. You can also use a TUS client (https://tus.io/implementations.html) to upload the file.
     
unityunity