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?
Please sign in to leave a comment.
Comments
2 comments