This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Forms in 123ContactForm



Overview

The following operations allow you to work with forms. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with forms, see Sample configuration

OperationDescription

getFields

Retrieves information about the fields of a certain form.

getFormRetrieves details of a specific form. 
getFormSubmissionCountRetrieves the submission count for a given form.
getFormSubmissionsRetrieves details about the submissions of a certain form.
listFormsRetrieves details of forms.

Operation details

This section provides further details on the operations related to  forms .

Retrieving information about the fields of a certain form

The getFields operation retrieves information about the fields of a certain form.

getFields
<contactform.getFields>
	<formId>{$ctx:formId}</formId>
</contactform.getFields>
Properties
  • formId: The ID of the form from which fields need to be retrieved.
Sample request

Following is a sample REST/JSON request that can be handled by the getFields operation.

Sample Request for getFields
{
	"apiOutput":"json",
	"apiUrl":"https://www.123contactform.com",
	"apiKey":"743401-1438926394-tzsh7xqrgu8a9wb34",
	"formId":"1540386"
}
Related 123ContactForm documentation

http://www.123contactform.com/docs/123contactform-api-retrieve-fields/

Retrieving details of a specific form

The getForm operation retrieves details of a specific form.

getForm
<contactform.getForm>
	<formId>{$ctx:formId}</formId>
</contactform.getForm>
Properties
  • formId: The ID of the form which needs to be retrieved.
Sample request

Following is a sample REST/JSON request that can be handled by the getForm operation.

getForm
{
	"apiOutput":"json",
	"apiUrl":"https://www.123contactform.com",
	"apiKey":"743401-1438926394-tzsh7xqrgu8a9wb34",
	"formId":"1540386"
}
Related 123ContactForm documentation

http://www.123contactform.com/docs/123contactform-api-retrieve-forms/

Retrieving the submission count for a given form

The getFormSubmissionCount operation retrieves the submission count for a given form.

getFormSubmissionCount
<contactform.getFormSubmissionCount>
	<formId>{$ctx:formId}</formId>
</contactform.getFormSubmissionCount>
Properties
  • formId: The ID of the form from which, submissions-count need to be retrieved.
Sample request

Following is a sample REST/JSON request that can be handled by the getFormSubmissionCount operation.

getFormSubmissionCount
{
	"apiOutput":"json",
	"apiUrl":"https://www.123contactform.com",
	"apiKey":"743401-1438926394-tzsh7xqrgu8a9wb34",
	"formId":"1540386"
}
Related 123ContactForm documentation

http://www.123contactform.com/docs/123contactform-api-retrieve-submissions-count/

Retrieving details about the submissions of a certain form

The getFormSubmissions operation retrieves details about the submissions of a certain form.

getFormSubmissions
<contactform.getFormSubmissions>
    <sort>{$ctx:sort}</sort>
    <formId>{$ctx:formId}</formId>
    <pageSize>{$ctx:pageSize}</pageSize>
	<pageNumber>{$ctx:pageNumber}</pageNumber>
</contactform.getFormSubmissions>
Properties
  • sort: The sorting order of the results. Consisting of one of the following values: 'ASC' (oldest → newest) or 'DESC' (newest → oldest).
  • formId: The ID of the form from which, submissions need to be retrieved.
  • pageSize: The number of submissions displayed on one page. Default is 25. When stated explicitly, this must be between 25 and 100.
  • pageNumber: Indicates from which page of results (Starting from 0) need to be displayed. Default is 0 .
Sample request

Following is a sample REST/JSON request that can be handled by the getFormSubmissions operation.

getFormSubmissions
{
	"apiOutput":"json",
	"apiUrl":"https://www.123contactform.com",
	"apiKey":"743401-1438926394-tzsh7xqrgu8a9wb34",
	"formId":"1540386",
	"sort":"ASC",
	"pageNumber":"0",
	"pageSize":"26"
}
Related 123ContactForm documentation

http://www.123contactform.com/docs/123contactform-api-retrieve-submissions/

Retrieving details of forms

The listForms operation retrieves details of forms.

listForms
<contactform.listForms>
</contactform.listForms>
Sample request

Following is a sample REST/JSON request that can be handled by the listForms operation.

listForms
{
	"apiOutput":"json",
	"apiUrl":"https://www.123contactform.com",
	"apiKey":"743401-1438926394-tzsh7xqrgu8a9wb34"
}

Related 123ContactForm documentation

http://www.123contactform.com/docs/123contactform-api-retrieve-forms/

Sample configuration

Following is a sample proxy service that illustrates how to connect to 123ContactForm with the init operation and use the getFields operation. The sample request for this proxy can be found in the getFields sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="contactform_getFields" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	 <target>
	 <inSequence>
      <property name="apiOutput" expression="json-eval($.apiOutput)"/>
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="apiKey" expression="json-eval($.apiKey)"/>
      <property name="formId" expression="json-eval($.formId)"/>
      <contactform.init>
         <apiOutput>{$ctx:apiOutput}</apiOutput>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <apiKey>{$ctx:apiKey}</apiKey>
      </contactform.init>
      <contactform.getFields>
         <formId>{$ctx:formId}</formId>
      </contactform.getFields>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>