Form2Channel Docs

Contents


Getting started

  1. Create your html form with the class form2channel
    <form class="form2channel">
  2. Add a submit button
    <button type="submit">Submit</button>
  3. Add a link to our JS file on the form page
    <script src="//form2channel.com/js/form2channel.js"></script>
  4. Upload the page to your server

Hit F12 to see the result of the submission in the developer console.

Copy an example form


Javascript Submit

If you want to validate the form or give users feedback on the status of their submission, you can submit the form using Javascript.

You need to call a function called form2channel like so

        //You can pass any form into this function
        form2channel(form)
        .then(data => {
            //The service returns a Json object that consists of:
            //A message: data.Message
            //A success boolean: data.Success
            console.log(data.Message);
        });

Example form. We use this method on our contact us page


Slack setup

To create a Slack webhook

  1. Go to https://api.slack.com/apps
  2. Add an app to a workspace
  3. Activate "Incoming Webhooks"
  4. Select "Add new webhook to workspace" (bottom)
  5. Add a hidden input tag to your form. The name must be formto_slack and the value your Webhook URL
Slack Docs: https://api.slack.com/start/overview#creating

Example form


Telegram Setup

To get a Telegram ChatID

  1. Open this page on your phone and click the link
  2. Send /start to @Form2ChannelBot to get a ChatID
  3. Add a hidden input tag to your form. The name must be formto_telegram and the value your Chat ID

Example form


Http Info

Provide an http address that accepts a Json array of objects (key/value pairs). Example Json:
    [
        {"key":"formto_email","value":"me@email.address"},
        {"key":"FirstName","value":"John"},
        {"key":"LastName","value":"Lennon"},
        {"key":"Country","value":"United Kingdom"},
        {"key":"Subscribed","value":"checked"},
        {"key":"Gender","value":"Male"}
    ]

Post data directly to our REST API

You can skip the form altogether and submit your data directly to our API as a Json object

  1. Call our FormTo API
    • URI: https://showcase.api.linx.twenty57.net/Form2Channel?PageUrl=[your unique page identifyer]
    • Method: POST
    • Content Type: application/json
    • Body: Array of key / value pairs as shown below
    •     [
                      {"key":"formto_email","value":"me@email.address"},
                      {"key":"FirstName","value":"John"},
                      {"key":"LastName","value":"Lennon"},
                      {"key":"Country","value":"United Kingdom"},
                      {"key":"Subscribed","value":"checked"},
                      {"key":"Gender","value":"Male"}
          ]