ngSurvey
  • ✔️ What is ngSurvey ?
  • ❔Help on Help
  • 📁Projects
    • Creating a New Survey
    • Folders
      • Project Trashcan
    • Survey Information
    • Survey Search
    • Collaboration
    • Import / Export
      • JSON Survey Export / Import
      • XLSForm
        • Survey Sheet
          • Types
          • Groups
          • Appearances
          • Relevant
          • Constraint
          • Calculations
          • Multi-Languages
          • Choice filters (Casacade)
        • Choices Sheet
        • Settings Sheet
        • XLSForm Samples
  • 📄Forms / Surveys
    • Overview Dashboard
      • Dashboard Title
      • Dashboard Information Box
      • Dashboard Reports
      • Last Respondents
      • Last Sentiments
    • Form Designer
      • Questions
        • Creating a Question
        • Editing a Question
          • Question Preset Styles
        • Question Properties
          • Conversation reply type
            • Auto reply type
          • Question Branching
          • Skip / Hide Logic
        • Question Types
          • Standard
            • Single Choice
            • Multiple Choice
            • Image Choices
            • Dropdown List
            • Autocomplete
            • Text / Comment Field
          • Matrix Questions
            • Columns / Rows Sums
            • Single Matrix
            • Multi Matrix
            • Mobile Rendering
          • Satisfaction Questions
            • Net Promoter Score® Question
              • Understanding the Net Promoter Score® (NPS)
            • CSAT Score
              • Understating CSAT Score
            • CES Score
              • Understanding CES
            • Star Rating
            • Smileys
            • Thumbs Up / Down
          • Choice-Based Conjoint (CBC)
            • Create a Conjoint Question
            • Design Experiments
              • Balanced Design
              • Manual Design
              • Import Design
            • Reporting / Export
          • Advanced Types
            • Appointment Calendar
            • Constant Sum
            • Answer Ranking
            • Slider Scale
            • File Upload
            • Hidden Question
            • Contact Details
          • Questions Generator
          • Smart Generator
        • Question Blocks
        • Static / Images Content
        • Rating
        • Panel Linking
          • Panel Auto Filling
          • Panel Updating
      • Answers
        • Adding an Answer
        • Editing an Answer
        • Answer Properties
          • Field Properties
          • Reporting / Exports
          • Skip / Hide Logic
          • Entry Validation
        • Answer Types
          • Creating New Type
            • Custom Validation Code
            • Lists
              • JSON / REST API Lists
              • SQL Server Lists
                • Parent / Child Related Lists
                • SQL Parameters
              • List Items
            • Widgets
              • Widget Samples
                • Widget Definitions
                • Basic Field
                • Multiple input type
                • Basic Selection
                • Material Date
                • Material selection
                • Total Score Per Page
          • Selection Answers
            • Checkbox
            • Radio Button
          • Other selection
          • Entry Field
          • Password
          • Captcha
          • Calendar Date
          • Calendar time
          • Compare Field
          • Countries
          • Email
          • Email Validator
          • Hidden Field
          • File Upload
          • Language Selector
          • Phone Confirmation
          • Signature Pad
          • Slider
          • Constant sum
          • Constant sum total
          • Ranking Field
          • Ranking drag / drop
          • Text label
          • Time Picker
          • Appointment Calendar
      • Pages
        • Page Branching
        • Skip / Hide Logic
        • Conditional Redirection
        • Thanks / End Page
          • Redirection URL
          • Conditional Thanks Message
        • Page Looping
          • Looping Pipes
        • Pages Navigator
      • Multi-Language Forms
        • Setup multi-languages
        • Import / Export
        • Auto-translation
        • Resources
      • Survey Properties
        • Progress Completion
          • Respondent Answers Update
        • Single Question Flow
          • Flow Animation Transitions
        • Privacy
          • Privacy checklist
        • Quotas
        • Kiosk
        • Form Code
        • Survey Security
      • Footer Manager
      • Repeatable Sections
      • Rich Text Editor
        • Rich Attributes
      • Piping
        • Text / Data Piping
        • Carry Forward Answers
      • Preview / Testing
        • Pref-filled answers
      • Form Trashcan
      • Scoring
      • Timer
      • Conditions
        • Condition Groups
        • Conditions Rules
          • Question Conditions
          • Javascript Conditions
      • Geolocation
        • Browser Location
        • IP Address Location
        • Location Reporting
      • Google Analytics
        • Google Analytics Events
    • Flow Logic Graph
      • Page Branching Graph
      • Question Branching Graph
    • Security
      • Security Items
        • Active Directory Security
        • Azure Active Directory Security
        • Auth0 Security
        • Captcha
        • CAS Authentication
        • HTTP Function
          • Azure Function Login Sample
        • Invitation Code
        • IP Protection
        • IP Access Control
        • Local Users Security
        • OpenId Connect
        • Panel Security
          • Panelist Mapping
        • Password
        • Quota Restrictions
        • Tokens
          • Token Generator
            • Individual Entry
            • Automatic Generator
            • CSV File
          • Token Manager
          • Token and Querystring
          • Token Hierarchy / Permissions
        • Referer
        • SQL Security
      • Key Provider
      • Data Attributes
    • Style / Branding
      • Style Library
      • Style Editor
        • Style
          • Header / Footer
          • Header Logo Image
        • Theme
        • Elements
        • CSS
          • CSS Classes
          • CSS Rating Sample
        • Mobile / Responsive Design
        • Custom Font
      • Media Gallery
    • Tasks
      • Task Items
        • Completion Alerts
        • Google Sheet Task
        • SQL Query Task
        • Webhooks
          • Webhooks payload transform
      • Triggers
    • Publish
      • Web Link
      • Offline Survey
        • Uploading respondents
      • Embed Form
      • QR Code
      • Word Format Export
      • Website Intercepts
        • How to implement intercepts
        • Intercept Hosts
        • Intercepts
          • Intercept Properties
          • Intercept Layout
          • Intercept Triggers
          • Multi-Language Intercepts
          • Intercept Display Formats
      • Page
    • Campaigns
      • Information Box
      • Campaign
        • Email Distribution
          • Email List
          • Import Emails
        • Panel Members Distribution
        • Mobile Phone Distribution
          • SMS Distribution
          • WhatsApp Distribution
            • WhatsApp Invitations
            • WhatsApp Conversation
          • Phone Number List
          • Import Phones
        • Invitation Message
          • Invitation Piping Tags
          • Embedding a Question
          • WhatsApp Template
        • Reminders
          • One time reminders
        • Schedules
        • Virtual Campaign
        • Campaign Results
      • Campaign Batches
      • Invitation Templates
      • REST Trigger
    • Respondents
      • Respondent Details
      • Editing Respondent Answers
      • Respondents Status
      • Archived Respondents
      • Actions Links
    • Reporting
      • Default Report
      • Report Builder
        • Report Items
          • Bar Chart
          • Pie Chart
          • Free Text Report
          • Sentiment Index
          • Net Promoter Score®
          • Historical Trends Chart
          • Cross Tabulation
          • Tag Clouds
          • T.U.R.F
          • Ranking Report
          • Constant Sum Report
          • Languages Chart
          • Location Chart
      • Text Reports
        • Sentiment Analysis
      • Report Filters
      • Test Data Generator
      • Historical Trends
      • Files Vault
      • Multi-Language Report
      • Reporting Printing
    • Data Exports / Imports
      • Data Exports
        • Export Jobs
        • CSV / Excel
          • Excel
          • CSV Individual Answers
          • CSV Separated Selection / Fields
          • Questions as Rows
        • SPSS / SAV
        • JSON
        • Aggregated Results
        • Word Respondents
        • Export Templates
      • Data Imports
      • Variables
    • Data Access
    • Activity Log
  • 💬Conversational Surveys
    • Get Conversation Started
    • Conversation Questions
      • Answer Reply
      • Text Reply
      • File Upload
      • NPS
      • CSAT
      • CES
      • Language Reply
    • Conversation Commands
    • WhatsApp Conversations
    • Unifonic Template Message
  • 📖Shared Sessions Surveys
    • Sessions
  • ✨AI Suite
    • AI Generated Survey
    • Smart Questions Generator
    • Smart Answers Suggestions
    • Smart Analysis
    • Smart Columns
      • Smart Columns Properties
      • Smart Works
        • Custom Prompt
        • Translation
        • NPS
        • Sentiment
        • Labels
  • 👪Panels
    • Panel Connectors
      • Built-in Connector
        • Import panelist from CSV
      • Database Connector
    • Panel information
    • Panelists
    • Panel Views
    • Panel Attributes
    • Entry Approvals
    • Panelist Surveys
    • Panel Properties
  • 👤Personal Account
    • Account Settings
    • Developer
      • API Connection Sample
        • Get Survey From API
      • Power Apps / Logic App Flow Integration
        • Connector Setup
        • Connector / Mail Example
      • Zapier.com Connection
  • 🔐Access Control
    • Users
    • Groups
    • Roles
      • Rights
  • 🔑Data Encryption
    • Encryption Setup
      • Transparent Encryption
        • Azure Encryption Setup
        • IIS Encryption Setup
      • PGP Encryption
    • Data Classification
      • Internal
      • Sensitive
      • Restricted
    • Respondent Answers Encryption
    • File Upload Encryption
    • Campaign Encryption
  • 🕸️ Tenants
  • 🚀On-Site Setup
    • Enterprise Edition Installation
      • Docker
        • Filesystem Storage
      • Microsoft Azure
      • Amazon Web Services
        • AWS Elastic Beanstalk
          • AWS EBS / STAND ALONE SQL SERVER
          • AWS EBS / SQL Server
        • Cognito
        • LightSail
      • Microsoft IIS
        • Azure KeyVault
        • Update / Upgrade
      • ZIP Archive
      • Linux (Ubuntu / CentOS)
        • Linux SSL
      • Database Backend
        • Microsoft SQL Server
        • Oracle MySQL
        • MariaDB
        • PostgreSQL
      • WhatsApp Messenging
        • Twilio
        • Unifonic
      • Cluster / Scale out setup
      • Microsoft Entra / Azure AD
        • Entra Setup
        • Register Entra Users
      • Active Directory
        • Active Directory Setup
        • Register Active Directory Users
      • Environment Variable Settings
      • Content Security Policy (CSP)
      • Cross Origins Setup (CORS)
    • System Settings
      • General
      • Mailing Server
        • SMTP Mailing Server
        • IIS SMTP / Exchange Server
        • Postmark
        • Twilio / Sendgrid
        • MailJet
      • Account Security
      • Connections vault
      • AI Suite Provider
        • OpenAI
        • Azure AI
      • Third Party APIs
        • Microsoft
        • IPStack
      • Google
        • Captcha Setup
        • Google Web Font
        • Service Account
      • Azure Entra Settings
      • Active Directory Settings
      • OpenId Connect Settings
      • Mobile Messenging
        • Twilio
        • HTTP SMS Messenging
        • Amazon SNS
        • Unifonic
      • Translations
      • File Storage
      • Bounce Account
    • White-Label
    • Register Trial Copy
    • Upgrades
    • Release Notes
    • Change log
  • 📚Walkthroughs
    • Quick create survey start
    • Translate a survey
    • Rename a survey
    • Restore a deleted survey
    • Invite respondents to a survey
    • Capture value from query string
    • Share a survey with other users
    • Using token in email campaigns
    • Using a campaign with MailChimp
    • Power BI Integration
      • Link data to Power BI
      • Reporting with Power BI
    • Tableau Integration
      • Link data to Tableau
        • Reporting with Tableau
    • Link existing SQL table to a survey
    • Send invitations using an existing SQL Table
    • Export data to Excel
    • Export data to R
    • Zendesk integration
  • ©️ Copyrights / EULA
    • License
    • Copyrights and disclaimers
Powered by GitBook

(c) 2024 Data Illusion Zumbrunn. All rights reserved. Reproduction strictly forbidden.

On this page
  • 👨‍💻️ What is a REST trigger ?
  • 📨 Trigger setup
  • 🚀 How to use the REST trigger
  • 🔅 Trigger API properties
  • 🚰 Piping values
  • CURL / Body sample

Was this helpful?

  1. Forms / Surveys
  2. Campaigns

REST Trigger

PreviousInvitation TemplatesNextRespondents

Last updated 4 years ago

Was this helpful?

👨‍💻️ What is a REST trigger ?

The campaign REST trigger API end point enables you to add new recipients to any of your campaigns on the fly using a simple HTTP post to the trigger API.

Using the REST trigger API end point you can easily integrates and automate ngSurvey's campaign system with any third party system that needs to send out survey invitations on the fly. You could for example link ngSurvey to a ticket system that would send out satisfaction survey invitations on the fly upon closure of a ticket

📨 Trigger setup

In order to setup your trigger you need to create a running campaign, once this campaign has been setup you will be able to access the link to the trigger through the REST trigger screen.

You will find there the HTTP trigger link that you can use to queue new recipients in your campaign. The campaign trigger screen allows you also to change the default message that will be used as invitation template for all recipients queued using the trigger.

🚀 How to use the REST trigger

The body of your HTTP post must be defined using following JSON structure

{
  "recipients": string[],
  "anonymous": boolean,
  "clearExistingBatches": boolean,
  "daysThreshold": number,
  "pipeParameters": { string:string },
  "mailingTemplateId": string,
  "message": {
    "mailingFrom": string,
    "mailingFromName": string
    "mailingSubject": string
    "mailingMessage": string
 }
}

🔅 Trigger API properties

  • recipients Is the list of recipients that are added to the campaign batch. Use emails if your campaign is based on emails, phones if its based on SMS and use Panelist Ids if you have a panel based campaign.

  • anonymous will not link the respondent's email to the respondent answers will delete the email from the database once the respondent has taken the survey. This option is only valid if you're using the trigger on an email based campaign.

  • clearExistingBatches will delete from the sending batch any previous record of the recipient Note that it will only remove the sending batch entry it will not remove any survey answers.

  • daysThreshold Optional. Is the number of days after which a recipient can be added to the sending batch again. Leave this to null you recipients can be added to the sending batch all the time. You may also set its value to 0 to add the recipient only if there hasn't been any previous entry in the sending batch.

  • pipeParameters Optional. Allows you to define dynamic name/value parameters that will be replaced in the invitation message.

  • mailingTemplateId Optional. Allows you use an existing mailing template as invitation message.

  • message Optional. Allows you to override the default invitation message of the trigger with your own message. Note that it will also override the mailingTemplateId property.

If you're using piping, mailing templates or a custom message for your trigger please note that ngSurvey will create a new invitation message entry in the database for each recipient. As such we would recommend setting the clearExistingBatches to true if you're running an automation with a high number of calls to the trigger that includes the same recipients over time.

If you're running an automation with a high number of calls to the trigger that includes recurring recipients we would recommend setting the clearExistingBatches property to keep a single batch send entry record for each recipient in the ngSurvey database.

🚰 Piping values

using the optional pipeParameters property you can specify a set of values that will be piped on runtime in the invitation message that will be send to the recipients. Pipe tags in your invitation message must be formated as follow: [*propertyname*]

  "pipeParameters": {
    "prop1": "value1",
    "prop2": "value2",
    "prop3": "value3"
  }

In order to pipe the prop1 value in your invitation message you will need to add following tag that will be replaced with value1 ata runtime.

[*prop1*]

If you're triggering the invitation from a ticketing system you could for example pipe the ticket number in the survey invitation link of your invitation message and store that ticket in a hidden field within the survey.

CURL / Body sample

curl -X POST "http://yoursite/api/Campaigns/yourcampaign/trigger" -H  "accept: */*" -H  "Authorization: Bearer YOURAPIKEY" -H  "Content-Type: application/json-patch+json" -d "{\"recipients\":[\"email1@domain.com\",\"email2@domain.com\"],\"anonymous\":false,\"clearExistingBatches\":false,\"daysThreshold\":null,\"pipeParameters\":{\"prop1\":\"value1\",\"prop2\":\"value2\",\"prop3\":\"value3\"},\"message\":null,\"mailingTemplateId\":null}"
{
  "recipients": ["email1@domain.com", "email2@domain.ch"],
  "anonymous": false,
  "clearExistingBatches": false,
  "daysThreshold": null,
  "pipeParameters": {
    "prop1": "value1",
    "prop2": "value2",
    "prop3": "value3"
  },
  "message": null,
  "mailingTemplateId": null
}

The API endpoint requires an HTTP POST along with an Authorization header with your as value preceded by the Bearer prefix.

📄
API key