EXAMPLES - Warafux/personalNotesApiConnectorCSharp GitHub Wiki

Examples of usage

Example 1

Instanciate object of class personalNotesApiConnector

personalNotesApiConnector apiConnector = new personalNotesApiConnector();

Create a callback function

private void callback_attemptLogin(bool successConnection, string response)
{
        if(successConnection){
                //Connection was OK, parse the response to JSON object (JObject)
                JObject jsonObject = JObject.Parse(response);
                if (jsonObject.GetValue("status").ToString() == "success")
                {
                         //If login is success, save the token
                         this.apiConnector.setToken(jsonObject.GetValue("token").ToString());
                }
}

Login

this.apiConnector.attemptLogin(**<username>**, **<password>**, this.callback_attemptLogin);
⚠️ **GitHub.com Fallback** ⚠️