cloudinary_php
cloudinary_php copied to clipboard
"Missing required parameter - type" error with prefix option in Admin API assets() call
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)
- [ ] Build - Can’t install or import the SDK
- [ ] Performance - Performance issues
- [ ] Behaviour - Functions aren’t working as expected (such as generate URL)
- [ ] Documentation - Inconsistency between the docs and behaviour
- [ ] Other (Specify)
Steps to reproduce
… if applicable
Error screenshots or Stack Trace (if applicable)
…
Operating System
- [ ] Linux
- [ ] Windows
- [ ] macOS
- [ ] All
Environment and Frameworks (fill in the version numbers)
- PHP Cloudinary SDK version - 2.0.4
- PHP Version - 7.4
- Framework (Laravel, Symphony, etc) - Laravel 8.5
Repository
If possible, please provide a link to a reproducible repository that showcases the problem
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?
I would like to work on this. Can you assign it to me?
@aachal28 since this is a designed feature and not a bug there is nothing to currently work on. Thanks!
Okey, No problem!
Thanks!