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
  • Add Metadatabase Record(s)
  • Possible Response Codes
  • Sample Code
  1. API

Adding Metadatabase Records

Add Metadatabase Record(s)

POST https://insight.plumvoice.com/api/metadatabase_push

Add metadatabase records to a Plum Insight survey.

Headers

Name
Type
Description

content-type

string

application/x-www-form-urlencoded

Request Body

Name
Type
Description

metadatabase

string

The name of the metadatabase. This is case-insensitive.

record

string

json encoded associative array of the column names and column values to be added. Example: {'column1': 'value1', 'column2': 'value2'} This need not include all columns, you can leave out columns in your metadatabase you do not wish to populate.

{'success':true}
<result>
  <success>true</success>
</result>
{'success':false,'error':'No metadatabase by that name exists.'}
<result>
  <success>false</success
  <error>No metadatabase by that name exists.</error>
</result>

Possible Response Codes

  • 200: success

  • 400: invalid data supplied

  • 401: authentication headers invalid or the account is inactive

  • 404: metadatabase was not found

  • 405: invalid HTTP method supplied (only POST 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

Sample Code

This sample PHP code makes a request to push a new record into the 'test' metadatabase and sets values for columns column1 and column2:

<?php

$params = array(
	'metadatabase' => 'test',
	'record' => json_encode(array('column1' => 'value1', 'column2' => 'value2')),
	);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://insight.plumvoice.com/api/metadatabase_push");
curl_setopt($ch, CURLOPT_USERPWD, 'your_login:your_dev_pin'); // http basic auth credentials
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Accept: application/json'));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($http_code, $result);
PreviousCancelling All Pending Outbound CallsNextSurvey Response Reporting

Last updated 5 years ago