WebAssistant
Table of Contents:
WebAssistant
360Works WebAssistant User Guide
WebAssistant allows you to submit forms from FileMaker, and to get the contents of any URL as text or a container.
User Guide
See the 360Works WebAssistant User Guide for a comprehensive list of all functions, their parameters, and their usage.
Nearly all documentation for 360Works WebAssistant is contained in the User Guide, unlike some other products.
To Demo and Purchase
See the 360Works WebAssistant page to download a demo of 360Works WebAssistant, view pricing, or purchase it.
Getting URL Contents
In its simplest form, you can use the WAGetURL function to get the contents of a URL. If the mime-type of the URL is text, the raw text of the webpage or file is returned. Otherwise, a container is returned containing the image or other data located at the URL.
Submitting Forms
The WebAssistant can simulate a browser submitting a web form. For each field
you wish to send to a form, call the WASetInputValue function. Note that the paramName
corresponds to the name
of an input in the HTML form, which may differ from the label for the field as it appears on-screen. The paramName should match the name
attribute on the <input type="text" name="my_input">
input element in the HTML source code.
In addition to field inputs, you can specify files to upload to a form using the WAUploadFileAtURL function. Again, the inputName should match the name
attribute on the <input type="file" name="my_upload">
in the HTML source code.
You can specify multiple parameters or file uploads. They will all be sent the next time the WAGetURL function is called.
For more advanced users, there is the option of setting the content of the request manually, using the WASetRawPostData function. This will be sent as-is in the request, which is useful if (for example) the POST
data should contain an XML document instead of key/value pairs. You are responsible for encoding this information correctly, as it will be sent as-is to the URL.
Example Usage
To add a user to a web-based signup form, you might use something like the following:
Let ( setup = WAReset &
WASetInputValue( "first_name" ; "Sam" ) &
WASetInputValue( "last_name" ; "Barnum" ) &
WASetInputValue( "email" ; "sam@example.com" )
;
WAGetURL( "http://example.com/test/signup.php" )
)
To get an image from a password-protected website, just use the following calculation:
Let ( setup = WAReset;
WAGetURL( "http://example.com/images/logo.jpg" ; "username=bob123", "password=secretpass" ; "type=container" )
)
To upload files to a web form, pass container data to the WASetInputValue
function, or a URL to the WAUploadFileAtURL
function:
Let ( setup = WAReset;
WASetInputValue( "upload1" ; Products::picture_container ) &
WAUploadFileAtURL( "upload2" ; "file:///Users/sam/Pictures/header.jpg" )
;
WAGetURL( "http://example.com/upload.php" )
)
Proxy Support
If you are behind a proxy server, you will need to tell the WebAssistant plugin information about the proxy host, as follows:
WAConfigure("proxyHost", settings::proxyHost) and
WAConfigure("proxyPort", settings::proxyPort)
Do this in your startup script, and any further connections will go through your proxy host.
360Works Plugin Setup Guides
See Plugins_101 for Error reporting, installation, registration, and more.