cloudinary / cloudinary_php

PHP extension for Cloudinary
https://cloudinary.com/documentation/php_integration
MIT License
388 stars 150 forks source link

"Missing required parameter - type" error with prefix option in Admin API assets() call #258

Closed thumbtech closed 1 year ago

thumbtech commented 3 years ago

Bug report for Cloudinary PHP SDK

Before proceeding, please update to latest version and test if the issue persists

Describe the bug in a sentence or two.

(new AdminApi())->assets(['prefix' => 'tmp']);

throws exception

   Cloudinary\Api\Exception\BadRequest

  Missing required parameter - type

  at vendor/cloudinary/cloudinary_php/src/Api/BaseApiClient.php:413

No issues without prefix option: (new AdminApi())->assets() ... or with other other options like 'resource_type', 'max_results', etc.

Issue Type (Can be multiple)

Steps to reproduce

… if applicable

Error screenshots or Stack Trace (if applicable)

Operating System

Environment and Frameworks (fill in the version numbers)

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

cloudinaraz commented 3 years ago

Hey @thumbtech, sorry for the delay in response.

You are correct. When using the prefix option instead of the other alternatives, type becomes a mandatory parameter. This is "as-designed" and was always like that.

Do you have any private, authenticated and/or fetch types assets on your account that you try to list as well, or are they all using the default upload types? If it's the latter, just add 'type' => 'upload' to your options array and it should return all relevant assets.

Let me know if you run into any issues even when including type in your request?

aachal28 commented 1 year ago

I would like to work on this. Can you assign it to me?

PixelCook commented 1 year ago

@aachal28 since this is a designed feature and not a bug there is nothing to currently work on. Thanks!

aachal28 commented 1 year ago

Okey, No problem!

thumbtech commented 1 year ago

Thanks!