ContactMemberCreate
Register a new contact in the phone book
{{:: '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> CreateContact(){
string url = "https://niksms.com/api/v2/contact/member/create";
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["username"] = "YourUserName";
values["password"] = "YourPassword";
values["BirthDate"] = "ContactBirthDay";
values["CustomFields"] = {"CustomeFieldName" , "CustomeFieldValue"};
values["Description"] = "Description";
values["Email"] = "Email";
values["FullName"] = "FullName";
values["Mobile"] = "Mobile";
values["WeddingDate"] = "WeddingDate";
values["GroupId"] = "GroupId";
values["IsBlackList"] = true Or false;
values["Male"] = true Or false;
values["State"] = "State";
var response = await client.UploadValues(url, values);
var responseString = Encoding.Default.GetString(response);
return responseString;
}
}
}
}