I can't upload image via curl because error: Invalid Signature
This is my CURL: curl --request POST \
--url https://api.cloudinary.com/v1_1/infodental/image/upload \
--data 'file=https://res.cloudinary.com/infodental/image/upload/,w_50/v1648125362/storage.infodental.dental/studiodental/arqs/colaboradores/y9iivy0k9jju9lskyydn.jpg&public_id=sample_image×tamp=1514500082&eager=w_200,h_200&api_key=<API KEY>&signature=05ec6e315789f723d2233b509460e64f5afcf7eb'
I have this return: Invalid Signature 05ec6e315789f723d2233b509460e64f5afcf7eb. String to sign - 'eager=w_200,h_200&public_id=sample_image×tamp=1514500082'.
I put exactly eager=w_200,h_200&public_id=sample_image×tamp=1514500082<SECRET KEY>
Where is my error?
Thanks!
-
Hi,
I've checked the logs on our side and the correct string to sign was indeed "eager=w_200,h_200&public_id=sample_image×tamp=1514500082<API_SECRET>" which you mentioned you used.
In that case, the only reason it wouldn't have worked is due to the API SECRET. May I please ask you to double-check the value you are using for that? You can calculate the signature in the command line directly by running
echo -n 'eager=w_200,h_200&public_id=sample_image×tamp=1514500082<API_SECRET>' | sha1sum
The correct signature you should get back is:
2ef149fe190ef266c766ae5104b3193d5327e93f
By the way, I see that you are uploading an image from your account into the same account which will create duplicates and cost you Transformation and Storage quota. Is that intentional?
-
Hi,
Tanks for yours explains. I am uploading an imagem from my account. That is intentional to first test.
I use MacOS and try generate sha1 of the follow string into my terminal:echo -n 'eager=w_200,h_200&public_id=sample_image×tamp=1514500082<API_SECRET>' | shasum
That return:4c7acd1b4f6693efaa3320411018b70c4bcfdad3
I put exactly string "<API_SECRET>" to return same your sha1 (2ef149fe190ef266c766ae5104b3193d5327e93f), but return different sha1.
What is wrong? -
Hey there,
Sorry our forum system was having some issues and I'm afraid your question was lost. I'd like to make sure you were able to move forward and resolve your issue. '<API_SECRET>' will actually need to be replaced with the API secret associated with your account.The API uses Basic Authentication over secure HTTP. Your Cloudinary API Key and API Secret (which can be found on the Dashboard page of your Cloudinary console) are used for authentication.
You can experiment with returning a list of the images on your own Cloudinary account by replacing theAPI_KEY
,API_SECRET
, andCLOUD_NAME
in the cURL command below:
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<CLOUD_NAME>/resources/image
Please let us know if you are still having issues.
Post is closed for comments.
Comments
3 comments