Please ensure Javascript is enabled for purposes of website accessibility
Add a Survey via API
  • 18 Dec 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Add a Survey via API

  • Dark
    Light
  • PDF

Article Summary

Mindful Feedback provides an API to use for many functions, including adding new survey interactions. In the API, the Add New Interaction resource can be used to create a new survey interaction.

NOTES
  • Complete API documentation can be found at https://apidocs.surveydynamix.com. We recommend exploring the required authentication methods outlined in the early sections of the API document before proceeding.
  • Interactions cannot be added if a pending interaction with the same phone number and survey ID exists, unless the _force_new parameter is set to true. If you attempt to add an interaction like this, a 409(Conflict) response will be returned.

Add New Interaction

URI: /interactions

Method: POST

Parameters:

Name

Description

Allowed Values

Default

survey_id

  • The ID of the survey you wish to use for the interaction 
  • Found on the top right of the relevant survey page

integer

No default; Parameter required

_force_new

Force a new interaction to be added even if a pending interaction with the same phone number and survey ID exists.

boolean

FALSE

phone_number

  • The phone number to be used for the survey 
  • Required for voice and sms interactions

A 12-character string in the proper phone-number format

empty

phone_connection_id

  • The ID of the phone connection you wish the interaction to use
  • Valid for voice/sms interactions

integer

empty

email

  • The email address of the survey respondent
  • Required for email interactions

An email address

empty

survey_type

The survey medium to use

inbound, outbound, sms, web, email, websms

web

scheduled_at

The time at which an outbound voice, sms, or email survey is scheduled to be sent, or the time after which an inbound survey is allowed to start.

  • dateTime string
  • Accepts times in standard UTC format and in the format Now + X Days/Hours/Minutes

now

external_ref

A standard string field for referencing external system IDs

string

empty

call_type

A standard string field for report aggregation

string

empty

agent_id

  • A string corresponding to an agent ID
  • Will allow an agent user with this ID to see the interaction in the dashboard, and will be used to aggregate agent rankings

string

empty

respondent_language

  • The language of the survey respondent
  • This is used to select survey prompts in multi-language surveys and to determine what language and dialect to use when automatically transcribing voice responses.

see Supported Languages

determined by region

_shorten_urls

Generate a short URL for the Start Survey link and the Unsubscribe link.

boolean

FALSE

Custom Metadata

Parameters not otherwise listed in this table will be added as interaction data resources associated with the created interaction.

The key must only include alphanumeric characters and underscores and must start with a letter. The value may be any string.

none

EXAMPLE

The following curl request will create an email interaction scheduled five minutes from now, for respondent@example.com, using the survey with ID 52:

curl -X POST   "https://surveydynamix.com/api/interactions" \

        -d "survey_id=52" \

	-d "survey_type=email" \

	-d "email=respondent@example.com" \

	-d "scheduled_at=Now + 5 minutes" \

	-u Customer_UUID:Auth_Token

Example Request and Response

The following series of screenshots shows an example of creating a Web SMS survey via the Add New Interaction API resource.

Screen capture of Add New Interaction APIUsing Basic Authorization (credentials found at Customer Settings > Customer Credentials)
Screen capture of Add New Interaction APIOne header added: content-type = application/json
Screen capture of Add New Interaction APIRequest and response parameters

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.