Skip to content

Instantly share code, notes, and snippets.

@Adebayo-Adesegun
Created April 22, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adebayo-Adesegun/4bd4abedb5d60d076e2199ab6330241b to your computer and use it in GitHub Desktop.
Save Adebayo-Adesegun/4bd4abedb5d60d076e2199ab6330241b to your computer and use it in GitHub Desktop.
Initial entry point of a console application project
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