Poll

get

Submits an answer to a survey question in an e-mail.

Path parameters
survey_idstringRequired

The survey's unique ID.

Query parameters
identifierstringRequired

The account's unique ID.

Example: PI-1234567890
callbackstringOptional

Conditionally required. If device_type != 'native_mobile' OR 'email'. Response will be wrapped in callback code. For example, passing "console.debug" will result in "console.debug('{}')".

Example: console.debug
device_udidstringOptional

The device's unique ID.

Example: 00000000-0000-4000-f000-000000000001
device_typestring · enumRequired

The type of device that's requesting the survey/poll. Use 'desktop' if unsure.

Possible values:
urlstringOptional

The URL where the event occurred. Conditionally required. Required if device_type = native_mobile.

question_idnumberRequired

The question's unique ID.

custom_datastringOptional
preview_modestringOptional

If 'true' then nothing will be recorded in the database.

Example: true
visit_countnumberOptional

The number of times the user has visited the site. Used to target surveys.

pageview_countnumberOptional

The number of times the user has visited the page. Used to target surveys.

Responses
200
Successful response.
application/javascript
get
GET /surveys/{survey_id}/poll HTTP/1.1
Host: survey.pulseinsights.com
Accept: */*
{
  "survey": {
    "id": 1,
    "name": "Fall Customer Engagement Survey",
    "survey_type": 0,
    "invitation": "Would you like to take a survey?",
    "top_position": "10px. 25%",
    "bottom_position": "10px. 25%",
    "left_position": "10px. 25%",
    "right_position": "10px. 25%",
    "width": 300,
    "background_color": "#ff00aa",
    "text_color": "#ff00aa",
    "inline_target_selector": "#survey_container",
    "thank_you": "Would you like to take a survey?",
    "answer_text_color": "#ff00aa",
    "mobile_inline_target_selector": "#mobile_survey_container",
    "sdk_inline_target_selector": "#sdk_survey_container",
    "display_all_questions": "t",
    "fullscreen_margin": 42,
    "invitation_button": "Click here to get started",
    "invitation_button_disabled": "f",
    "single_page": true,
    "ignore_frequency_cap": true,
    "randomize_question_order": "t",
    "all_at_once_empty_error_enabled": "t",
    "all_at_once_submit_label": "Submit",
    "all_at_once_error_text": "Please fill answers",
    "survey_locale_group_id": 1,
    "personal_data_masking_enabled": "t",
    "phone_number_masked": "t",
    "email_masked": "t",
    "background": "https://cdn.pulseinsights.com/background/survey/:survey_id/:background_image_url",
    "pulse_insights_branding": true,
    "custom_data_snippet": "text",
    "onclose_callback_code": "text",
    "oncomplete_callback_code": "text",
    "onanswer_callback_code": "text",
    "onview_callback_code": "text",
    "onclick_callback_code": "text",
    "intersection_observer_enabled": "t",
    "inline_target_position": 0,
    "theme_css": "text"
  },
  "question": {
    "id": 1,
    "question_type": 0,
    "content": "text",
    "question_locale_group_id": 1
  },
  "results": {
    "poll": [
      {
        "id": 1,
        "content": "text",
        "count": 1
      }
    ],
    "content": "text",
    "question_type": 0,
    "answers_via_checkbox": [
      [
        "12",
        "42"
      ]
    ]
  }
}

Last updated

Was this helpful?