P2PAsync
Quick send peer-to-peer SMS
{{:: 'controllers.documentation.chooseFramework' | translate }}
PM > Install-Package
NikSms.Library.Net
PM > Install-Package
NikSms.Library.NetCore
//Import Libraries
using System.Text;
using System.Net;
using System.Collections.Specialized;
using Newtonsoft.Json;
namespace AwesomeApplication
{
public class NikSmsApiV2Client
{
public async Task<string> P2PAsync(){
string url = "https://niksms.com/api/v2/send/p2p-async";
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["username"] = "YourUserName";
values["password"] = "YourPassword";
values["p2p"] = ArrayOfRecipientsNumbersAndTextMessage;
values["senderNumber"] = "YourSenderNumber";
values["sendDate"] = "DateTimeToSend";
values["callBackId"] = YourIdToCallBack;
values["callBackUrl"] = "YourCallBackUrl";
var response = await client.UploadValues(url, values);
var responseString = Encoding.UTF8.GetString(response);
return responseString;
}
}
}
}