Unknown API key when trying to use the HTTP API directly
I am trying to create an archive from node.js, and I need to pass the allow_missing parameter, because I might have invalid public ids in the list.
I have been told that this has not been implemented in the node.js package, and therefore I am attempting to call the endpoint directly.
I am trying to package 1000 (the limit) files into a zip, and so I cannot use a GET request, but need to use a POST request. I have been told previously, that this is possible.
In the documentation it states that I should do basic auth with my api key and api secret in order to authenticate. I have done this, encoded these strings and has made an Authorization header. However, I keep getting the response "unknown API key". I have tried creating the Authorization key with Postman, so I am fairly confident that it is the correct key.
My questions are:
1) How should I provide the credentials for this to work
2) I am not sure how to provide the parameters (allow_missing, public_ids, etc). Can I use e.g. JSON as a HTTP body, or must I provide them in another way?
Thanks in advance!
Joachim
-
Hi Joachim,
In order to send the request directly to the endpoint, you should create a signature, rather than passing an authorisation header (basic auth is for the Admin API).
So, you can do something like this -0 -
What's the <signature> ?
0 -
Hi Alex,
Signature is the hash of timestamp, transformation and API secret.
These articles explain in detail how to generate the signature:-
- https://cloudinary.com/documentation/upload_images#creating_api_authentication_signatures
Thanks,
Aditi1 -
Hi Aditi,
I'm having the same problem with the signature and all the other parameters but keep getting Invalid credentials response. Could you help me?
Thanks in advance!
Antony
0 -
Hi Antony,
In order to investigate this further, please use the following form - https://support.publit.io/hc/en-us/requests/new - to create a direct ticket with us and share the code you are currently using to generate the signature and the parameters you're passing. We can then take a look and advise on what changes can be made to resolve it.
0
Post is closed for comments.
Comments
5 comments