No internet connection
  1. Home
  2. Questions

Post to Public API from Existing Website Form

By @matty
    2022-11-29 23:53:58.806Z2022-11-30 02:30:12.591Z

    Hi I created an API message source in ThinkAutomation V5 5.0.898.2, I then set the form action to the Web API URL shown on the Message Source properties.

    When I submit the form I receive a 401 unauthorized error. Allowed origins is blank.

    When I switch the form action to another url , it submit's the form just fine the submission is below:

    Headers

    {"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9","Referer":"http://192.168.1.248:8081/","Sec-Ch-Ua":""Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","Content-Type":"application/x-www-form-urlencoded","Cache-Control":"max-age=0","Content-Length":"188","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"cross-site","Sec-Fetch-User":"?1","Accept-Encoding":"gzip, deflate, br","Accept-Language":"en-US,en;q=0.9","Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":""Windows"","Upgrade-Insecure-Requests":"1"}

    Body

    radio=Yes&checkbox=C&checkbox1=Tracking+Tab&checkbox1=Quote+Tab&checkbox1=Order+Tab&text=Q1000000&text1=&client_id=&text2=60000000&text3=Matt&text4=md.com&submit=

    Any insight?

    Thanks,

    Matt

    Solved in post #7, click to view
    • 6 replies
    1. D
      Daniel Horton @daniel.horton
        2022-11-30 09:38:39.073Z2022-11-30 11:22:49.117Z

        Hi Matty,

        Would you be able to perform the same test but report in here the time stamp and time zone so that we can review our logs to find the cause please? We will also need the IP address too so we can review a potential blacklist entry that might be blocking this.

        Thank you

        1. M@matty
            2022-11-30 17:26:05.725Z2022-11-30 17:34:05.453Z

            @daniel.horton

            Eastern Standard Time:

            IP address: 209.171.89.162

            Thanks,

            Matt

            1. SStephen Parker @stephenparker
                2022-12-01 19:40:23.518Z

                The issue seems to be caused when the Origins value set against the Message Source is blank (which should allow any origin). We will update the gateway server later today.

                Thanks
                Stephen

                1. M@matty
                    2022-12-01 19:47:20.753Z

                    @stephenparker thanks I will await the update.

                    Any chance the gateway will be updated to be able to respond to HEAD requests at the same time? Use TA Web API as callback url for Webhook events from 3rd party

                    1. SStephen Parker @stephenparker
                        2022-12-01 19:48:01.442Z

                        Yes that is also in that update. Thanks

                2. S
                  In reply tomatty:
                  Stephen Parker @stephenparker
                    2022-12-07 10:11:51.227Z

                    The gateway is now updated.

                    Reply1 LikeSolution