Updating Apilio variable by webhook

Hi!
I would like to update a numeric variable in Apilio based on the result of calling
https://api.spot-hinta.fi/JustNow?lookForwardHours=1. I’ve gone through both IFTTT and Apilio, but I haven’t succeeded in updating the variable with the price information (PriceWithTax) the link returns:

“Rank”: 16,
“DateTime”: “2023-02-21T13:00:00+02:00”,
“PriceNoTax”: 0.1297,
“PriceWithTax”: 0.1427
}

1 Like

Hi @Ilkkas ,
Apilio cannot fetch data from an API by it’s own.
From the project page you linked, I found a hint that it somehow works with IFTTT: http://spot-hinta.fi/ifttt/
Maybe you can figure out how to send it to IFTTT and from there to Apilio?
Another option is to follow the idea of @qdmt who just today posted a guide to use Pipedream to fetch data and store it to Apilio: How to Automatically Create Calendar Events if the Weather is Good

3 Likes

Yep I think this would definitely be doable with Pipedream & Apilio. Happy to help troubleshoot if you go down that route.

3 Likes

I don’t know how I skipped the IFTTT section in spot-hinta, but when I read it thoroughly, I succeeded in making my task.
Many thanks!

2 Likes

that’s great news, thanks for the update.

1 Like

Hi, @qdmt!
I’ve been trying your solution, too, because the service I first tried is not sending updates as it should. But I can get the current price info just as you got your weather forecast.
So, I copied your example (many thanks!) and changed the request and variable, but for some reason, I get an error message from the point :
method: “put”,
url: Price_UUID,
headers: {
“Content-Type”: “application/json”,
The error message is
‘TypeError: Invalid URL’ even though I’ve copied the UUID directly from Apilio.

Any suggestion why this happens?

2 Likes

Hi @Ilkkas,
I think the error message is from Pipedream, so the URL is seen as invalid.
Any chance you can see the URL in Pipedream for debugging?

1 Like

Hi @pebneter,
I got the URL right after I saw @qdmt’s question and answer in Pipedream’s Help section :slight_smile:
In qdmt’s example, it was hidden in the environment variable, so I put only UUID there, and, as I now understand, it is not enough.
Thanks for guiding me!

2 Likes

My bad!!! I should have totally clarified in my writeup that the URL is required too, and I only mentioned that it was the UUID. Apologies to cause the hiccup and not catching a reply for you soon enough.

1 Like

No problem! Without your example, I had never have done my task. :slight_smile:

3 Likes