Click here to Skip to main content
15,884,018 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how can I send SMS from window form application in c# i registered in nexmo site
there are some security method
api_key
api_secret

HTTP Request
https://rest.nexmo.com/sms/json[^]
Posted
Comments
Rabee3-F1.787545 7-Aug-13 13:28pm    
i tried this code and as the site
String url = "https://rest.nexmo.com/sms/xml?api_key={2dc66b7a}&api_secret={0c8e9471}&from=Rabee3.f1@gmail.com&to=963992787545&text=D%c3%a9j%c3%a0+vu";
XmlDocument xmldoc = new XmlDocument();
// HTTP GET request to Orange API server
xmldoc.Load(url);
// display status of the post
try
{
MessageBox.Show("Status: " + xmldoc.SelectSingleNode("/response/status/status_msg").InnerText);
}
catch (Exception ex)
{

MessageBox.Show(ex.Message,ex.StackTrace);
}
Rabee3-F1.787545 7-Aug-13 13:29pm    
it returns null reference
Zoltán Zörgő 8-Aug-13 3:09am    
1) I am pretty sure, you don't need { and } around the two keys.
2) Try it first outside your code - with a browser for example (it is working)
I got this one:

<mt-submission-response>
<messages count="1">
<message>
<to>963992787545</to>
<status>6</status>
<errortext>Unroutable message - rejected</errortext>
<network>41701</network>
</message>
</messages>
</mt-submission-response>

3) Thank you for sharing your keys with the world.

Have you read their documentation? I doubt.
Try again: https://docs.nexmo.com/index.php/messaging-sms-api/send-message[^]... and scroll down at least to the example.
 
Share this answer
 
Comments
Manas Bhardwaj 8-Aug-13 2:58am    
Good link +5!
Remove { } from statement, so it will be
String url = "https://rest.nexmo.com/sms/xml?api_key=2dc66b7a&api_secret=0c8e9471&from=Rabee3.f1@gmail.com&to=963992787545&text=D%c3%a9j%c3%a0+vu";
 
Share this answer
 
Comments
Member 7995900 26-Aug-14 3:00am    
I use it in above format. but it gives <status>6
<errortext>Unroutable message - rejected
Hi dude,

I got it working..

Just remove the { and } before and after the secret_key and the api_key and include "Country code" before the mobile number!! :D

That's it!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900