MANUAL
Forms Management System: www.formdesk.com
 
 

 

Webservice: SOAP implementation

 
Intended audience: Developers
Status: Stable

NOTE: There is also a REST API available. The SOAP API will be kept available. 

Table of Contents

  • API Credits
  • Webservice URL
  • Namespaces
  • Method Input
  • Method Result
  • Webservice Methods
  • Status Codes
  • XML Datatypes
  • FormName Input Parameter
  • General Input Parameters
  • Results Input Parameters
  • Form Results Status
  • System Fields
  • SOAP Implementations
  • Getting Started

API Credits

All methods of the webservice api cost 1 credit per call except where explicitly indicated at the method description.

^ top
 

Webservice URL

Structure

 [protocol]://[server]/api/soap/key/[apikey]
[protocol]://[server]/api/soap.wsdl

Protocol

 ValueDescription
httpUnencrypted
httpsEncrypted (recommended)

Server

The server depends on which Formdesk server your account resides. It is advisable to always start with the main Formdesk server (www.formdesk.com) and call the Connect() method to determine the right server to contact. This will prevent loss of communication when Formdesk needs to relocate your account to a different server.

 Recommended value: www.formdesk.com

API Key

This key identifies your account.

^ top
 

Namespaces

Formdesk uses the following namespaces:

  NamespaceAttribute Prefix
1urn:formdesk:attributesfd:
2urn:formdesk:return-statusrs:

Formdesk uses namespaces only to prefix ellement attributes. The default namespace is urn:formdesk:attributes and so the default attribute prefix fd:.

Note that these namespaces and prefixes are not required when a method accepts XML input (like the Params input parameter).

Some methods, like FormResultsAdd or FilesRemove, accept a kind of recordset as input. Because the status of each 'record' can be different, Formdesk adds a status attribute (rs:status) to the 'record' element itself. When the status code is different than 200 a message attribute (rs:message) is also included.
These attributes, status and message, are prefixed with rs: to avoid attribute name conflicts.

Custom Namespaces

All methods which accept XML data as input will output this same XML. This gives you the ability to add your own attributes to 'record' elements, like for instance your own database id. Because these attributes are still present in the output XML you are able to link back to your database.

To avoid attribute name conflicts it is strongly advisable to use your own namespace and prefix to specify additional attributes.

Example

This example descibes the Data input parameter of the FormResultsAdd / FormResultsUpdate method.
<_fd_id>4692520 Will Smith
Somewhere 1
There
The example method output/result:
200 <_fd_id>4692520 Will Smith
Somewhere 1
There
The method descriptions furtheron in this document also include examples of the Formdesk namespaces, custom namespaces and prefixes.
 

Method Input

It is very important to note that each parameter specified in the method definition is required. Leaving out a parameter can result in an error message. If you don't need a parameter, like the Params parameter, you can just pass an empty string.

The Params parameter, of many methods, is a special xml formatted string. The basic structure is described below.

Basic structure of the Params XML format

<params xmlns:fd="urn:formdesk:attributes">
    <param fd:name="[name]" fd:dt="[xml datatype]">[value]</param>
</params>
  Description
[name]The name of the parameter
[xml datatype]See the list of XML Datatypes.
NOTE that the fd:dt attribute may be ommitted. When ommitted, the parameter will be of type string by default.
[value]The parameter value

The specific parameters are described at the methods which make use of the parameter.

Example

<params xmlns:fd="urn:formdesk:attributes">
    <param fd:name="created_from" fd:dt="datetime">2010-01-21T12:00:00</param>
    <param fd:name="created_to" fd:dt="date">2010-03-31</param>
</params>

NOTE that the xmlns namespace and fd: attribute prefix may be ommitted. The dt attribute may also be ommitted. When the dt attribute is ommitted Formdesk treats the parameter value as of type string.

Important notice when using SoapUI

SoapUI is an excellent webservice testsuite. More infomation about SoapUI.

Normally, SOAP is used to remove the code burden from the developer and allows you to use a webservice like any other object in the development environment. SoapUI is a tool to explore and test a webservice presenting you the raw XML request en reponse messages. The only difficulty is that you have to understand the code behind the SOAP protocol. At least so you are able to integrate the parameters into a soap request.

The parameter formatting Formdesk uses is mostly XML while the code behind the SOAP request also consist of XML. The main reason for this way of parameter formatting is the flexibility in expanding the functionality of methods without the need of the connecting party (you) to rewrite the software. A drawback we are experiencing when you are using SoapUI to test the webservice is that this parameter formatting can be a bit confusing.

Below is an example of a SoapUI request for the FormResultsGet method:

? ?

The first parameter FormName is strait forward. You just replace the question mark with the name of the form.

The second parameter Params however, could be a bit confusing. Params is the name of this parameter and has nothing to do with the params root node of the parameter content string as described in the section Basic structure of the Params XML format above.

A second thing to notice is that the content of a parameter has to be encoded or placed in a CDATA xml node.

Below is a complete example of the SoapUI request for the FormResultsGet method:

form1 xml-schema-inline ]]>

^ top
 

Method Result

Each method returns a string value which contains XML.

Basic structure of the XML result value

<result xmlns:fd="urn:formdesk:attributes">
    <status fd:dt="int|float">[status code]</status>
    <credits fd:dt="int">[api credits]</credits>
</result>
A succesfull method call returns status code 200. See the list of possible Status Codes.
The credits node value contains the API credits left after a method call.
The XML result of a successful operation can be found at the described methods further below in this document.

Example of an error message

401.1 2345 Logon failed You are not logged in.

Example of an extended structure of the XML result

<result xmlns:rs="urn:formdesk:return-status" xmlns:fd="urn:formdesk:attributes">
    <status fd:dt="int|float">[status code]</status>
    <credits fd:dt="int">[api credits]</credits>
    <value>
        <file fd:name="example.gif" rs:status="404" rs:message="File not found" />
    </value>
</result>

Methods which accept a kind of recordset, like for instance FormResultsAdd or FilesRemove, return a status code on a record/xmlnode itself. This is because the operation on one record can succeed and another for instance fails with code 404.5 'Result entry not found'.

Only when the rs:status code is different then 200, indicating an error, the rs:message attribute is present. To avoid a name conflict these status attributes use the rs: prefix and the xmlns:rs namespace attribute is added to the root element.

See the list of possible Status Codes.


^ top
 

Webservice Methods

  • Connect
  • ListGet
  • SignOn
  • Park
  • FormsGet
  • FormResultsExport
  • FormResultsGet
  • FormResultGet
  • FormResultProcessed
  • FormResultAdd
  • FormResultUpdate
  • FormResultRemove
  • FormResultPdfGet
  • FormFiltersGet
  • FileGet
  • VisitorsGet
  • VisitorAdd
  • VisitorUpdate
  • VisitorRemove
  • VisitorAuthenticate
  • VisitorResultsGet


Connect(string Params)
This method can be used to determine the correct Formdesk server on which your account resides. It is advisable to call this method at the beginning of every session to determine the right server to communicate with.
Example
  • You firstly use the www.formdesk.com webservice URL in the call to the Connect method.
  • Formdesk responses with information to connect to the correct Formdesk server. In this example your account resides on the fd8.formdesk.com server.
  • Secondly you change the webservice URL to point to fd8.formdesk.com and call the FormResultsGet method.
  • Formdesk responses with a list of the completed result entry id's of the specified form with a download status of new or changed.
  • For each id in the list:
    • Call the FormResultGet method to get the result entry details.
    • Call the FormResultProcessed method to mark the download status of the result entry as processed.

Credits

This method costs no credits.

Input

 ParameterTypeDescription
Paramsstring See the basic structure of the Params XML format.
NameTypeDescription
change_keybooleanWhen specified (set to 1) Formdesk will replace the API Key with a new one.
This option provides you with a high level of security. Note that this option can not be used when the API is called from multiple locations with separate configurations.
domainstringDomain / folder of forms
usernamestring(Sub)Username
passwordstringPassword
All parameters are optional, if you connect using a domain, username and password parameter use the following endpoint URL:
[protocol]://[server]/api/soap/

Result

200 2345 8ab373f4bcc848079e358077b77da991 fd8.formdesk.com yourdomain https://fd8.formdesk.com/yourdomain/ https://fd8.formdesk.com/api/soap/key/8ab373f4bcc848079e358077b77da991/lang/2 Central Standard Time

The urlsoap is the most important element. This value contains the complete webservice URL to the server on which your account resides.

The timezone specifies the timezone in which the date(time) values are returned. You can use the datetime_in_gmt or id_tzi parameters to override this timezone setting. You can use the ListGet() method to find out a specific timezone id which can be used with the id_tzi input parameter.


^ top | ^ method list
 
ListGet(string List, string Params)
With this method you can request some informational lists.

Input

 ParameterTypeDescription
List string Available lists:
ValueDescription
statuscodesReturns a list of posible status codes with their description.
timezonesReturns a list of Formdesk timezones with id, bias and name. You can use this list to lookup a specific timezone id for the id_tzi input parameter.
ParamsstringA reserved parameter for future use. You can pass an empty string.

Result (statuscodes)

0 2345 Logon failed Logon failed due to server configuration Unauthorized due to ACL on resource Authorization failed by filter ...

Result (timezones)

200 2345 Canada Central Standard Time Cape Verde Standard Time Caucasus Standard Time ...

^ top | ^ method list
 
SignOn(string Data, string Params)

This method can be used for Single SignOn purpose where users can access their Formdesk account or visitors can access a form without the need to enter their username and password.

Example
  • The user is surfing the intranet and clicks on a link to view the results of a form.
  • The intranet server receives the request from the client and requests Formdesk to open a session for that user.
  • Formdesk starts a session and returns a redirect URL.
  • The intranet server returns a redirect response to the client.
  • The client redirects the user to Formdesk.
  • The user now has access to Formdesk.

Input

 ParameterTypeDescription
Data string See the basic structure of the Params XML format.
ParamsstringA reserved parameter for future use. You can pass an empty string.

Data

123 John Smith john secret my-editable-form 98765

All data parameters are optional. The only requirement is that the query based upon the given search parameters result in only one user or visitor.
When a form identification is passed (form_name or form_id) Formdesk only queries the visitor accounts. Otherwise Formdesk queries the supervisor account and the sub-user accounts.

 ParameterDescription
id Formdesk user id.
name Formdesk will search the name of the user. Not case-sensitive.
username Not case-sensitive
password Case-sensitive
form_name Only applicable when signing on a visitor for a specific form. The name of the form is appended to the returned redirect URL.
form_id Only applicable when signing on a visitor for a specific form. The name of the form is appended to the returned redirect URL.

Result

200 2345 abaf6bbf8dc74221aa49fe25d6841040 https://www.formdesk.nl/foldername/?lang=2&signon=abaf6bbf8dc74221aa49fe25d6841040

The URL can be used to redirect the user to Formdesk.

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.4User/Visitor not foundThe user, of a Formdesk account, or visitor, of an editable form, can not be found.
409.7Multiple users foundThe SignOn search query resulted in multiple users.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
Park(string Data, int Expires, string Params)

This method can be used to push form data to Formdesk whithout the need of passing the data using URL parameters. The data is parked temporarily and a ticked is returned. When a valid ticket is passed to a form Formdesk will prefill the form using the parked data.

Formdesk can only prefill fields of which the identifier is found as parameter name.
NOTE that unlike the URL parameter names the parameter names (identifiers) here are without the def_ prefix.

Input

 ParameterTypeDescription
Data string See the basic structure of the Params XML format.
Expires int Value in seconds the data expires. The data can not be used after datetime of parking + expire seconds.
Params string See the basic structure of the Params XML format.
NameTypeDescription
reusebooleanWhen specified (set to 1) the returned ticket can be used multiple times before it expires. The ticket can be used one time by default.
preventchange boolean When specified (set to 1) the form can only be requested with a parking ticket and the parked data is used when the form is being saved instead of the posted data.
Note that after using this parameter and requesting the form with the ticket for the first time the form can no longer be requested without a ticket. To restore the form to be requested without a ticket you have to use this method ones again with this parameter set to 0 (false) and request the form with the returned ticket.
Also note that the visitor has to complete the form before the parking ticket expires. Use the Expires parameter to give the visitor enough time to complete the form.

Data

Will Smith Somewhere 123 ...
NOTE that the xmlns namespace and fd: attribute prefix may be ommitted. The dt attribute may also be ommitted. When the dt attribute is ommitted Formdesk treats the parameter value as of type string.

Result

200 2345 abaf6bbf8dc74221aa49fe25d6841040

The ticket value is a string of 32 characters (GUID) which can be used as parameter of a request to a form.
https://www.formdesk.com/yourdomain/yourform?ticket=abaf6bbf8dc74221aa49fe25d6841040. Formdesk will then use the parked parameters as form field values.
Note that you can use parked or ticket as parameter name.


^ top | ^ method list
 
FormsGet(string Params)
With this method you can retrieve a list of forms.

Input

 ParameterTypeDescription
Params string See the General Input Parameters
NameTypeDescription
formatstringSee the General Input Parameters

Result

200 2345 27137 job-selection
...

^ top | ^ method list
 
FormResultsExport(string FormName, string Format, string Params)
This method exports the form results to various file formats.

Credits

The amount of credits is equal to the result entries exported with a minimum of one credit.

Input

  Parameter Type Description
FormName string The name of the form (case-insensitive). Additional infomation.
Format string
Value Description
excel2007 MS Excel 2003 (.xls)
excel2007-plain MS Excel 97 (.xls)
foxpro MS Visual Foxpro (.dbf, .fpt)
xml XML (.xml)
dbase dBase (.dbf, dbt)
text Text
csv CSV (separated by semicolon)
csv-comma CSV (separated by comma)
Params string See the Results Input Parameters

Result

200 2345 ... 1 4692520

^ top | ^ method list
 

Synchronize Form Results

Synchronizing form results with the Formdesk Api is very easy and can be accomplised using three simple method calls.
 
Example
  • Use the Connect method to determine the correct Formdesk server to make the Api calls.
  • Formdesk responses with information to connect to the correct Formdesk server.
  • Call the FormResultsGet method like: FormResultsGet('form1', '').
  • Formdesk responses with the completed (status DONE) result entry id's of form1 with a sync status of new or changed.
  • Call the FormResultGet method to get the result entry details.
  • Call the FormResultProcessed method to mark the sync status of these result entries as processed.
  • From the Formdesk response you can determine if all or which result entries have been processed succesfully.
Sync Status
The first sync status a result entry gets is New (N). This status will not change as long as the result entry has not been processed. A result entry gets the sync status Processed (P) by an webservice call to FormResultProcessed. Only after a result entry has been processed the sync status can change to Changed (C) when the result entry gets modified.
Use the sync_status Result Input Parameter to select result entries with specific sync status.
 
FormResultsGet(string FormName, string Params)
This method returns a list of result entry id's.
Example usage:
  • Simply synchonize result entries.
  • Use parameters and/or pre-defined filters to select form results based on search and/or pre-defined criteria.

Input

 ParameterTypeDescription
FormNamestringThe name of the form (case-insensitive). Additional infomation.
Params string See the Results Input Parameters
When the parameter status is ommited Formdesk only selects completed entries (status DONE).
You can specify ALL as parameter value to let Formdesk ignore this filter parameter.
When the parameter sync_status is ommited Formdesk only selects entries with sync status N and C.

Result

200 2345 <_fd_id fd:dt="int">4692520 ...

The result elements contain only one child element. The name of this child element (_fd_id) matches the same element in the result of a call to the method FormResultGet.

Result (format=xml-schema)

With this format an external schema is included in the value node of the method result.
This schema can be used for several purposes. One purpose can be to validate the result xml against the schema. Another purpose can be to import the results into an application like MS Excel.

Example:

  • Save the xsd:schema node xml to a file, for instance results.xsd
  • Replace the value of the xsi:noNamespaceSchemaLocation attribute (%schema%) on the results node with schema filename
  • Save the results node xml to a file, for instance results.xml
  • Now you can open the results.xml file in MS Excel

200 2345 <_fd_id>4692520 ...

Result (format=xml-dataset)

For applications which can handle and validate inline schema's (.NET) this format may be useful.
200 2345 <_fd_id>4692520 ...

^ top | ^ method list
 
FormResultGet(int ResultID, string Params)
This method returns one result entry.
Example usage:
  • Synchonize form results.

Input

 ParameterTypeDescription
ResultIDstringThe result entry id.
Params string See the General Input Parameters
NameTypeDescription
formatstringSee the General Input Parameters
include_filesbooleanSpecifies if the uploaded files (with a form upload element) are included in the result.

Result

<result xmlns:rs="urn:formdesk:return-status" xmlns:fd="urn:formdesk:attributes">
    <status fd:dt="int">200</status>
    <credits fd:dt="int">2345</credits>
    <value fd:dt="xml">
        <result>
            <_fd_id fd:dt="int">4692520</_fd_id>
            <_fd_add fd:dt="datetime">2009-12-10T09:06:47</_fd_add>
            <name fd:dt="string">Will Smith</name>
            ...
            <cv fd:dt="string">143902_curriculum_vitae.doc</cv>
        </result>
        <files>
            <file fd:name="143902_curriculum_vitae.doc" fd:id="3458473" fd:url="https://www.formdesk.com/<folder of forms>/143902_curriculum_vitae.doc?sid=d4e904f889f8401a9bc99cec3e0f98e0" rs:status="200" fd:dt="bin.base64" fd:contenttype="application/vnd.ms-word">
                ...
            </file>
        </files>
    </value>
</result>
 

The result child elements prefixed with _fd_ are Formdesk system fields. See System Fields table for the possible fields included in the result xml.

Each question in a Formdesk form has a so called identifier. This identifier also represents a child element in the xml result xml. NOTE that all xml element names are in lowercase.

When the form contains one or more form upload elements a files element is included with the uploaded files belonging to the result entry. When the parameter include_files is passed and true the content will be included within the file elements. To avoid very large soap responses and possible buffer limitations, it is best practice to take the fd:url attribute from a file element and load the file contents with a simple http request. The fd:url attribute value contains the complete URL to the file including a sid parameter. The sid parameter contains a session id which is valid for 24 hours. After that time the URL can not be used anymore.

Result (format=xml-schema)

With this format an external schema is included in the value node of the method result.
This schema can be used for several purposes. One purpose can be to validate the result xml against the schema. Another purpose can be to import the results into an application like MS Excel.

Example:

  • Save the xsd:schema node xml to a file, for instance results.xsd
  • Replace the value of the xsi:noNamespaceSchemaLocation attribute (%schema%) on the results node with schema filename
  • Save the results node xml to a file, for instance results.xml
  • Now you can open the results.xml file in MS Excel

<result xmlns:fd="urn:formdesk:attributes">
    <status fd:dt="int">200</status>
    <credits fd:dt="int">2345</credits>
    <value fd:dt="xml">
        <xs:schema id="results" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
            <xs:element name="results" msdata:IsDataSet="true">
                <xs:complexType>
                    <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="result" form="unqualified">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="_fd_id" form="unqualified" type="xs:int">
                                        <xs:annotation><xs:documentation>Record number</xs:documentation></xs:annotation>
                                    </xs:element>
                                    ...
                                    <xs:element name="_fd_add" form="unqualified" type="xs:dateTime">
                                        <xs:annotation><xs:documentation>Date submitted</xs:documentation></xs:annotation>
                                    </xs:element>
                                    <xs:element name="name" form="unqualified">
                                        <xs:annotation><xs:documentation>Name</xs:documentation></xs:annotation>
                                        <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                <xs:maxLength value="100" />
                                            </xs:restriction>
                                        </xs:simpleType>
                                    </xs:element>
                                    <xs:element name="address" form="unqualified">
                                        <xs:annotation><xs:documentation>Address</xs:documentation></xs:annotation>
                                        <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                <xs:maxLength value="100" />
                                            </xs:restriction>
                                       </xs:simpleType>
                                    </xs:element>
                                    ...
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:choice>
                </xs:complexType>
            </xs:element>
        </xs:schema>
        <results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="%schema%">
            <result>
                <_fd_id>4692520</_fd_id>
                ...
                <_fd_add >2009-12-10T09:06:47</_fd_add>
                <name>Will Smith</name>
                <address>Somewhere 111</address>
                ...
                <cv fd:dt="string">143902_curriculum_vitae.doc</cv>
            </result>
        </results>
        <files>
            <file fd:name="143902_curriculum_vitae.doc" fd:id="3458473" fd:url="https://www.formdesk.com/<folder of forms>/143902_curriculum_vitae.doc?sid=d4e904f889f8401a9bc99cec3e0f98e0" rs:status="200" fd:dt="bin.base64" fd:contenttype="application/vnd.ms-word">
                ...
            </file>
        </files>
    </value>
</result>

Result (format=xml-dataset)

For applications which can handle and validate inline schema's (.NET) this format may be useful.
<result xmlns:fd="urn:formdesk:attributes">
    <status fd:dt="int">200</status>
    <credits fd:dt="int">2345</credits>
    <value fd:dt="xml">
        <dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <xs:schema id="dataset" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
                <xs:element name="dataset" msdata:IsDataSet="true" msdata:MainDataTable="results">
                    <xs:complexType>
                        <xs:choice minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="results" form="unqualified">
                                <xs:complexType>
                                    <xsd:sequence>
                                        <xs:element name="_fd_id" form="unqualified" type="xs:int">
                                            <xs:annotation><xs:documentation>Record number</xs:documentation></xs:annotation>
                                        </xs:element>
                                        ...
                                        <xs:element name="_fd_add" form="unqualified" type="xs:dateTime">
                                            <xs:annotation><xs:documentation>Date submitted</xs:documentation></xs:annotation>
                                        </xs:element>
                                        <xs:element name="name" form="unqualified">
                                            <xs:simpleType>
                                                <xs:restriction base="xs:string">
                                                    <xs:maxLength value="100" />
                                                </xs:restriction>
                                            </xs:simpleType>
                                        </xs:element>
                                        <xs:element name="address" form="unqualified" nillable="true">
                                            <xs:annotation><xs:documentation>Address</xs:documentation></xs:annotation>
                                            <xs:simpleType>
                                                <xs:restriction base="xs:string">
                                                    <xs:maxLength value="100" />
                                                </xs:restriction>
                                            </xs:simpleType>
                                        </xs:element>
                                        ...
                                        <xs:element name="cv" form="unqualified">
                                            <xs:annotation><xs:documentation>Your Curriculum Vitae</xs:documentation></xs:annotation>
                                            <xs:simpleType>
                                                <xs:restriction base="xs:string">
                                                    <xs:maxLength value="150" />
                                                </xs:restriction>
                                            </xs:simpleType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:choice>
                    </xs:complexType>
                </xs:element>
            </xs:schema>
            <results>
                <_fd_id>4692520</_fd_id>
                <_fd_add >2009-12-10T09:06:47</_fd_add>
                <name>Will Smith</name>
                <address>Somewhere 111</address>
                ...
                <cv>143902_curriculum_vitae.doc</cv>
            </results>
        </dataset>
        <files>
            <file fd:name="143902_curriculum_vitae.doc" fd:id="3458473" fd:url="https://www.formdesk.com/<folder of forms>/143902_curriculum_vitae.doc?sid=d4e904f889f8401a9bc99cec3e0f98e0" rs:status="200" fd:dt="bin.base64" fd:contenttype="application/vnd.ms-word">
                ...
            </file>
        </files>
    </value>
</result>

^ top | ^ method list
 
FormResultProcessed(int ResultID, string Params)
Use this method, after the FormResultGet method call, to mark the result entry as processed. After a call to FormResultProcessed the result entry is excluded from the FormResultsGet method by default.

Input

 ParameterTypeDescription
ResultIDintThe id of the result entry.
Params string A reserved parameter for future use. You can pass an empty string.

Result

200 2345 1

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.5Result entry not foundThe specified result entry could not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
FormResultAdd(string FormName, string Data, string Params)
Use this method to add a result entry to a specific form.

Input

 ParameterTypeDescription
FormNamestringThe name of the form (case-insensitive). Additional infomation.
DatastringForm result data (see below)
Params string See the basic structure of the Params XML format.
NameTypeDescription
formatstringSee the General Input Parameters
process_messagesbooleanIndicates if Formdesk processes the email/sms messages after each addition/update.

Data

Will Smith
Somewhere 1
There .....

There is no required data. An empty result node will just result in an empty result entry in the database. Only when the result entry is maintainable by the visitor the visitor data must be identifiable to match an existing visitor or to create a new visitor. A result node with only a _fd_usrid node will result in an empty result entry linked to the specified visitor.

When a form is maintainable the visitor data can also be updated and/or added along with the result data. Visitor data consists of the following xml elements:

  • _fd_usrid - Visitor id (optional and only to specify an existing visitor)
  • _fd_user - Visitor name (required when no _fd_usrid is provided or the visitor does not exist)
  • _fd_email - Visitor email address (required when no _fd_usrid is provided or the visitor does not exist)
  • _fd_usrnm - Login Username (optional, if not present Formdesk used the _fd_user value)
  • _fd_psswrd - Login Password (optional, if not present Formdesk creates a password of 10 random characters)

When uploading files the dt and name attributes are required. The dt attribute can be of value file or bin.base64. The name attribute provides the filename. The contenttype attribute can also be specified, but is not required. If not specified Formdesk searches the contenttype using the file extension. The value or content of the xml node must be base64 encoded.

Result

200 2345 <_fd_id fd:dt="int">4692520 <_fd_add fd:dt="datetime">2012-03-19T08:53:26 <_fd_edit fd:dt="datetime">2012-03-19T08:53:26 <_fd_source fd:dt="string">W ... <_fd_status fd:dt="string">SUBM <_fd_editcode fd:dt="string">Mhj3rK <_fd_compl fd:dt="datetime">2012-03-19T08:53:26 ...

The resulting xml contains only the result entry system data. See the list of system fields for the possible fields.

Added result entries are not counted as submissions. However, they are included in the stored results count.
Posible error status codes for this operation are: 404.2, 404.4, 409.4, 409.6. See the list of status codes for the description.

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
409.6Limits exceededThe subscription limmits are reached.
404.5Result entry not foundThe specified result entry could not be found.
404.4User/Visitor not foundThe Visitor, of an editable form, can not be found.
401Access deniedYou have no permission to get this file.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
FormResultUpdate(int ResultID, string Data, string Params)
Use these methods to add or update form results.

Input

 ParameterTypeDescription
ResultIDintThe id of the result entry.
DatastringForm result data (see below)
Params string See the basic structure of the Params XML format.
NameTypeDescription
formatstringSee the General Input Parameters
process_messagesbooleanIndicates if Formdesk processes the email/sms messages after each addition/update.

Data

Same data as the FormResultAdd method.

Result

Same result as the FormResultAdd method.
Updated result entries are not counted as submissions.

Status codes

Same status codes as the FormResultAdd method.

Diffgram usage

This method also supports the Microsoft .Net Framework DataSet DiffGram format.
For instance you could use the FormResultGet method, load the result into a DataSet, change some values and pass the resulting DiffGram as input parameter to the FormResultUpdate method.

View the method Example2 of the gettingstarted.cs file for an example on how to use a DiffGram.


^ top | ^ method list
 
FormResultRemove(int ResultID, string Params)
This method can be used remove a single result entry by ResultID.

Input

 ParameterTypeDescription
ResultIDintThe id of the result entry.
Params string See the basic structure of the Params XML format.
NameTypeDescription
files_onlybooleanWhen specified (set to 1) Formdesk will only remove the associated uploaded files. Also with respect to posible given filter parameters. This parameter is independed of and can be used in combination with the other parameters.

Result

200 2345 1

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.5Result entry not foundThe specified result entry could not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
FormResultPdfGet(int ResultID, string Params)
With this method you can retrieve a Pdf file generated from a result entry.

Input

 ParameterTypeDescription
ResultID int The Formdesk ID of a result entry.
Params string All parameters are optional.
NameTypeDescription
formatstringSee the General Input Parameters
Content Settings
See the manual Displaying a copy of the completed form for more information about the three parameters below.
hideunansweredboolean
showhiddenboolean
ignoredependenciesboolean
Pdf Settings
papersizestringPossible values are: A3, A4, A5, Letter, Executive, Auto, widthxheight in inches. For Dutch and German the default is A4, otherwise the default is Letter.
orientationintThe page orientation. 1=portrait, 2=landscape. Defaults to portrait. Not applicable when papersize is set to auto.
scaletypeint0=original format (default, no scaling), 1=fit to width, 2=fit to one page. Not applicable when papersize is set to auto
scalingintThe scale factor. Defaults to 100%. Only applicable when scaletype is set to 1 and papersize is not set to auto
maringLeftintThe left margin of the Pdf document.
marginRightintThe right margin of the Pdf document.
marginTopintThe top margin of the Pdf document.
marginBottomintThe bottom margin of the Pdf document.
editprotectbooleanWhen specified and true, the Pdf is secured against modification.
copyprotectbooleanWhen specified and true, the Pdf is secured against copying.
userpasswordstringPdf can only be opened with this password.
ownerpasswordstringThe password by which the PDF document permissions can be changed. When not specified but one of the other security parameters is then a generated password is used.

Result (default format: xml-dt)

200 ...

Result (format: xml-schema-inline)

200 .... 0 example_23452.pdf application/pdf 34917 ....

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.3TimeoutA timeout occurred waiting on the Pdf generation process.
404.5Result entry not foundThe specified result entry could not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
FormFiltersGet(string FormName, string Params)
Use this method to retrieve the pre-defined filters (views) of a form.
A view can be used as parameter value of the FormResultsGet and FormResultsRemove methods.

Input

 ParameterTypeDescription
FormNamestringThe name of the form (case-insensitive). Additional infomation.
Params string A reserved parameter for future use. You can pass an empty string.

Result

200 2345 1314415 ViewName

^ top | ^ method list
 
FileGet(string Data, string Params)
Use this method to retrieve uploaded files.

Input

 ParameterTypeDescription
DatastringFile data (see below) At least one of both is needed (name or id)
Params string Empty string

Data

Result

200 5016 0M8R4K ... AAAAA

^ top | ^ method list
 
VisitorsGet(string Params)
This method retrieves all form visitors.
A visitor is a registered person who can login to a form which uses the feature Visitor must be able to maintain own form entries.

Input

 ParameterTypeDescription
Params string See the basic structure of the Params XML format.
NameTypeDescription
formatstringSee the General Input Parameters
searchstringWhen specified Formdesk searches all fields to contain this string. The search string can also specify an user id.

Result

200 3034 John Tester j.tester@formdesk.com test001 12!45 1511249 Employee info@formdesk.com employee test0907

^ top | ^ method list
 
VisitorAdd(string Data, string Params)
Use this method to add a visitor.
A sample usage is to synchronize users of you system with the visitors of your forms. Use the visitor synchronization in combination with the SignOn method to seamlessly intergrate Formdesk forms, for which authentication is required, into your system.

Input

 ParameterTypeDescription
DatastringVisitor data (see below)
Params string
NameTypeDescription
formatstringSee the General Input Parameters

Data

3034 John Tester j.tester@formdesk.com test001

VisitorAdd

  • The name and email data is required.

When the username is ommitted or the data is empty Formdesk will use the email address instead.
When the password is ommitted or the data is empty Formdesk will generate a random password of 10 characters.

John Tester j.tester@formdesk.com

Result

The returned Xml contains all elements (id, name, email, username, password).
200 2345 3034 John Tester j.tester@formdesk.com test001 12!45

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
409.1Already existsThe given visitor already exists or the username/password already exists.
404.4User/Visitor not foundThe Visitor can not be found.
409.2Input is requiredThe specified input is required (name, email or username).
409.3Invalid email addressThe format of the given email address is invalid.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
VisitorUpdate(int VisitorID, string Data, string Params)
Use this method to add a visitor.
A sample usage is to synchronize users of you system with the visitors of your forms. Use the visitor synchronization in combination with the SignOn method to seamlessly intergrate Formdesk forms, for which authentication is required, into your system.

Input

 ParameterTypeDescription
VisitorIDintId of the visitor to update.
DatastringVisitor data (see below)
Params string
NameTypeDescription
formatstringSee the General Input Parameters

Data

3034 John Tester j.tester@formdesk.com test001

VisitorUpdate

  • Only the id data is required.

When the username is passed but the data is empty Formdesk will use the email address instead.
When the password is passed but the data is empty Formdesk will generate a new random password of 10 characters.

John Tester j.tester@formdesk.com

Result

The returned Xml contains all elements (id, name, email, username, password).
200 2345 3034 John Tester j.tester@formdesk.com test001 12!45

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
409.1Already existsThe given visitor already exists or the username/password already exists.
404.4User/Visitor not foundThe Visitor can not be found.
409.2Input is requiredThe specified input is required (name, email or username).
409.3Invalid email addressThe format of the given email address is invalid.

See Method Result for information about the XML result structure.

Diffgram usage

This method also supports the Microsoft .Net Framework DataSet DiffGram format.
For instance you could use the VisitorsGet method, load the results into a DataSet, change some values and pass the resulting DiffGram as input parameter to the VisitorsUpdate method.

View the method Example2 of the gettingstarted.cs file for an example on how to get a DiffGram from the changes.

The result of updating using a DiffGram is just like the normal result.


^ top | ^ method list
 
VisitorRemove(int VisitorID, string Params)
Use this method to remove visitors.

Input

 ParameterTypeDescription
VisitorIDintId of the visitor to remove.
Params string A reserved parameter for future use. You can pass an empty string.

Result

200 2345 1

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.2Not foundThe Visitor can not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
VisitorAuthenticate(string Username, string Password, string Params)

Input

 ParameterTypeDescription
UsernamestringVisitors username.
Password string Visitors password.
Params string
NameTypeDescription
formatstringSee the General Input Parameters

Result

200 2345 3034 John Tester j.tester@formdesk.com test001 12!45

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.4User/Visitor not foundThe Visitor can not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 
VisitorResultsGet(int VisitorID, string Params)

Input

 ParameterTypeDescription
VisitorIDintThe Formdesk ID of the visitor
Params string See the basic structure of the Params XML format. See the Results Input Parameters.
Specific parameters:
NameTypeDescription
form_partstringWhen specified Formdesk will only include form results where this string is part of the form name.
form_liststringThis can be a comma separated list of form names and/or form id's.
If both parameters are specified Formdesk will use both parameters to match a form. Both parameters are case-insensitive.
format string See the General Input Parameters. Using this parameter with value other then xml-dt will only influence the format of the results part of the xml.

Result

200 2345
488 contact Contact Form <_fd_id>4692520 Will Smith
Somewhere 1
There 143902_curriculum_vitae.doc
...
1523 inquiry Inquiry Form <_fd_id>6985621 Very Good 1 ...

Status codes

Specific status codes indicating an error:
 Status CodeMessageDescription
404.4User/Visitor not foundThe Visitor can not be found.

See Method Result for information about the XML result structure.

^ top | ^ method list
 

Status Codes

Possible status codes:
 Status CodeMessageDescription
200SuccessThe requested operation completed successfully. The <value> field contains the requested result.
500Internal server errorThis is a generic application error. This error should not occur.
401Access deniedYou have no access to perform the requested operation.
401.1Logon failedYou are not logged in. The API Key is incorrect.
401.4Authorization failed by filterThere where to many incorrect logon attempts within a certain time frame. Logging into the account is blocked for a short time. Howerver, your forms are still available.
403.8Site access deniedYour account has been suspended or your subscription has been expired.
404Not foundThe requested resource can not be found.
404.2Not foundThe form cannot be found.
404.3TimeoutA timeout occurred.
404.4User/Visitor not foundThe user, of a Formdesk account, or visitor, of an editable form, can not be founds
404.5Result entry not foundThe specified result entry could not be found.
409ConflictA conflict has occured.
409.1Username already existsUsername / password combination already exists.
409.2Input is requiredThe 'Input' string will be replace with the missing data field.
409.3Invalid formatThe 'format' string will be replace with the invalid data description.
409.4Response limit exceededValue as specified in the Settings tab of the form.
409.5Prohibited by triggerAn operation can be prohibited by customized code.
409.6Limits exceededThe subscription limmits are reached.
409.7Multiple users foundThe SignOn search query resulted in multiple users.

The datatype of the Status Code can be int or float.

^ top | ^ method list
 

XML Datatypes

 TypeDescription
int
float
numberCurrency (probably not used)
string
boolean0 = false, 1 = true
dateFormat: yyyy-mm-dd
datetimeFormat: yyyy-mm-ddThh:mm:ss
Example: 2010-03-24T03:56:00
object
xml
bin.base64

^ top | ^ method list
 

FormName Input Parameter

Normally, this parameter just means the name of the form. In case you really want to use the form id you can use an XML string structured as below.
<form id="[form id]" />
Also possible:
<form name="[form name]" />
 

General Input Parameters

See the basic structure of the Params XML format.
 NameXML DatatypeDescription
datetime_in_gmtbooleanBy default the date(time) values are returned in the timezone specified in your Formdesk Account information. With this parameter you can easily get the date(time) values returned in GMT/UTC.
id_tziintIf you want the date(time) values translated to a specific timezone you can use the ListGet() method to get a list of all Formdesk timezones with the id, bias and name.
format string This parameter specifies the xml format of the result in the returned value node. The parameter is applicable when listed at the input parameters of a method.
FormatDescription
xml-dtThis is the default when not specified. It formats the xml like the examples in this manual.
xml-plainPlain xml without any attributes.
xml-schemaThis value formats the xml with an external schema definition. The schema is included first within the value node and can be saved to a separate xsd file. The string %schema% in the data root node has to be replaced by the filename of the schema. This format can be consumed by MS Excel 2010.
xml-datasetThis value formats the xml with an inline schema definition. This format can be consumed by a Microsoft ADO.NET DataSet.
xml-datatableThis value formats the xml with an inline schema definition. This format can be consumed by a Microsoft ADO.NET DataTable.


^ top | ^ method list
 

Results Input Parameters

See the basic structure of the Params XML format.
  Name XML Datatype A/F Description
Filter parameters
id_from int   The Formdesk ID from which to start (this ID is included).
id_to int   The Formdesk ID on which to end (this ID is included).
created_from date, datetime   The submission date from wich to start.
created_to date, datetime   The submission date on which to end.
status string   The status of the result entry
See Form Result Status for possible values.
changed_from date, datetime   The date of the last modification from which to start.
changed_to date, datetime   The date of the last modification on which to end.
completed boolean 2, 3 Selects the ready declared entries / completed entries.
completed_from date, datetime 2, 3 The date on which the entry is declared ready (completed) from which to start.
completed_to date, datetime 2, 3 The date on which the entry is declared ready (completed) on which to end.
id_visitor int 2 The Formdesk ID of the visitor.
name string 2 A string which is part of the visitors name.
email string 2 A string which is part of the visitors email address.
confirmed boolean 4 Selects the confirmed entries.
verified boolean 5 Selects the verified entries.
verified_from date, datetime 5 The date on which the entry is verified from which to start.
verified_to date, datetime 5 The date on which the entry is verified on which to end.
sync_status string   The sync status of the result entry.
N = new, C = changed, P = processed, ALL = disregards the download status.
View / search parameters
These parameters will not be used together.
view string   The name of the pre-set filter to use.
search string   General search string. Will not be searched in the system fields.
Other parameters
format string   See the General Input Parameters
General parameters
 
  Applicable Feauture
1 Save on cancellation
2 Visitor must be able to maintain own form entries
3 Visitor must be able to store form entries and finish later
4 Pre-submission confirmation screen
5 E-mail verification

Example

<params xmlns:fd="urn:formdesk:attributes">
    <param fd:name="created_from" fd:dt="datetime">2010-01-21T12:00:00</param>
    <param fd:name="created_to" fd:dt="date">2010-03-31</param>
</params>

^ top | ^ method list
 

Form Result Status

  Status R.F. Description
SAVED 2, 3 Stored entries to be finished later.
SUBM all Stored entries.
CFS 4 The submission has to be confirmed.
CFD 4 The submission has been confirmed.
EVS 5 The submission has to be verified by email.
EVD 5 The submission has been verified by email.
SVS 6 The submission has to be verified by SMS.
SVD 6 The submission has been verified by SMS.
PMS 7 Payment process had been started.
PMD 7 Payment process has been finished.
DNS 8 Signing process had been started.
DND 8 Signing process has been finished.
WFS 1 Workflow process had been started.
WFD 1 Workflow process has been finished.
DONE all The form entries are completed.
 
  Related Feauture
1 Workflow messages are used
2 Visitor must be able to maintain own form entries
3 Visitor must be able to store form entries and finish later
4 Pre-submission confirmation screen
5 E-mail verification
6 Sms verification
7 Online Payment
8 Signing (DigiD / eHerekenning)

^ top | ^ method list
 

Form Item Types

These types are the possible values of the type node of the FormItemsGet result.
 TypeDescription
input["text"]General text item with a maximum length of 254 chararters
input["radio"]Multiple-choice, select one.
input["checkbox"]Multiple-choice, select many. In the download the selected options are separated with a carriage-return.
checkboxSimple checkbox item. Downloaded values are TRUE or FALSE.
selectList box / dropdown list.
textareaText Area. This is a large multi-line field.


^ top | ^ method list
 

System Fields

This table shows the complete set of possible system fields. The field's inclusion depends on the used feature and the pre-set filter which can be passed as a Result Input Parameter.
  Name XML Datatype A/F Description
_fd_id int   The Formdesk ID
_fd_workflow datetime 1 Datetime of when the workflow has been finished. An empty value indicated an unfinished workflow process
_fd_seqno int 2 Sequential number
_fd_source string   The source of where the result entry came from
_fd_status string   The status of the result entry
S = started, C = cancelled, P = pending, D = done/finished
_fd_add datetime   The submission date on which to end
_fd_edit datetime   The datetime of the last modification
_fd_pstat string   The payment status
P = Paid, E = Expired, A = Canceled
_fd_compl datetime 4, 5 The datetime the result entry has been finished/declared ready
_fd_usrid int 4 The Formdesk visitor ID
_fd_user string 4 Name of the visitor
_fd_email string 4 Email of the visitor
_fd_usrnm string 4 Username of the visitor
_fd_psswrd string 4 Password of the visitor
_fd_editcode string   Code to continue interim stored entries in a form
_fd_conf boolean 6 Indicates the visitor has confirmed the filled-in form
_fd_verif datetime 7 Datetime the entry has been verified by email
_fd_smsverif datetime 8 Datetime the entry has been verified by sms
 
  Applicable Feauture
1 Workflow messages are used
2 Submission order number
3 Save on cancellation
4 Visitor must be able to maintain own form entries
5 Visitor must be able to store form entries and finish later
6 Pre-submission confirmation screen
7 E-mail verification
8 Sms verification

^ top | ^ method list
 

SOAP Implementations

Various SOAP implementations exists for various languages. Below you find a short list of the most common implementations.
 Microsoft SOAP Toolkit 3.0This toolkit can be downloaded from here. Note that this toolkit has been superseded by the .NET framework.
.NET Framework.NET Framework documentation can be found here. With the Web Services Description Language Tool (wsdl.exe) a source file can be generated in the specified .NET language.
JavaHere you can find an overview of the Java Web Services on the Sun Developer Network. A tutorial can be found here
PHPSOAPThis implementation is incorporated into PHP5. The manual can be found here.
NuSOAP Toolkit for PHPNuSOAP provides a set of PHP classes which can be used in PHP4. The toolkit can be downloaded from SourceForge.

^ top
 

Getting Started


To get started you can download the files below. These files are written in Microsoft Visual C# 2010 Express and PHP.
The examples are using the methods Connect, FormResultsGet, FormResultsProcessed, FormResultsUpdate, FormsGet, VisitorsGet and VisitorUpdate.
  • A zip file, formdesk-php-soap-example.zip, containing PHP examples
  • A PDF document, Formdesk-API-form-import.pdf, containing Form import XML structure
Note that these files are subject to change and offered as an example only. However, you may use the wrapper class and sample code to build on.

^ top