How to fetch data from an API

my work has this company API. currently im calling the urls using Postman.

Ok, no problem.

Can you make a webhook from within the Particle Console?

https://console.particle.io/integrations

1 Like

i just wana call this url with the photon. https://example.sada/api/sda/recipe?api_token=blahblahla

Try making a webhook like this:

1 Like

ok ill give it a shot, thanks

image

It doesnt post anything on console

Maybe you could reduce the delay?

1 Like

OMG thanks dude!

1 Like

is there a different way to to trigger the integration?

i want to store that data into a string so i can use the info. Thanks

Do you want the photon to get the full JSON or just certain part(s)?

1 Like

both. some urls i want full some i dont

You have to make a webhook for each URL.

1 Like

Hey,
Would you please show me how you would store data that is requested.
Its doing my head in to figure it out haha

Also is there a way to do this without webhooks?

You could use TCPClient.

1 Like

Since your new to all this I would stick with the Webhook integration to keep things as simple as possible.

I just learned how to save data returned from Webhooks and documented it all in this thread which would probably be helpful for you also. Once you learn this you’ll be able to do what your wanting to do and more.

1 Like

Sorry to mention it, but the development of this thread suggests that the “I’ll look into it” part of your replies usually gets superseded by “Well, just one more question”.

Please do investigate first and not sidestep the suggestions you already had got.

Webhooks are the way to go (especially for https:// targets virtually the only reasonable one) and there is a wealth of info to be found.
Start here
https://docs.particle.io/reference/webhooks/
https://docs.particle.io/tutorials/integrations/webhooks/

Almost all your questions raised above are addressed one way or the other in these two resources.

4 Likes

Thanks @RWB , Sorry @ScruffR . Anyways thanks guys for all ur replies. I figured it out! what i was looking for was httpclient library lol (got it to work).

1 Like