Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Get Entry by Path -> Not Working

Discussion in 'Unity Cloud Content Delivery' started by PeachyPixels, Nov 10, 2023.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    716
    Hello!

    I'm using CCD for a game that is work in progress.

    Currently I'm using the following endpoint to retrieve entry details from a private bucket...

    /environments/{environmentname}/buckets/{bucketid}/entries/{entryid}/

    Code (CSharp):
    1. https://<projectid>.client-api.unity3dusercontent.com/client_api/v1/environments/<environmentname>/buckets/<bucketid>/entries/<entryid>/
    It's been working well.

    But I'm trying to switch to using the path endpoint...

    /environments/{environmentname}/buckets/{bucketid}/entry_by_path/{path}/

    Code (CSharp):
    1. https://<projectid>.client-api.unity3dusercontent.com/client_api/v1/environments/<environmentname>/buckets/<bucketid>/entry_by_path/<path>/
    But no matter what I try, it's throwing 404's. I've tried all combinations of path, e.g.

    /entry_by_path/file.ext
    /entry_by_path/file.ext/
    /entry_by_path/?path=file.ext
    /entry_by_path/?path=file.ext/

    But nothing is working.

    If I try and call the endpoint using the dashboard...

    https://content-api.cloud.unity3d.com/doc_client/#/Entries/GetEntryByPathPublicEnv

    It throws the following error (the correct access token \ header has been set)...

    Failed to fetch.
    Possible Reasons:
    CORS
    Network Failure
    URL scheme must be "http" or "https" for CORS request.


    Is anyone from Unity able to throw some light on why this is not working please?
     
  2. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    716
    Went for lunch, returned and the REST API's are now working. Shrugs.

    The correct approaches are...
    Code (CSharp):
    1. https://<projectid>.client-api.unity3dusercontent.com/client_api/v1/environments/<environmentname>/buckets/<bucketid>/entry_by_path/?path=<filepath>
    Code (CSharp):
    1. https://<projectid>.client-api.unity3dusercontent.com/client_api/v1/environments/<environmentname>/buckets/<bucketid>/entry_by_path/content/?path=<filepath>
    Must have been a glitch in the Matrix :D

    Not checked the API dashboard though.