title: Using UCWA api and getting error when trying to connect through code C#
body: <p>I am using UCWA api to create Lync Meeting URL but I am getting error in a step, </p>
  
  <p>and it is related to LYNC so trying to figure out how to resolve. My code is </p>
  
  <pre><code>string url_00   = ucwaMsRtcOAuth;   
  var authDic_00  = new Dictionary&lt;string, string&gt;();  
  
  authDic_00.Add("grant_type", "password");  
  authDic_00.Add("username", String.Format("{0}\\{1}", ucwaAdDomain, ucwaAdUser));  
  authDic_00.Add("password", ucwaAdPassword);  
  
  httpClient.DefaultRequestHeaders.Remove("Accept");  
  httpClient.DefaultRequestHeaders.Add("Accept", "application/vnd.microsoft.com.ucwa+xml");  
  
  var res_00 = await httpClient.PostAsync(url_00, new FormUrlEncodedContent(authDic_00));  
  
  string res_00_request   = res_00.RequestMessage.ToString();  
  string res_00_headers   = res_00.Headers.ToString();  
  string res_00_status    = res_00.StatusCode.ToString();  
  var res_00_content      = await res_00.Content.ReadAsStringAsync();  
  </code></pre>
  
  <p>and output of last 4 variable is as </p>
  
  <p><strong>res_00.RequestMessage</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Method: POST, RequestUri: 'https://lynceu1webint.MYCOMPANYNAME.com/WebTicket/oauthtoken', 
  Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
  {
    Accept: application/vnd.microsoft.com.ucwa+xml
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 72
  }
  </code></pre>
  
  <p><strong>res_00.Headers</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Pragma: no-cache
  X-Ms-diagnostics: 28020;source="GDLYNPRFEWP01P.corp.MYCOMPANYNAME.com";reason="No valid security token."
  X-MS-Server-Fqdn: GDLYNPRFEWP01P.corp.MYCOMPANYNAME.com
  Strict-Transport-Security: max-age=31536000; includeSubDomains
  X-Content-Type-Options: nosniff
  Cache-Control: no-store
  Date: Fri, 20 May 2016 11:12:09 GMT
  Server: Microsoft-IIS/8.0
  X-Powered-By: ASP.NET
  </code></pre>
  
  <p><strong>res_00.StatusCode</strong> </p>
  
  <pre class="lang-none prettyprint-override"><code>BadRequest
  </code></pre>
  
  <p><strong>res_00.Content</strong></p>
  
  <pre class="lang-json prettyprint-override"><code>{"error":"invalid_grant"}
  </code></pre>