REST Connector

homepage Forums HMI Support REST Connector

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1056
    RFARDONK
    Participant

    When 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.

    #1058
    grzegorz914
    Moderator

    To 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.
    #1061
    RFARDONK
    Participant

    Hello,

    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??

    #1066
    RFARDONK
    Participant

    Ok,

    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

    #1067
    grzegorz914
    Moderator

    I tested Your domain and get correct status code 200,

    check again this:

    restPath “/resolve?name=thefardonkhome.net&type=A”

    #1068
    grzegorz914
    Moderator

    create 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.
    #1070
    RFARDONK
    Participant

    GOT 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

    #1071
    grzegorz914
    Moderator

    No problem,
    I’m glad I could help you, also greetings from Poland.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.