How to use imagekit.io API to Upload Images

to run this I need token. so for getting token i need to host the client side code. Am I Right ?

Let me investigate it for 5 minutes

Ok. I will be thankful if you help me with this.

Ok. The token is a string that you have to generate on the app. It’s like an identifier for each upload or request. So each token can’t be repeated

Yes. token as well as expire too. so how do i generate both ?

Try to generate the token using this:


Here is this api

and how do i generate signature ?

You have to get the text of this page. Each time you enter, it generate a different string
https://www.uuidgenerator.net/api/version1

I figured out to manage token, signature, expiry.

image

now I am getting empty String. @JaviR3TicS

I want to keep my file name as YourFileName

I read the api quickly. There is an example in PHP. This example, you put on your server. At Kodular you use the web component. Pass the parameters via POST. And your PHP script will return Json. At web.got you get the Response Content from Json and work. This is your return if all goes well.
Read
Understanding response
The JSON-encoded response contains

yes but i dont know PHP nor i have server

1 Like

The PHP example is ready on the API website. On the server to store your script, you may be able to get a free host.

Do i need to use this.

Example :

i just have to host this, but how do i pass value using from kodular

Did You try put your parameters in quotes?

Sorry, now that I see that you have the option with CURL and you’ve already started trying. So continue with CURL as Javier did. It will be a shorter path.

Did You try Change something in This blocks ?
image

Yes I also like to continue with CURL but I am getting empty string in result on running curl

1 Like

In another post Javier posted an example in. aia

i used that and check each and every parameters, but dont why i am getting empty string.

yes i added extension in filename.