GetReceiveSms
Receive unread 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;
string url = "https://niksms.com/fa/publicapi/getReceiveSms";
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["username"] = "YourUsername";
values["password"] = "YourPassword";
values["startDate"] = "2018/01/01";
values["endDate"] = "2018/03/01";
var response = client.UploadValues(url, values);
var responseString = Encoding.Default.GetString(response);
List<NikSmsReceiveResult> result = JsonConvert.DeserializeObject<List<NikSmsReceiveResult>>(responseString);
}