RemoveMedia

From CDYNE Wiki
Jump to navigation Jump to search

Remove media you have added to your license key.

RemoveMedia Request

Parameter Name Data Type Sample Input Required
LicenseKey: License key media file was added to.
Trial Key
Production Key
GUID f01d89fd-5155-5455-5585-e84ab8de8591 TRUE
MediaID: Unique ID given to specific media file. Int 0001 TRUE

RemoveMedia Response

Parameter Name Data Type Sample Output
RemoveMedia: Confirmation media file has been removed. Boolean True

HTTP GET Request

http://messaging.cdyne.com/Messaging.svc/RemoveMedia?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591&MediaId=0001

Ruby

 1 require 'net/http'
 2 require 'URI' 
 3 
 4 puts URI.methods 
 5 
 6 url = URI.parse("http://messaging.cdyne.com/Messaging.svc/RemoveMedia?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591&MediaId=0001")
 7 
 8 res = Net::HTTP.get_response(url) 
 9 
10 data = res.body 
11 
12 puts data
13 gets data

C#

 1 /*http://messaging.cdyne.com/Messaging.svc?wsdl was added as Service Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using RemoveMedia.WSDL;
 9 
10 namespace RemoveMedia
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             MessagingClient client = new MessagingClient("mms2wsHttpBinding");
17             bool resp = client.RemoveMedia(new Guid("f01d89fd-5155-5455-5585-e84ab8de8591"), 0001);
18 
19             Console.WriteLine("Image Removed: " + resp);
20 
21             Console.ReadLine();
22         }
23     }
24 }

VB.Net

 1 'http://messaging.cdyne.com/Messaging.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports RemoveMedia.WSDL
 4 
 5 Module Module1
 6 
 7     Sub Main()
 8 
 9         Dim client As WSDL.MessagingClient = New MessagingClient("mms2wsHttpBinding")
10 
11         Dim resp As Boolean = client.RemoveMedia(New Guid("f01d89fd-5155-5455-5585-e84ab8de8591"), 12442)
12 
13         Console.WriteLine("Image Removed: " + Convert.ToString(resp))
14 
15         Console.ReadLine()
16 
17     End Sub
18 
19 End Module

PHP with cURL

 1 <?php
 2 
 3 $url='http://messaging.cdyne.com/Messaging.svc/RemoveMedia?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591&MediaID=11784';
 4 
 5 $ch = curl_init(); 
 6 
 7 curl_setopt($ch,CURLOPT_URL,$url);
 8 curl_setopt($ch,CURLOPT_HTTPGET,true);
 9 curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);  
10 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Accept: application/json'));
11 
12 //print_r($url);
13 
14 $response = curl_exec($ch); 
15 curl_close($ch); 
16 
17 print_r($response);
18 
19 ?>

VBScript

 1 Dim oXMLHTTP
 2 Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
 3 Set oDoc = CreateObject("MSXML2.DOMDocument")
 4 
 5 Call oXMLHttp.Open("GET", "http://messaging.cdyne.com/Messaging.svc/RemoveMedia?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591&MediaID=11784", False)
 6 Call oXMLHttp.setRequestHeader("Content-Type", "text/xml")
 7 Call oXMLHttp.send
 8 
 9 MsgBox oXMLHTTP.responseText
10 
11 Const ForReading = 1, ForWriting = 2, ForAppending = 8
12 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
13 Dim fso, MyFile, FileName, TextLine
14 Set fso = CreateObject("Scripting.FileSystemObject")
15 FileName = "c:\Users\Desktop\MMS.txt"
16 Set MyFile = fso.OpenTextFile(FileName, ForWriting, True)
17 MyFile.WriteLine oXMLHttp.responseText
18 MyFile.Close
19 Set MyFile = fso.OpenTextFile(FileName, ForReading)
20 Do While MyFile.AtEndOfStream <> True
21 TextLine = MyFile.ReadLine
22 Loop
23 MyFile.Close  
24 
25 set request = nothing

JAVA

 1 import java.io.ByteArrayOutputStream;
 2 import java.io.InputStream;
 3 import java.net.MalformedURLException;
 4 import java.net.URL;
 5 import java.util.Properties;
 6 import javax.xml.transform.OutputKeys;
 7 import javax.xml.transform.Source;
 8 import javax.xml.transform.Transformer;
 9 import javax.xml.transform.TransformerFactory;
10 import javax.xml.transform.stream.StreamResult;
11 import javax.xml.transform.stream.StreamSource;
12 
13 public final class RemoveMedia {
14 
15     public static void main(String[] args) {
16 
17         try {
18             URL url = new URL("http://messaging.cdyne.com/Messaging.svc/RemoveMedia?"
19                     + "LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591"
20                     + "&MediaID=12471");
21             try {
22                 InputStream in = url.openStream();
23                 StreamSource source = new StreamSource(in);
24                 printResult(source);
25             } catch (java.io.IOException e) {
26             }
27         } catch (MalformedURLException e) {
28         }
29     }
30 
31     private static void printResult(Source source) {
32         try {
33             ByteArrayOutputStream bos = new ByteArrayOutputStream();
34             StreamResult sr = new StreamResult(bos);
35             Transformer trans = TransformerFactory.newInstance().newTransformer();
36             Properties oprops = new Properties();
37             oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
38             trans.setOutputProperties(oprops);
39             trans.transform(source, sr);
40             System.out.println("**** Response ******");
41             System.out.println(bos.toString());
42 
43             bos.close();
44             System.out.println();
45         } catch (Exception e) {
46         }
47     }
48 }