GetPostbackSettingsForLicenseKey

From CDYNE Wiki
Jump to: navigation, search

Retrieve PostBackURL settings for SMS Notify! license key.

Contents

GetPostbackSettingsForLicenseKey Request

Parameter Name Data Type Sample Input Required
LicenseKey: License key to check PostbackURL settings.
Trial Key
Production Key
GUID f01d89fd-5155-5455-5585-e84ab8de8591 TRUE

GetPostbackSettingsForLicenseKey Response

Parameter Name Data Type Sample Output
Country: Origin country for DID/short code. String US
PhoneNumber: DID/short code being checked for PostbackURL settings. String 15551234567
PostbackEnabled: Notates if PostbackURL is enabled on DID/Short Code. Boolean true
PostbackType: Indicates whether PostBackURL is being used for incoming messages, outgoing messages, delivery receipts, or all messages associated with license key. String All
PostbackUrl: PostbackURL in use. String http://www.cdyne.com/postback.aspx
ReturnCode: Indicates if an error occurred due to the data in the request. String No Error

Complete list of return codes:

  • NoError
  • InvalidLicenseKey
  • InvaildUrl
  • InvalidPhoneNumber
  • InvalidPostbackType
  • NotFound
  • InvalidCountry

HTTP GET Request

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

Ruby

require 'net/http'
require 'URI'
 
puts URI.methods
 
url = URI.parse("http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591")
 
res = Net::HTTP.get_response(url)
 
data = res.body
 
puts data
gets data

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);
 
?>

VBScript

Dim oXMLHTTP
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
Set oDoc = CreateObject("MSXML2.DOMDocument")
 
Call oXMLHttp.Open("GET", "http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591", False)
Call oXMLHttp.setRequestHeader("Content-Type", "text/xml")
Call oXMLHttp.send
 
MsgBox oXMLHTTP.responseText
 
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fso, MyFile, FileName, TextLine
Set fso = CreateObject("Scripting.FileSystemObject")
FileName = "c:\Users\Desktop\MMS.txt"
Set MyFile = fso.OpenTextFile(FileName, ForWriting, True)
MyFile.WriteLine oXMLHttp.responseText
MyFile.Close
Set MyFile = fso.OpenTextFile(FileName, ForReading)
Do While MyFile.AtEndOfStream <> True
TextLine = MyFile.ReadLine
Loop
 
MyFile.Close
 
set request = nothing

JAVA

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
 
public final class GetPostbackSettingsForLicenseKey {
 
public static void main(String[] args) {
 
try {
URL url = new URL("http://messaging.cdyne.com/Messaging.svc/GetPostbackSettingsForLicenseKey?"
+ "LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591");
try {
InputStream in = url.openStream();
StreamSource source = new StreamSource(in);
printResult(source);
} catch (java.io.IOException e) {
}
} catch (MalformedURLException e) {
}
}
 
private static void printResult(Source source) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
StreamResult sr = new StreamResult(bos);
Transformer trans = TransformerFactory.newInstance().newTransformer();
Properties oprops = new Properties();
oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
trans.setOutputProperties(oprops);
trans.transform(source, sr);
System.out.println("**** Response ******");
System.out.println(bos.toString());
 
bos.close();
System.out.println();
} catch (Exception e) {
}
}
}
Personal tools
Namespaces

Variants
Actions
Navigation
Tools

Trial Key