homepage › Forums › HMI Support › REST Connector
- This topic has 7 replies, 2 voices, and was last updated 9 months, 3 weeks ago by
grzegorz914.
-
AuthorPosts
-
May 13, 2020 at 5:05 pm #1056
RFARDONK
ParticipantWhen a REST Connector is configured, what type of request is constructed in the background? Curl, HTTP, PHP, JS, etc. ???
Im trying to create a REST Connector to access RapidAPI DNS Lookup but it doesn’t return anything.
If i use the “sentence” provided by API on a browser it works perfectly. So i guess its the way HMI Draw build the “sentence”on the background.
Do you have an example of anything that would actually work?
I need it because the PLC Connector “Remote Host” says you can use “mydomain.dyndns.org” but it doesn’t work….so im trying to build a REST Connector that would translate the domain for me into an IP Address.
I already paid an Activation Key for my App and im starting to regret i spent $149.99 for a product that doesn’t have any support.
May 13, 2020 at 5:18 pm #1058grzegorz914
ModeratorTo check dynamic domain iP adress I use google api:
Rest Connector config:
Name DyndnsIP baseApiUrL "https://dns.google.com" method "POST" restPath "/resolve?name=YourDomainName&type=A" httpHeader {"Content-Type":"application/json"} requestBody {}
to resolve address from response I use text field where value is:
if DyndnsIP.statusCode == 200 then DyndnsIP.response["Answer"][0]["data"]
I thin it Ii clear.
-
This reply was modified 9 months, 3 weeks ago by
grzegorz914.
-
This reply was modified 9 months, 3 weeks ago by
grzegorz914.
May 13, 2020 at 5:36 pm #1061RFARDONK
ParticipantHello,
Thanks for your prompt response
So i built it as
Name DyndnsIP
baseApiUrL “https://dns.google.com”
method “POST”
restPath “/resolve?name=thefardonkhome.net&type=A”
httpHeader {“Content-Type”:”application/json”}
requestBody {}i triggered to rest but i don’t get a 200 as a statusCode ….. Am I missing something??
May 13, 2020 at 5:46 pm #1066RFARDONK
ParticipantOk,
I removed the and now im GETTING the RIGHT DATA in response.
So now i have to working with indexing the response which is not working at this time…Im getting closer…
Any advise??
Thank You
May 13, 2020 at 5:47 pm #1067grzegorz914
ModeratorI tested Your domain and get correct status code 200,
check again this:
restPath “/resolve?name=thefardonkhome.net&type=A”
May 13, 2020 at 5:52 pm #1068grzegorz914
Moderatorcreate texFielde where value is:
if DyndnsIP.statusCode == 200 then DyndnsIP.response["Answer"][0]["data"] else "data error"
if all working OK the value will be Your IP adress.
-
This reply was modified 9 months, 3 weeks ago by
grzegorz914.
May 13, 2020 at 6:00 pm #1070RFARDONK
ParticipantGOT IT WORKING!!!! THANKS TO YOU….
WHO EVER YOU ARE, WHEREVER YOU ARE….
IM IN DEBPT WITH YOU!!!THANKS
SAYING HELLO FROM THE BEAUTIFUL CARIBBEAN ISLAND OF PUERTO RICO
May 13, 2020 at 6:02 pm #1071grzegorz914
ModeratorNo problem,
I’m glad I could help you, also greetings from Poland. -
This reply was modified 9 months, 3 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.