LogoLogo
  • Go to Docs Center
  • Welcome to Plum Insight
  • How to...
    • Use Plum's Transcription
  • Account Manager
    • Managing Phone Numbers
    • Managing User Settings
    • Managing Users
    • Managing Metadata
  • Creating A Survey
    • Survey Basics
    • Using Pages
    • Question Types
      • Multiple Choice
      • Multiselect
      • Scale
      • Yes/No
      • Comment
      • Date
      • Time
      • Currency
      • Number
      • Digits
      • Name
      • Address
      • Transfer
      • SOAP
      • Prompt
      • Subdialog
      • Metadata Filter
      • Metadata Store
      • Multilingual
  • Prompt Manager
    • Bulk Uploading for Audio Prompts
  • Survey Settings
    • Phone
    • Web
    • Mobile
  • Metadata Manager
    • Layout
    • Creating a Metadatabase
    • Viewing/Editing a Metadatabase
    • Managing a Metadatabase
    • Formatting Metadatabase CSV
  • Survey Manager
    • Locking Surveys
    • Sharing Surveys
    • Cloning Surveys
    • Clearing Survey Data
    • Deleting Surveys
    • Importing Surveys and Data
  • Deployment
    • Deployment Management
    • Outbound Queue
    • Queueing Calls
  • Reporting
    • Viewing a Report
    • Available Charts
    • Edit Filters
    • Survey Visits
    • Printer Friendly View
    • Single vs Multi-Survey Reports
    • Merging Questions
    • Translating Unix timestamps
  • API
    • Checking Total Responses for a Survey
    • Queuing an Outbound Call
    • Queuing Multiple Outbound Calls
    • Checking Status for an Outbound Call
    • Cancelling All Pending Outbound Calls
    • Adding Metadatabase Records
    • Survey Response Reporting
  • Data Integration
    • Automatic Web Services
    • Plum Insight Webservice Question Type
    • SOAP Integration
    • REST Integration
    • Subdialog Integration
    • Result URL
    • Associating Metadata with a Caller
Powered by GitBook
On this page
  • Total Survey Responses
  • Possible Response Codes
  • Sample Code
  1. API

Checking Total Responses for a Survey

Total Survey Responses

GET https://insight.plumvoice.com/api/surveys/{survey_id}/{instance_id}/responses

Check the total number of responses for an Insight survey.

Path Parameters

Name
Type
Description

survey_id

string

Insight survey ID number

instance_id

string

Instance number for an Insight survey

Headers

Name
Type
Description

content-type

string

application/x-www-form-urlencoded

{'success':true,'total_responses':'25'}
<result>
  <success>true</success>
  <total_responses>25</total_responses>
</result>
{'success':false,'error':'No deployment was found for that survey and instance id combination.'}
<result>
  <success>false</success
  <error>No deployment was found for that survey and instance id combination.</error>
</result>

Possible Response Codes

  • 200: success

  • 401: authentication headers invalid or the account is inactive

  • 404: deployment or survey was not found

  • 405: invalid HTTP method supplied (only GET allowed)

  • 415: unsupported media type (Content-Type value in request)

  • 500: database error

The return structure contains the following item(s):

Name

Data Type

Always Present

Description

success

boolean

yes

Indicates the outcome of the request

error

string

no

If the success value is false this provides a message indicating what error(s) occurred

total_reponses

int

no

The total number of times the survey has been taken. This will be present when the success value is true

Sample Code

This sample PHP code makes a request to a deployed survey that returns the total number of responses:

<?php
$ch = curl_init();
$url = 'https://insight.plumvoice.com/api/surveys/{survey_id}/{instance_id}/responses';
$username = 'you@yourdomain.com';
$password = 'your_developer_key';
curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-Type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);
PreviousAPINextQueuing an Outbound Call

Last updated 5 years ago