MPZ API > Add a Form

Use the API to create a new signup form, and retrieve the new form id and javascript.

Request

Submit an XML Request with the following details:
Post URL: https://mpzmail.com/api/v3.0/forms/addForm/
Fields to Post
apiKey String REQUIRED The APIKey of the requesting user.
formName String REQUIRED The friendly name of the new form.
formType Int REQUIRED The type of form to add.
  • 0 = Hosted form. You will receive a URL of the new form hosted on our servers
  • 1 = Embedded Form. You will receive javascript which you can use to embed the form on your own site
  • 2 = Popup Form. You will receive javascript which you can use to embed the popup form on your own site
doubleOptIn Int REQUIRED
  • 0 = Double opt in disabled
  • 1 = Double opt in enabled
groupID Int REQUIRED The id of the group you want new subscribers to be added to.
landingPageType Int REQUIRED What happens when a subscriber completes the form.
  • 0 = Redirect to an MPZMail hosted landing page
  • 1 = Redirect to another URL
  • 2 = Do not redirect. Show the "Thank you message" in place of the form
landingPageURL String OPTIONAL If you have selected option 1 for landingPageType above, you must submit a landingPageURL here.
thankYouMessage String OPTIONAL If you have selected option 2 for landingPageType above, you must submit a "Thank you" message which will be shown on form completion.

Response

Data Sent Back
error Int Indicated wether an error has occured. 0 for no error. 1 for error.
status String If there's been an error, a text description of the error that occured will be here.
formID Int The ID of the new form.
confirmationTemplateID Int The ID of the new confirmation email template which is emailed out when a new user subscribers. This is is a standard Newsletter Template which you can retrieve here.
confirmationPageID Int The ID of the new confirmation landing page template which users can be directed to when a new user subscribers. This is is a standard Newsletter Template which you can retrieve here.
doubleOptInConfirmationPageID Int The ID of the new double opt in confirmation landing page template which users can be directed to when a new user subscribers. This is is a standard Newsletter Template which you can retrieve here. Only available if double opt in is specified in request.

Sample request XML

<xml>
     <apiKey>44-121312131223</apiKey>
     <formName>Sample Form</formName>
     <formType>1</formType>
     <doubleOptIn>1</doubleOptIn>
     <groupID>124124</groupID>
     <landingPageType>1</landingPageType>
     <landingPageURL>http://mysite.com/thanksforjoining</landingPageURL>
     <thankYouMessage>Thanks for signing up</thankYouMessage>
</xml>

Sample response XML

<xml>
     <error>0</error>
     <status></status>
     <formID>21411</formID>
     <confirmationTemplateID>5125125</confirmationTemplateID>
     <confirmationPageID>616125</confirmationPageID>
     <doubleOptInConfirmationPageID>12415</doubleOptInConfirmationPageID>
</xml>

Comments