Created
April 22, 2019 19:15
-
-
Save Adebayo-Adesegun/4bd4abedb5d60d076e2199ab6330241b to your computer and use it in GitHub Desktop.
Initial entry point of a console application project
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.Collections.Generic; | |
namespace KonnectAPIC | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
#region Recipient Numbers | |
List<string> num = new List<string>(); | |
num.Add("< Add number with country code>"); | |
num.Add("< Add number with country code>"); | |
#endregion | |
#region Credentials | |
string accountId = "< Account id from kirusa dashboard >"; | |
string authkey = "< Auth key from kirusa dashboard >"; | |
#endregion | |
#region Send SMS | |
RequestSMS sms = new RequestSMS(); | |
sms.Id = "< Generate a unique reference Id >"; | |
sms.To = num; | |
sms.Body = "< Compose message to send as sms>"; | |
KonnectAPI konnect = new KonnectAPI(authkey, accountId); | |
konnect.SendSMS(sms).Wait(); | |
#endregion | |
#region SEND VOICE | |
RequestVoice voice = new RequestVoice(); | |
voice.id = "< Generate a unique reference Id >"; | |
voice.recipient = num; | |
voice.caller_id = "< OBD number from kirusa dashboard >"; | |
voice.media_url = "< link to recording eg https://myapp.com/recordings.mp3>"; | |
voice.direction = "outbound"; | |
KonnectAPI kon = new KonnectAPI(authkey, accountId); | |
kon.SendVoice(voice).Wait(); | |
Console.WriteLine("Operation completed"); | |
Console.ReadLine(); | |
#endregion | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment