Delete Content (SOAP)

Overview

The DeleteProgram SOAP method allows you to programmatically delete content from your TelVue Princeton™ server.

You need to have installed:

  • A Programming Language (C#, Java, PHP, Ruby, etc.)
  • A SOAP library
  • A WSDL library

Request URL

http://myserver:3000/program_service/wsdl

Substitute the hostname, domain, or IP Address of your server instead of myserver.

Parameters

Parameter Type Required Max Length Description
id String Y 8 ID is the content’s internal ID, for instance as discovered from the REST Web Service located at: /all_content_metadata, in the field “id”.
api_key String Y 20 The api_key of a valid username in the system.

The ID parameter can also be determined by looking at URL paths in the web application. For example, the following URL from the content details page shows a Program ID of 4:

http://myserver:3000/content/show/4?more=HWTTTT

Examples

Ruby

Copy the Ruby script below to your system, with the following substitutions.

  • The IP address of your server instead of 192.168.1.150
  • The Content ID of the file you actually want to delete instead of 13.
  • A valid api_key on your server instead of api_key
###########################
# Example Ruby script to call the TelVue Corporation Delete SOAP Web Service
###########################
require 'soap/wsdlDriver'
begin
  service=SOAP::WSDLDriverFactory.new(
    'http://192.168.1.150:3000/program_service/wsdl'
  ).create_rpc_driver
  # Delete a content file with an ID of 13.
  response = service.DeleteProgram("13", api_key)
  puts response
  rescue Exception => e
    puts e.class
    puts e.message
    puts e.backtrace
  end
end

PHP

This example assumes you have the PHP-Soap library installed. The syntax for other SOAP libraries would likely be different.

< ?php
/**
* Example PHP script to call the DeleteProgram() method of the
* TelVue Corporation SOAP Web Service.
*/
try {
  $service = new SoapClient('http://192.168.50.57:3000/program_service/wsdl');
  /*
    Function Parameters and Maximum Lengths:
      DeleteProgram(Program ID, api_key);
  */
  $result = $service->DeleteProgram('8', api_key);
  if ($result[0] == 'SUCCEEDED') {
    echo('
 
Program successfully deleted.
 
');
  } else {
    echo('
 
Failed. <strong>' . $result[1] . '</strong>
 
');
  }
} catch (SoapFault $fault) {
  trigger_error(
    "SOAP Fault: (
      faultcode: {$fault-&gt;faultcode}, faultstring: {$fault-&gt;faultstring}
    )",
    E_USER_ERROR
  );
}
?&gt;

Returns

Success

HTTP Code Response String Description
200 SUCCEEDED Add operation succeeded.

Failure

HTTP Code Response String Description
200 FAILED Delete operation failed.
200 User is not authorized: username API key was not found in the system.
200 Program with id program_id does not exist. The program with that identifier was not found in the system.
Facebooktwittergoogle_pluslinkedin

One Comment

  1. This article does not work with my 3.11 server. I had to use the old way…

    try {
    $service = new SoapClient(‘http://192.168.1.14:3000/program_service/wsdl’);
    $result = $service->DeleteProgram($id, ‘psgadmin’);
    if ($result[0] == ‘SUCCEEDED’) {
    return “Program $id successfully deleted”;
    } else {
    return “Failed deleting $id $result[1] “;
    }
    } catch (SoapFault $fault) {
    trigger_error(
    “SOAP Fault: (
    faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring}
    )”,
    E_USER_ERROR
    );
    }