Social Webform Javascript API

From Social ID Developers
Jump to: navigation, search

Deprecation notice: this API is deprecated since July 19, 2018.

Contents

Description

Renders the Social Webform widget in a DOM element.

Usage

 SocialId.Campaign.init(options)

Options

elementId required Id of the DOM element where the widget will be rendered.
campaign_id required Webform numeric identifier.
app_id optional (*) Social Login numeric identifier. (*) This option is required for Social Login-integrated Webforms.
mode optional Can be "modal" or "embedded". Specifies how the widget will be rendered: "modal" opens a modal dialog after a click at the element; "embeddeed" renders the widget inside the element. Default: "modal".
closeLinkLabel optional link, shown at the upper right side of the dialog, that when clicked closes the dialog. Default: "Close".
style optional Object that can be used to customize the layout of the elements created by the webform in "modal" (overlay, content, closeLink e iframe) or "embedded" mode (iframe). Refer to the HTML structure for the widget and the JavaScript source code for more details.
view optional A JavaScript function responsible for rendering the widget. The default function is determined by the option "mode", but it is possible to use a custom function. Refer to the JavaScript source code for more details.
doc deprecated A reference to the document that contains the elements to be manipulated. Default: window.document.
url deprecated Url to be loaded inside the iframe created by the Widget.
connection_id deprecated Numeric identifier of an active connection for Social Login-integrated Webforms. This is no longer used, since the connection_id is automatically identified from the current session.

Example

Renders a Social Webform widget in "modal" mode at the element "socialid_webform_login_container":

 SocialId.Campaign.init({
    campaign_id: 153,
    closeLinkLabel: 'Close',
    elementId: 'socialid_webform_container',
    mode: 'modal'
 });

Renders a Social Webform widget integrated with Social Login in "embedded" mode with custom dimensions at the element "socialid_webform_login_container":

 SocialId.Campaign.init({
    campaign_id: 117,
    app_id: 54,
    elementId: 'socialid_webform_login_container',
    mode: 'embedded',
    style: {
       iframe: {
          width: '400px',
          height: '800px'
       }
    }
 });

See webform examples at: https://sid-examples.herokuapp.com/campaigns/

Javascript Source

The source code for this API is available at the following URLs:

  https://app.socialidnow.com/assets/marketing/registration_widget.js
  https://app.socialidnow.com/javascripts/marketing/registration_widget.js
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox