### Install Default Pixel Script Source: https://docs.default.com/articles/7592911148-default-pixel Copy this script and paste it within the `` tag of all relevant pages on your domain. Ensure it is placed before any form fields. ```html ``` -------------------------------- ### Example AI Prompt for Formatted Output Source: https://docs.default.com/articles/4061425067-ai-prompt This prompt demonstrates how to instruct an AI to output a specific string format, including handling null or empty inputs. It's crucial for ensuring consistent data for downstream processes. ```text You will receive a company name in the format {{company name}}. Your task is to output ONLY the following string with the company name inserted: "[COMPANY NAME] Welcome to Default!" Rules: - Replace [COMPANY NAME] with the exact company name provided - Output ONLY this string, nothing else - No explanations, no additional text - If the company name is empty, undefined, null, or contains only whitespace, output exactly: null - Do not use quotes around the final output Example: Input: {{company name}} = "Acme Corp" Output: Acme Corp Welcome to Default! Input: {{company name}} = "" Output: null Now process: {{company name}} ``` -------------------------------- ### Example Submission Object Source: https://docs.default.com/articles/3276343596-forms-sdk Construct the submission object with form details, responses, and question metadata. Ensure question objects include id, name, and type. ```javascript const submission = { form_id: FORM_ID, team_id: TEAM_ID, responses: { email: "test@test.com", industry: "automotive", }, questions: [ { id: "email", name: "Email", type: "email", options: [], }, { id: "industry", name: "Industry", type: "input", options: ["automotive", "computers", "software"], }, ], }; ``` -------------------------------- ### Example Calendar Event Description Template Source: https://docs.default.com/articles/7859961892-dynamic-fields-for-calendar-event-descriptions This template demonstrates how to use various dynamic fields within a calendar event description. It shows a mix of meeting details, guest information, host information, and form responses. ```plaintext Hi {{ guest first name }}, Looking forward to our {{ meeting title }}. Here's everything you need: Join link: {{ meeting link }} Host: {{ host full name }} ({{ host email }}) Team: {{ team name }} What you shared with us: {{ all form responses }} ``` -------------------------------- ### Add Sessions.js Pixel to Website Source: https://docs.default.com/articles/9550604252-company-deanonymization Install this JavaScript snippet in the `` of your website to enable company deanonymization. Replace 'DEFAULT_SESSIONS_KEY_GOES_HERE' with your actual Sessions API key. ```html ``` -------------------------------- ### Prefill Form Inputs with URL Parameters Source: https://docs.default.com/articles/2027933120-embed-default-forms Embed a Default form and prefill specific input fields by appending query parameters to the iframe's src URL. This example shows prefilling the 'email' input. ```html ``` -------------------------------- ### helloWorld() Source: https://docs.default.com/articles/3276343596-forms-sdk Logs a welcome message to verify that the SDK is loaded correctly. ```APIDOC ## helloWorld() Logs a welcome message to verify that the SDK is loaded correctly. ### Method ```javascript sdk.helloWorld(); ``` ### Response ``` // Logs: "Hello World! Welcome to Default.com" ``` ``` -------------------------------- ### Send a test payload using curl Source: https://docs.default.com/articles/9873660463-how-to-set-up-the-webhook-received-trigger Use `curl` to send a POST request with a JSON payload to the test webhook URL. This captures the data structure for downstream use. The `?mode=test` parameter is for setup only and does not start a workflow run. ```bash curl -X POST "https://nucleus.default.com/webhooks/434266?mode=test" \ -H "Content-Type: application/json" \ -d '{ "event": "demo_completed", "lead": { "first_name": "Jane", "last_name": "Doe", "email": "jane.doe@example.com", "company": "Acme Inc" }, "score": 92, "source": "navattic" }' ``` -------------------------------- ### Full Page iframe Setup for Default Forms Source: https://docs.default.com/articles/2027933120-embed-default-forms This setup uses CSS to make the embedded Default form occupy the entire browser window. Ensure 'forms.default.com/FORM_ID' is replaced with your form's embed code. ```html
``` -------------------------------- ### Verify SDK Load with helloWorld() Source: https://docs.default.com/articles/3276343596-forms-sdk Call the helloWorld method to confirm the SDK is loaded and accessible. This logs a welcome message to the console. ```javascript sdk.helloWorld(); // Logs: "Hello World! Welcome to Default.com" ``` -------------------------------- ### Basic Integration Script for Gravity Forms and DefaultSDK Source: https://docs.default.com/articles/1128514199-connecting-gravity-forms-with-defaultsdk This script loads the Default SDK and handles the integration with Gravity Forms. It captures form data, builds a submission payload, and sends it to Default after Gravity Forms confirms submission. Ensure to replace placeholder IDs with your actual form and team IDs. ```html ``` -------------------------------- ### Fetch All Slack Channels with Pagination Source: https://docs.default.com/articles/2982274480-bulk-sync-slack-channel-ids-to-sfdc Use this Python script to fetch all Slack channels, including public and private ones, using cursor-based pagination. It requires the SLACK_BOT_TOKEN environment variable to be set and outputs channel IDs and names to a CSV file. ```python #!/usr/bin/env python3 """ Fetch all Slack channels using cursor-based pagination. Requires SLACK_BOT_TOKEN environment variable to be set. """ import os import requests import csv from time import sleep SLACK_TOKEN = os.environ.get('SLACK_BOT_TOKEN') def fetch_all_channels(): url = "https://slack.com/api/conversations.list" headers = {"Authorization": f"Bearer {SLACK_TOKEN}"} all_channels = [] cursor = None while True: params = { "types": "public_channel,private_channel", "limit": 1000, "exclude_archived": "true" } if cursor: params["cursor"] = cursor response = requests.get(url, headers=headers, params=params) data = response.json() channels = data.get("channels", []) all_channels.extend(channels) next_cursor = data.get("response_metadata", {}).get("next_cursor", "") if not next_cursor: break cursor = next_cursor sleep(0.5) return all_channels # Save to CSV channels = fetch_all_channels() with open("all_slack_channels.csv", "w", newline="") as f: writer = csv.writer(f) writer.writerow(["Channel ID", "Channel Name"]) for ch in channels: writer.writerow([ch["id"], ch["name"]]) ``` -------------------------------- ### Submit Form Response with Forms SDK Source: https://docs.default.com/articles/3276343596-forms-sdk Load the Forms SDK script and then use `window.DefaultSDK.submit` to send form data. Ensure the SDK script is loaded before attempting to use the SDK. The `submission` object contains form details and responses, while `callbacks` handle different stages of the submission process. ```javascript const script = document.createElement('script'); script.src = "https://import-cdn.default.com/sdk.js"; script.async = true; script.onload = function() { console.log("SDK script loaded, attempting to use DefaultSDK..."); const submission = { form_id: 867190, team_id: 7, responses: { email: "luke@tatooine.galaxy", rebel_name: "Luke Skywalker", home_planet: "Tatooine", spacecraft_type: "X-wing", additional_spacecraft_type: ["B-wing", "Y-wing"], combat_experience: "Yes", force_sensitive: "Yes", preferred_division: "starfighter_corps", mission_availability: "immediate", droid_companion: "R2-D2", imperial_history: "No" }, questions: [ { id: "email", name: "Contact Email", type: "email", options: [] }, { id: "rebel_name", name: "Full Name", type: "input", options: [] }, { id: "home_planet", name: "Home Planet", type: "input", options: [] }, { id: "spacecraft_type", name: "Primary Spacecraft", type: "select", options: ["X-wing", "Y-wing", "A-wing", "B-wing", "Other"] }, { id: "additional_spacecraft_types", name: "Additional Spacecrafts", type: "select-multiple", options: ["X-wing", "Y-wing", "A-wing", "B-wing", "Other"] }, { id: "combat_experience", name: "Do you have combat experience?", type: "select", options: ["Yes", "No"] }, { id: "force_sensitive", name: "Are you Force-sensitive?", type: "select", options: ["Yes", "No"] }, { id: "preferred_division", name: "Preferred Division", type: "select", options: ["starfighter_corps", "ground_forces", "intelligence", "support_services"] }, { id: "mission_availability", name: "When can you start missions?", type: "select", options: ["immediate", "within_week", "within_month", "need_training"] }, { id: "droid_companion", name: "Droid Companion (if any)", type: "input", options: [] }, { id: "imperial_history", name: "Have you ever served the Empire?", type: "select", options: ["Yes", "No"] } ] }; const callbacks = { onSuccess: (data) => console.log("Welcome to the Rebellion!", data), onError: (error) => console.error("Submission failed:", error.message), onSchedulerDisplayed: (data) => console.log("Scheduler displayed:", data), onSchedulerClosed: (data) => console.log("Scheduler closed:", data), onMeetingBooked: (data) => console.log("Meeting booked:", data.payload) }; try { console.log("Attempting submission with DefaultSDK..."); // Using the DefaultSDK that we found in the window properties window.DefaultSDK.submit(submission, callbacks); } catch (e) { console.error("Error during submission:", e); console.log("DefaultSDK object:", window.DefaultSDK); } }; script.onerror = function() { console.error("Failed to load the Forms SDK"); }; document.head.appendChild(script);​ ``` -------------------------------- ### Run Python Script to Fetch Channels Source: https://docs.default.com/articles/2982274480-bulk-sync-slack-channel-ids-to-sfdc Execute the Python script to export all Slack channel IDs and names to a CSV file named 'all_slack_channels.csv'. ```bash python3 fetch_all_slack_channels.py ``` -------------------------------- ### Test Workflow with Single Channel (Python) Source: https://docs.default.com/articles/2982274480-bulk-sync-slack-channel-ids-to-sfdc Use this Python script to test the workflow with a single Slack channel before bulk sending. It sends a POST request to the webhook URL with test data and prints the response status code. ```python import requests WEBHOOK_URL = "https://nucleus.default.com/webhooks/YOUR_ID?mode=test" payload = { "channel_id": "C06769H3H0E", "channel_name": "default-customername", "channel_type": "external" } response = requests.post(WEBHOOK_URL, json=payload) print(response.status_code) ``` -------------------------------- ### Email Reputation API Sample Output Source: https://docs.default.com/articles/7617197999-abstract-api This JSON output provides a comprehensive analysis of an email address's deliverability, quality, sender information, domain details, and risk assessment. It helps in identifying potential spam or invalid leads. ```json { "email_address": "sidd@default.com", "email_deliverability": { "status": "deliverable", "status_detail": "valid_email", "is_format_valid": true, "is_smtp_valid": true, "is_mx_valid": true, "mx_records": [ "alt2.aspmx.l.google.com", "aspmx.l.google.com", "alt3.aspmx.l.google.com", "alt4.aspmx.l.google.com", "alt1.aspmx.l.google.com" ] }, "email_quality": { "score": "0.99", "is_free_email": false, "is_username_suspicious": false, "is_disposable": false, "is_catchall": null, "is_subaddress": false, "is_role": false, "is_dmarc_enforced": true, "is_spf_strict": true, "minimum_age": null }, "email_sender": { "first_name": "Sidd", "last_name": null, "email_provider_name": "Google", "organization_name": "Revamp Your GTM — Default", "organization_type": "commercial" }, "email_domain": { "domain": "default.com", "domain_age": 9932, "is_live_site": true, "registrar": "GoDaddy.com, LLC", "registrar_url": "https://godaddy.com", "date_registered": "1998-05-06", "date_last_renewed": "2024-04-29", "date_expires": "2025-05-05", "is_risky_tld": false }, "email_risk": { "address_risk_status": "low", "domain_risk_status": "low" }, "email_breaches": { "total_breaches": 0, "date_first_breached": null, "date_last_breached": null, "breached_domains": [] } } ``` -------------------------------- ### Sample Valid Email Output Source: https://docs.default.com/articles/7024172858-email-validation This is a sample JSON output when an email address is successfully validated. The 'emailData' key is present and contains details about the validated email. ```json { "status": "valid", "emailData": { "email": "someone@default.com", "certainty": "ultra_sure", "mxRecords": ["google.com"], "mxProvider": "google" } } ``` -------------------------------- ### Include Forms SDK Web Script Source: https://docs.default.com/articles/3276343596-forms-sdk Add this script to your webpage to load the Forms SDK. Set async to true for non-blocking loading. ```javascript const script = document.createElement('script'); script.src = "https://import-cdn.default.com/sdk.js"; script.async = true; // Optional: Load asynchronously document.head.appendChild(script); ``` -------------------------------- ### Sample Failure Output Source: https://docs.default.com/articles/7024172858-email-validation This is a sample JSON output when the email validation request fails. It includes a 'status' of 'failed' and an 'error' message. ```json { "status": "failed", "error": "Invalid response structure" } ``` -------------------------------- ### Autofill Booking Form with URL Parameters Source: https://docs.default.com/articles/2226942246-booking-links Embed a scheduler in an iframe and dynamically pass URL parameters to autofill booking form questions. This script extracts parameters from the browser's URL and appends them to the iframe's source. ```html ``` -------------------------------- ### submit() Source: https://docs.default.com/articles/3276343596-forms-sdk Sends form responses to Default and manages your event callbacks based on workflow steps. ```APIDOC ## submit() Sends form responses to Default and manages your event callbacks based on workflow steps. ### Method Signature ```javascript sdk.submit( submission: { form_id: number; team_id: number; responses: Record; questions: Array<{ id: string; name: string; type: string; options?: Array; }>; }, callbacks?: { onSuccess?: (data) => void; onError?: (error: Error) => void; onSchedulerDisplayed?: (data) => void; onSchedulerClosed?: (data: { redirectUrl?: string }) => void; onMeetingBooked?: (data: { payload }) => void; } ): Promise; ``` ### Parameters #### submission (object, required) Required object containing form data and metadata: * `form_id` (number, required): Unique form identifier * `team_id` (number, required): Team identifier * `responses` (object, required): Question ID to response mapping * `questions` (array, required): Question metadata array ##### Question Attributes (within `questions` array) For each object in the `questions` array, the following key value pairs are required: * `id` (required): The unique identifier for the question. * `name` (required): The human-readable name of the question. * `type` (required): The type of question input: * `email` : The lead's email address. * `input` : Short Text input fields. * `textarea` : Long Text input fields. * `select` or `radio` : Single Select input where leads can only select one option. * `checkbox` : Whether a checkbox was selected or not. * `select-multiple` : Multi Select input where leads can select multiple options. * `tel` : Phone number. * `options` (optional): For multiple-choice questions, an array of valid options. * `lead_attribute` (optional): The lead attribute in Default you want to map the input field to: * `first_name` : The lead's first name. * `last_name` : The lead's last name. * `phone` : The lead's phone number. * `role` : The lead's role at their company. * `title` : The lead's job title. * `city` : The city that the lead is located in. * `location` : The address of the lead. * `company` : The company's name. * `industry_group` : The company's industry. * `head_count` : The company's headcount. #### callbacks (object, optional) The following event handlers are available through the lifecycle of a form submission: * `onSuccess`?: (data) => void; * `onError`?: (error: Error) => void; * `onSchedulerDisplayed`?: (data) => void; * `onSchedulerClosed`?: (data: { redirectUrl?: string }) => void; * `onMeetingBooked`?: (data: { payload }) => void; * `onRedirect`?: (data: { redirectUrl?: string }) => void; ### Request Example ```javascript const submission = { form_id: FORM_ID, team_id: TEAM_ID, responses: { email: "test@test.com", industry: "automotive", }, questions: [ { id: "email", name: "Email", type: "email", options: [], }, { id: "industry", name: "Industry", type: "input", options: ["automotive", "computers", "software"], }, ], }; const callbacks = { onSuccess: (data) => { console.log("Submission successful!", data); }, onError: (error) => { console.error("Submission failed:", error.message); }, onSchedulerDisplayed: (data) => { console.log("Scheduler displayed:", data); }, onSchedulerClosed: (data) => { console.log("Scheduler closed, optional redirect: " + data.redirect); }, onMeetingBooked: (data) => { console.log("Meeting booked successfully!", data.payload); }, onRedirect: (data) => { console.info("Redirect URL received:", data.redirectUrl); window.open(data.redirectUrl, "_blank"); } }; sdk.submit(submission, callbacks); ``` ### Response This method returns a `Promise`. ``` -------------------------------- ### AI Prompt: Parse Account Name from Slack Channel Source: https://docs.default.com/articles/2982274480-bulk-sync-slack-channel-ids-to-sfdc Use this AI prompt to extract and format account names from Slack channel names, applying specific rules for prefixes, suffixes, and casing. Ensure the output is only the account name. ```text You are a data parser. Given a Slack channel name, extract and return ONLY the company/account name in proper title case formatting. Rules: 1. Remove these prefixes if present: "default-", "internal-customer-" 2. Replace dashes (-) and underscores (_) with spaces 3. Remove common suffixes like "_app", "_ai", "_io", "_com" 4. Convert to proper company name casing (e.g., "customername" → "CustomerName", "customer-name" → "Customer Name") 5. Known acronyms should be uppercase: AI, IO, HQ, CRM, API, PDL, RFP 6. Return ONLY the account name, nothing else - no quotes, no explanation Examples: - "default-customername" → CustomerName - "internal-customer-customer-name" → Customer Name - "default-customer-name-ai" → Customer Name AI - "internal-customer-customer-name_app" → Customer Name Channel name: {{ channel_name }} ``` -------------------------------- ### Style the Content Container Source: https://docs.default.com/articles/7330970182-styling-the-loading-modal Configure the main content area's display properties, ensuring it takes full width and height. This container manages content layout. ```css .dftDefaultLoadingModal__content__container { display: flex; width: 100%; height: 100%; flex-direction: column; justify-content: space-between; align-items: center; } ``` -------------------------------- ### Include the Forms SDK Web Script Source: https://docs.default.com/articles/3276343596-forms-sdk This snippet shows how to add the Forms SDK script to your webpage and access the SDK object. ```APIDOC ## Include the Forms SDK Web Script Add the SDK to your webpage: ```javascript const script = document.createElement('script'); script.src = "https://import-cdn.default.com/sdk.js"; script.async = true; // Optional: Load asynchronously document.head.appendChild(script); ``` Access the SDK: ```javascript const sdk = window.DefaultSDK; ``` ``` -------------------------------- ### Parallel Slack Channel Sync Source: https://docs.default.com/articles/2982274480-bulk-sync-slack-channel-ids-to-sfdc Use this snippet to send data to webhooks in parallel for improved performance. It processes channels concurrently and provides progress updates. ```python from concurrent.futures import ThreadPoolExecutor, as_completed MAX_WORKERS = 10 # Assume send_to_webhook and channels are defined elsewhere # send_to_webhook(ch) # channels = [...] with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor: futures = [executor.submit(send_to_webhook, ch) for ch in channels] for i, future in enumerate(as_completed(futures), 1): if i % 50 == 0: print(f"Progress: {i}/{len(channels)}") print("Done!") ``` -------------------------------- ### Geolocation API Sample Output Source: https://docs.default.com/articles/7617197999-abstract-api This JSON output details the information returned by the Geolocation API for a given IP address. It includes details about the location, security, timezone, and connection. ```json { "ip_address": "71.231.248.166", "city": "Seattle", "city_geoname_id": 5809844, "region": "Washington", "region_iso_code": "WA", "region_geoname_id": 5815135, "postal_code": "98109", "country": "United States", "country_code": "US", "country_geoname_id": 6252001, "country_is_eu": false, "continent": "North America", "continent_code": "NA", "continent_geoname_id": 6255149, "longitude": -122.3451, "latitude": 47.6348, "security": { "is_vpn": false }, "timezone": { "name": "America/Los_Angeles", "abbreviation": "PDT", "gmt_offset": -7, "current_time": "11:41:29", "is_dst": true }, "flag": { "emoji": "🇺🇸", "unicode": "U+1F1FA U+1F1F8", "png": "https://static.abstractapi.com/country-flags/US_flag.png", "svg": "https://static.abstractapi.com/country-flags/US_flag.svg" }, "currency": { "currency_name": "USD", "currency_code": "USD" }, "connection": { "autonomous_system_number": 7922, "autonomous_system_organization": "COMCAST-7922", "connection_type": null, "isp_name": null, "organization_name": null } } ``` -------------------------------- ### Style the Loading Spinner and Animation Source: https://docs.default.com/articles/7330970182-styling-the-loading-modal Define the spinner's appearance, including its borders, dimensions, and border-radius. Includes the CSS keyframes for the spinning animation. ```css .dftDefaultLoadingModal__spinner { border-left: 2px solid transparent; border-bottom: 2px solid transparent; border-top: 2px solid rgba(0,0,0,.8); border-right: 2px solid rgba(0,0,0,.8); border-radius: 99999px; width: 20px; height: 20px; animation: spin 0.45s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } ```