Pricing Blog

corect URL to Get Bucket content (Supabase)

  • uunicode-1375578103757148312

    unicodes

    2 months ago

    Do you know the corect URL to get the content of a bucket > folder?

    I'm using storage/v1/bucket/images/{bucket name}/{folder name}, tried also storage/v1/object/bucket/images/{bucket name}/{folder name}, none is working 😦
  • lucasg-1375584275260510228

    Lucas G

    2 months ago

    storage/v1/object/{bucket}/{folder}/{filename.ext}
  • uunicode-1375585024262410301

    unicodes

    2 months ago

    This works to get all the images of a folder? It works if I include the image name, but not working if I want to get all images from a folder 😦
  • 1375585242618003466-Screenshot_2025-05-24_at_00.24.33.png
  • items is the bucket name, and the UUID is the folder name.
  • lucasg-1375587566321143851

    Lucas G

    2 months ago

    Ah I misunderstood
  • It should be object/list/{bucket}
  • lucasg-1375588038708564071

    Lucas G

    2 months ago

    Then your RLS policy should filter what they can access
  • uunicode-1375588070317097151

    unicodes

    2 months ago

    In this case the bucket cann't be found 😦
    1375588070086148106-Screenshot_2025-05-24_at_00.35.30.png
  • lucasg-1375588086892859483

    Lucas G

    2 months ago

    Assuming the folder name is something like an account id
  • No, no folder in the URL
  • uunicode-1375588390828773528

    unicodes

    2 months ago

    The bucket is publick and the bucket name is corect as the folder name, here is an example of an image from folder https://apcddqgzwhgtrunagwqf.supabase.co/storage/v1/object/public/items/44ea8e6f-c71a-4f5e-923a-1e70b759a962/karsten-winegeart-BJaqPaH6AGQ-unsplash.jpg
  • But it refuse to return all the items from that folder and I do not get why.
  • lucasg-1375588613797969973

    Lucas G

    2 months ago

    I'm not sure what you mean by the bucket name is correct as folder name
  • The URL does not take folder name
  • uunicode-1375589045824000224

    unicodes

    2 months ago

    1375589045664743496-Screenshot_2025-05-24_at_00.39.39.png
  • uunicode-1375589315228209182

    unicodes

    2 months ago

    As per end points, there isn't a clear bucket retrieve https://supabase.github.io/storage/#/bucket.
  • Maybe they do not support this
  • lucasg-1375589568476348446

    Lucas G

    2 months ago

    It's under the object endpoints
  • lucasg-1375589830842519722

    Lucas G

    2 months ago

    Yes
  • There's a list-v2 now as well, didn't see that before
  • uunicode-1375590059452928041

    unicodes

    2 months ago

    1375590059490672832-Screenshot_2025-05-24_at_00.43.41.png
  • lucasg-1375590188260262078

    Lucas G

    2 months ago

    It still shouldn't have the folder
  • lucasg-1375590529751842917

    Lucas G

    2 months ago

    Are you sending the body as well?
  • The body query is required
  • uunicode-1375591302917525575

    unicodes

    2 months ago

    with the body from the example i does not return any results
  • uunicode-1375591602210340936

    unicodes

    2 months ago

    and with list-v2 and the body from example returns "This feature is not available for your tenant"
  • lucasg-1375592039210553385

    Lucas G

    2 months ago

    That body has dummy data
  • It wouldn't return results
  • uunicode-1375592373471678595

    unicodes

    2 months ago

    Honestly I do not know how should look the body. Tried an empty one but doesn't work with {}
  • uunicode-1375593527798534175

    unicodes

    2 months ago

    1375593527852924968-Screenshot_2025-05-24_at_00.57.30.png
  • works!
  • This is how the body should look.
  • lucasg-1375593686716387518

    Lucas G

    2 months ago

    Ah I was about to type it
  • uunicode-1375593688989958254

    unicodes

    2 months ago

    The url should include only the bucket name not the folder
  • /storage/v1/object/list/items
  • lucasg-1375593778894602501

    Lucas G

    2 months ago

    Yes, that’s what I’ve been saying 😂
  • lucasg-1375594100291666072

    Lucas G

    2 months ago

    I think most of the body options are optional 🤔. Search one definitely should be
  • uunicode-1375594114434859080

    unicodes

    2 months ago

    Thank you Lucas!
  • The prefix is the only value that needs
  • lucasg-1375594323944542349

    Lucas G

    2 months ago

    Maybe prefix isn’t but it should take an empty string at least.
  • uunicode-1375594549514342411

    unicodes

    2 months ago

    Work and I'm very happy! Thank you Lucas!