Web request help

Hi hopefully an easy question for you experts. I’m trying to send a command via web request - I think that’s what I’m trying to do anyway - which won’t have a reply. it’s in this format https://admin:password@IP address/api/macros/test

The command works if I type it in chrome so I’m sure all the ports etc are open for this to work
I’ve tried the API but get a request failed message is there a way to do this?

Thanks

Rick

Any failed messages on API block? Test integration will show some kind of error messages.

Hi

With some help from vf I got the header correct. But it is still giving an SSL peer certificate or ssh remote key not ok error. Which might be due to the unit using self signed SSL cert. Not sure if VF supports Https or how to get round it now. I did wonder if it’s possible to use a code block to do the API. But that’s getting a bit above my skill level unless I can fing the code somewhere to modify.

Any ideas would be greatly recived as I’m stuck now.

Thanks

Kind Regards

Rick

I have not tried but I have seen some old posts and seems API should be HTTPS only.

I think if you send a http request in code block, you need include some librarlies like

var http = require('http');

but code block seems it does not allow ‘require’ and will return error. I guess this is security reason.

So you should use HTTPS and you can use Let’s encrypt for free.

The call I’m trying is https it only returns a simple 200 header {“status” : “macro executed: Timer” } what wou.d the code look like for a https GET I’ve only done a limited amount of coding so this is a bit over my head.

Kind Regards

Rick

oh sorry, you use HTTPS but self signed. Then you can try with signed ssl like Let’s Encrypt.