Created
January 23, 2015 16:12
-
-
Save dozzman/4fd1d10effc1ee65db56 to your computer and use it in GitHub Desktop.
Working Nexmo Number Callback Change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
public class HelloWorld | |
{ | |
static public void Main () | |
{ | |
string api_key = "xxxxx"; | |
string api_secret = "xxxxx"; | |
string country = "xx"; | |
string nexmo_number = "xxxxxxxxx"; | |
string callback_number = "xxxxxxxxxxx"; | |
Console.WriteLine("Attempting to change callback for number " + nexmo_number + " using..." ); | |
Console.WriteLine(); | |
Console.WriteLine("api_key = " + api_key); | |
Console.WriteLine("api_secret = " + api_secret); | |
Console.WriteLine("country = " + country); | |
Console.WriteLine("callback_number = " + callback_number); | |
Console.WriteLine(); | |
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create( | |
"http://rest.nexmo.com/number/update/" + api_key | |
+ "/" + api_secret + "/" + country + "/" + nexmo_number | |
+ "?voiceCallbackType=tel&voiceCallbackValue=" + callback_number ); | |
httpWebRequest.Method = "POST"; | |
httpWebRequest.ContentType = "application/x-www-form-urlencoded"; | |
HttpWebResponse httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); | |
Console.WriteLine("Status " + httpResponse.StatusCode ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment