I have found answer for my question after reading the following posts
A Sample Console Application (C# based)
Understanding the flow and How to get Application URLs
Stack Overflow
To get User Presence I added onemore method to the UcwaPresence like below: (You will find the UcwaPresence helper class in above mentioned sample app)
You have a GetPresenceURL method in UcwaPresence helper class with the help of that you can get the ucwaPresenceRootUri.
Once you get the GetPresence URL(here in my case called ucwaPresenceRootUri) then call the following method to get status
public static async Task<string> GetPresence(HttpClient httpClient, AuthenticationResult ucwaAuthenticationResult, String ucwaPresenceRootUri)
{
httpClient.DefaultRequestHeaders.Clear();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ucwaAuthenticationResult.AccessToken);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var httpResponseMessage =
httpClient.GetAsync(ucwaPresenceRootUri).Result;
var presenceJsonStr = await httpResponseMessage.Content.ReadAsStringAsync();
var presenceObj = JsonConvert.DeserializeObject<UcwaPresenceObject>(presenceJsonStr);
Debug.WriteLine(presenceJsonStr);
return presenceObj.availability;
}
Credits
tam-huynh