Direct Posting From Web Forms

<< Click to Display Table of Contents >>

Navigation:  Message Retrieval Accounts > Reading/Receiving Messages >

Direct Posting From Web Forms

You can post messages to ThinkAutomation directly from any web form via a HTTP Post. This enables you to directly connect any of your standard web forms to ThinkAutomation. When a form is submitted the form values will be passed to ThinkAutomation for immediate processing. For example, you could use this to store the form values in a database and send back a confirmation email.

 

Click the Direct API option on the Ribbon bar.

 

Click the Accept Messages From Remote ThinkAutomation Clients & ThinkAutomation Web Services option to enable this option.

 

account-httppost

 

The Post URL will be shown. Click the Copy button to copy this to the clipboard.

 

In your web form you need to set the Action attribute of your web form to the above URL. For example:

 

<!DOCTYPE html>
<html lang="en">
 <head>
   <title>ThinkAutomation Direct Post Example</title>
 </head>
 <body>
       <form method="post" action="http://thinkautomation.mydomain.com/ThinkAutomation/postmessage.aspx?taid=BD2B1E7169C8142B504C5h3DhVNDg%2FpusYY5bz1BYA%3D%3D">
         Name:<input type="text" name="txtName" value=""><br/>
         Company:<input type="text" name="txtCompany" value=""><br />

         Email:<input type="text" name="txtEmail" value=""><br />
         <input type="submit" name="submit" value="submit">
 </form>
 </body>
</html>

 

Whenever the form on your website is submitted the form values and headers will be submitted to ThinkAutomation.

 

A new message will be received by ThinkAutomation for the selected Account in the following format:

 

TXTNAME: Test Name

TXTCOMPANY: Test Company

TXTEMAIL: someone@test.com

SUBMIT: submit

ALL_HTTP: HTTP_CACHE_CONTROL:no-cache

HTTP_CONNECTION:Keep-Alive

HTTP_CONTENT_LENGTH:45

HTTP_CONTENT_TYPE:application/x-www-form-urlencoded

HTTP_ACCEPT:image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*

HTTP_ACCEPT_ENCODING:gzip, deflate

HTTP_ACCEPT_LANGUAGE:en-GB,en;q=0.5

HTTP_HOST:217.41.48.63:50074

HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 6.2; Trident/7.0; rv:11.0) like Gecko

 

ALL_RAW: Cache-Control: no-cache

Connection: Keep-Alive

Content-Length: 45

Content-Type: application/x-www-form-urlencoded

Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*

Accept-Encoding: gzip, deflate

Accept-Language: en-GB,en;q=0.5

Host: 217.41.48.63:50074

User-Agent: Mozilla/5.0 (Windows NT 6.2; Trident/7.0; rv:11.0) like Gecko

 

APPL_MD_PATH: /LM/W3SVC/1/ROOT/ThinkAutomation

APPL_PHYSICAL_PATH: C:\Projects\ThinkAutomation V4\WebServices\

INSTANCE_ID: 1

INSTANCE_META_PATH: /LM/W3SVC/1

PATH_INFO: /ThinkAutomation/postmessage.aspx

PATH_TRANSLATED: C:\Projects\ThinkAutomation V4\WebServices\postmessage.aspx

REMOTE_ADDR: 217.41.48.63

REMOTE_HOST: 217.41.48.63

REMOTE_PORT: 62650

REQUEST_METHOD: POST

SCRIPT_NAME: /ThinkAutomation/postmessage.aspx

SERVER_NAME: 217.41.48.63

SERVER_PORT: 80

SERVER_PORT_SECURE: 0

SERVER_PROTOCOL: HTTP/1.1

SERVER_SOFTWARE: Microsoft-IIS/10.0

HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.2; Trident/7.0; rv:11.0) like Gecko

 

The form input fields will be at the top of the message in the format:

 

Name: value

Name: value

..

 

All other HTTP headers will then be appended to the body text.

 

Your Triggers can then extract the field values and/or headers and process accordingly.

 

Redirecting To Another Page After Form Submission

You can add a hidden field to your web form:

 

<input type="hidden" name="redirect" value="http://www.mysite.com/thankyou.htm">

 

If the hidden field name 'redirect' is found ThinkAutomation will return a HTTP 303 redirect response when the form is submitted. The user submitting the form will then be redirected to the URL specified in the 'value' attribute.

 

If no redirect is specified then ThinkAutomation will respond with a standard HTTP 201 response with the body set to the Message ID.

 

The web form direct submission option requires the ThinkAutomation Web Services to be available via an external URL. See: ThinkAutomation Web Services

ThinkAutomation © Parker Software 2016