Difference between revisions of "GetPostbackSettingsForLicenseKey"

From CDYNE Wiki
Jump to navigation Jump to search
imported>Bdriggers
(VB.Net)
imported>Bdriggers
(VB.Net)
Line 82: Line 82:
 
End Module
 
End Module
  
 +
</code>
 +
 +
== PHP with cURL ==
 +
<code type=php>
 +
<?php
 +
 +
$url='http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591';
 +
 +
$ch = curl_init();
 +
 +
curl_setopt($ch,CURLOPT_URL,$url);
 +
curl_setopt($ch,CURLOPT_HTTPGET,true);
 +
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 
 +
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Accept: application/json'));
 +
 +
//print_r($url);
 +
 +
$response = curl_exec($ch);
 +
curl_close($ch);
 +
 +
print_r($response);
 +
 +
?>
 
</code>
 
</code>

Revision as of 14:23, 18 October 2017

JSON

http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591

C#

/*http://messaging.cdyne.com/Messaging.svc?wsdl was added as Service Reference and given the name WSDL*/

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GetPostbackSettingsForLicenseKey.WSDL;

namespace GetPostbackSettingsForLicenseKey {

   class Program
   {
       static void Main(string[] args)
       {
           MessagingClient client = new MessagingClient("mms2wsHttpBinding");
           Array resp  = client.GetPostbackSettingsForLicenseKey(new Guid("f01d89fd-5155-5455-5585-e84ab8de8591"));
           if (resp.Length > 0)
           {
               foreach (WSDL.PostbackSettingsResponse item in resp)
           
                   Console.WriteLine("Country: " + item.Country + Environment.NewLine +
                       "Phone Number: " + item.PhoneNumber + Environment.NewLine +
                        "Postback Enabled: " + item.PostbackEnabled + Environment.NewLine +
                        "Postback Type: " + item.PostbackType + Environment.NewLine +
                        "Postback URL: " + item.PostbackUrl + Environment.NewLine +
                        "Return Code: " + item.ReturnCode + Environment.NewLine + Environment.NewLine);
                   Console.ReadLine();
           }
       }
   }

}

VB.Net

'http://messaging.cdyne.com/Messaging.svc?wsdl was added as Service Reference and given the name WSDL

Imports GetPostbackSettingsForLicenseKey.WSDL

Module Module1

   Sub Main()
       Dim client As WSDL.MessagingClient = New MessagingClient("mms2wsHttpBinding")
       Dim resp As Array = client.GetPostbackSettingsForLicenseKey(New Guid("f01d89fd-5155-5455-5585-e84ab8de8591"))
       If resp.Length > 0 Then
           For Each item As WSDL.PostbackSettingsResponse In resp
               Console.WriteLine("Country: " + Convert.ToString(item.Country) + Environment.NewLine +
                         "Phone Number: " + Convert.ToString(item.PhoneNumber) + Environment.NewLine +
                          "Postback Enabled: " + Convert.ToString(item.PostbackEnabled) + Environment.NewLine +
                          "Postback Type: " + Convert.ToString(item.PostbackType) + Environment.NewLine +
                          "Postback URL: " + Convert.ToString(item.PostbackUrl) + Environment.NewLine +
                          "Return Code: " + Convert.ToString(item.ReturnCode) + Environment.NewLine + Environment.NewLine)
           Next
           Console.ReadLine()
       End If
   End Sub

End Module

PHP with cURL

<?php

$url='http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591';

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_HTTPGET,true); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Accept: application/json'));

//print_r($url);

$response = curl_exec($ch); curl_close($ch);

print_r($response);

?>