How do I update Apilio from Arduino

I’m looking at the page link below hoping to find how to use the webhooks but the link to the ‘webhooks documentation’ just displays an image.

https://community.apilio.com/t/how-to-update-apilio-variables-or-run-logicblocks-without-using-ifttt/1736

I can trigger IFTTT from arduino, and I was then using IFTTT to update Apilio, but I see i can do this direct with Apilio now, but I can’t find the right documentation.

Hi @Alex ,
you actually have two options:

The web hooks interface is a bit easier to use because you don’t have to care about HTTP headers and Basic Authentication, but the REST API is more powerful.

thank you. I am looking for actual URL examples that I can modify and use from Arduino or Python.

The link in this pane looks tempting but just displays an image

where can i find examples with URLs ?

If you click on the icon, it should copy the URL to your clipboard. Is that not working?

Is that not working?

hard to say - i’m not quite sure what should be happening. I expected the underlined link to go to a documentation page, or even a PDF with some examples like I have seen elsewhere.

When you left-click on the icon, it should show a quick note to confirm the URL was copied to your clipboard:

That is done via JavaScript, so in case you have it deactivated it probably won’t work.

hmmn - i just seem to be going round in circles. I think it’s trying to do something clever or helpful but it’s not working for me.

do you have any ‘normal’ documentation i can read ?

I guess we have a bit of a usability issue (sorry - we try to improve! :disappointed:)
The link to documentation is the one in my first comment.
Maybe you are looking for a generic way to compile those URLs? That is not possible, because every URL is unique for security reasons. You need to copy each URL from the show view for a variable or Logicblock, depending on the action you want: update a variable, run a Logicblock, etc.

I.e. an URL to update one of my variables looks like this:

https://app.apilio.com/webhooks/v2/numeric_variables/58bea4cd-xxxxxxxxbd3fa8/set_value?key=d66084e87c449xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx99f53f31897982d27&value=

ah right - i understand, no generic answer as each variable has a unique id. I assumed i could use the variable name as the context would be implied from my security key, but no matter I understand the approach now.

So i created a new string variable and found the link to get this :-1:
https://app.apilio.com/webhooks/v2/string_variables/c2c22-b084-2f351aab57ce/set_value?key=d91c030a35169fb712f729267dad4c4bb4e9f3f0df70074f666a2bf65940e556cce55f62e2f1baa56fe4857d77f

where so i add the value i want to set - can you provide an example of how i might set this to ‘Workshop’ please

Fantastic, thanks for this, we’ve noticed the string URLs are missing the value bit at the end, we will fix this! Thanks for your feedback.

To use your webhooks, you need to add it to the end of your URL like this:

Add &value=some_value at the end:

https://app.apilio.com/webhooks/v2/string_variables/c2c0-b084-2f351aab57ce/set_value?key=d91c030a35169f66a2bf65940e556cce55f62e2f1baa56fe4857d77fe0b46cb82ef3ccb01f28ed4c32cc20ba33227&value=some_value

For example:
https://app.apilio.com/webhooks/v2/string_variables/c2c22fcc-84-2f351aab57ce/set_value?key=d91c030a35169fb712f729267dad4c4bb4e9f3f0df70074f666a2bf65940e556cce55f62e2f1baa56fec20ba33227&value=monday

ok thanks - i’ll try this later

1 Like

:+1:
Not sure if you had altered the IDs before pasting here. In case you haven’t, you should either cycle your web hooks key (from https://app.apilio.com/user) or delete the variable and start with a new one.

1 Like

@pebneter I want to connect an IoT device to Apilio but I have no control over the message formatting so can’t use webhooks as I can’t simply append something to the end of the webhooks URL. Surely the API is more useful for this as I can structure variable and data contents? But it’s not very clear to me how I can use this (sorry I know the documentation is comprehensive but I’m more of a tinkerer than an API coder)? Is there an Idiots Guide to using an API anywhere?

If you need to transform an incoming webhook with a given format to an Apilio acceptable webhook, you can use Zapier. They have a no-code/low-code workflow module that can extract data from a incoming request and provide that data to an outgoing action.

The Apilio API follows the REST principle, so basically any guide that explains REST should be a good start.
I just had a look at Postman (a great tool that for tinkering with APIs) and they have a lot of material also for starters: https://learning.postman.com/docs/getting-started/introduction/

1 Like