CSLibrary/User.cs
/// <summary>
/// Creates a New User SignNow Account
/// </summary>
/// <param name="Email">New User's Email Address</param>
/// <param name="Password">New User's Password</param>
/// <param name="FirstName">New User's First Name</param>
/// <param name="LastName">New User's Last Name</param>
/// <param name="ResultFormat">JSON, XML</param>
/// <returns>The ID of the new user account and verification status.</returns>
Creates a New User SignNow Account
Creates a New User SignNow Account
public static dynamic Create(string Email, string Password, string FirstName = "", string LastName = "", string ClientId = "", string ClientSecret = "", string ResultFormat = "JSON")
        {
            var client = new RestClient();
            client.BaseUrl = new Uri(Config.ApiHost);
            var clientCredentials = Config.EncodedClientCredentials;
            if (ClientId != "" && ClientSecret != "")
            {
                clientCredentials = Config.encodeClientCredentials(ClientId, ClientSecret);
            }
            var request = new RestRequest("/user", Method.POST)
                .AddHeader("Accept", "application/json")
                .AddHeader("Authorization", "Basic " + Config.EncodedClientCredentials);
            request.RequestFormat = DataFormat.Json;
            request.AddBody(new { email = Email, password = Password, first_name = FirstName, last_name = LastName });
            var response = client.Execute(request);
            dynamic results = "";
            if (response.StatusCode == HttpStatusCode.OK)
            {
                results = response.Content;
            }
            else
            {
                Console.WriteLine(response.Content.ToString());
                results = response.Content.ToString();
            }
            if (ResultFormat == "JSON")
            {
                results = JsonConvert.DeserializeObject(results);
            }
            else if (ResultFormat == "XML")
            {
                results = (XmlDocument)JsonConvert.DeserializeXmlNode(results, "root");
            }
            return results;
        }
public static dynamic Create ( string Email , string Password , string FirstName = " " , string LastName = " " , string ClientId = " " , string ClientSecret = " " , string ResultFormat = " " ) { var client = new RestClient ( ) ; client . BaseUrl = new Uri ( Config . ApiHost ) ; var clientCredentials = Config . EncodedClientCredentials ; if ( ClientId != " " && ClientSecret != " " ) { clientCredentials = Config . encodeClientCredentials ( ClientId , ClientSecret ) ; } var request = new RestRequest ( " " , Method . POST ) . AddHeader ( " " , " " ) . AddHeader ( " " , " " + Config . EncodedClientCredentials ) ; request . RequestFormat = DataFormat . Json ; request . AddBody ( new { email = Email , password = Password , first_name = FirstName , last_name = LastName } ) ; var response = client . Execute ( request ) ; dynamic results = " " ; if ( response . StatusCode == HttpStatusCode . OK ) { results = response . Content ; } else { Console . WriteLine ( response . Content . ToString ( ) ) ; results = response . Content . ToString ( ) ; } if ( ResultFormat == " " ) { results = JsonConvert . DeserializeObject ( results ) ; } else if ( ResultFormat == " " ) { results = ( XmlDocument ) JsonConvert . DeserializeXmlNode ( results , " " ) ; } return results ; }
Creates a New User SignNow Account
Creates a New User SignNow Account
The ID of the new user account and verification status.
The ID of the new user account and verification status .
Email
string
New User's Email Address
New User ' s Email Address
Password
string
New User's Password
New User ' s Password
FirstName
string
New User's First Name
New User ' s First Name
LastName
string
New User's Last Name
New User ' s Last Name
ClientId
string
ClientSecret
string
ResultFormat
string
None