-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update access mode method not available in SDK #358
Comments
If there is another way to modify the |
Hi @brandon14 - Thanks for getting in touch. That method is indeed not supported for the PHP SDK so it does appear that the Documentation is the part that should be updated - I'll speak with our team about that internally. We plan to sunset the Access Mode feature so it's not present in all SDKs and especially the new V2 SDKs. In terms of potential workarounds, what you could try is to send a direct API call to Cloudinary (not using the SDK) passing the relevant parameters to update the access mode of that asset. For example, you can use cURL or any HTTP library and make a POST request to For example, via cURL (you'll need to substitute the placeholders in all caps):
Would you be able to try this out and let me know if it works for you? |
The cURL request does work, and this could be a potentially viable solution. If plans are to sunset this functionality that is fine. The reason I ask is I was writing an updated Flysystem adapter for Cloudinary, and it optionally supports altering visibility, but most of the adapters I have seen for Cloudinary just omit the functionality. I was thinking if it was as easy an API call like that, then I would add support for that, but it's not a big deal. I mainly wanted to bring it up as well to make sure it wasn't something overlooked, or something wrong in the documentation. |
Thanks, @brandon14 - I agree, since it's not supported it should be removed from the Documentation's code examples (I'll update that from our side) to avoid confusion as to whether the Docs is right or the code is missing the implementation. |
@aleksandar-cloudinary Thanks for the reply. This is good to close as long as the documentation and examples are cleaned up. |
@brandon14 - You're welcome. - Absolutely - we'll update the docs to remove that to avoid such confusion going forward. |
i have the exact same issue, passing access_mode to Cloudinary::admin()->updateUploadPreset() does not work |
@lk77 Hi, Indeed, that option is not one of the supported Upload API parameters in the new SDKs hence it's not passed in the request from the SDK to Cloudinary. That said, you should see the Access Mode option in the UI (Settings > Upload tab > Upload Presets) and be able to set it there for the upload preset you want to update. |
@aleksandar-cloudinary yes but it fallback to public every time i update the preset with the admin api, it should :
Also a patch route would be useful, in the end i only want to update the notification_url Having to retrieve the preset, modify the url and send it back to cloudinary adds an unnecessary step i think |
@lk77 Yes, the API performs an update so unless you pull the details, modify the object and send it back in the |
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.
In the documentation or the admin API, it references an API call to modify the access_mode on an asset as described here using the PHP SDK, but I am unable to find that API call (updateResourcesAccessMode) in the PHP SDK.
Issue Type (Can be multiple)
Steps to reproduce
updateResourcesAccessMode($access_mode, $options = []);
as described in the above mentioned documentation.AdminApi
object.Error screenshots or Stack Trace (if applicable)
Operating System
Environment and Frameworks (fill in the version numbers)
Repository
N/A
The text was updated successfully, but these errors were encountered: