title: UnknownError calling /beta/invitations
body: <p>I must be missing something obvious.  When posting to the beta API <a href="https://graph.microsoft.com/beta/invitations" rel="nofollow noreferrer">https://graph.microsoft.com/beta/invitations</a> (api ref: <a href="https://graph.microsoft.io/en-us/docs/api-reference/beta/api/invitation_post" rel="nofollow noreferrer">https://graph.microsoft.io/en-us/docs/api-reference/beta/api/invitation_post</a>), I get</p>
  
  <blockquote>
    <p>{
      "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
          "request-id": "e41b0eab-c39c-4cf8-9034-341c81fc722c",
          "date": "2017-01-14T19:26:55"
        }
      }
    }</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>namespace ConsoleApplication1
  {
      public class Program
      {
          static void Main(string[] args)
          {
              GraphClient g = new GraphClient();
              Console.WriteLine(g.SendPost(g.authContext, g.credential).Result);
          }        
      }
  
      public class GraphClient
      {
          public AuthenticationContext authContext;
          public ClientCredential credential;
          public GraphClient()
          {
              this.authContext = new AuthenticationContext("https://login.microsoftonline.com/MYTENANT.onmicrosoft.com");
              this.credential = new ClientCredential("MYCLIENTID", "MYCLIENTSECRET");
          }
          public async Task&lt;string&gt; SendPost(AuthenticationContext authContext, ClientCredential credential)
          {
              AuthenticationResult result = await authContext.AcquireTokenAsync("https://graph.microsoft.com", credential);
  
              HttpClient http = new HttpClient();
              HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://graph.microsoft.com/beta/invitations");
              request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
              request.Content = new StringContent("{\"invitedUserEmailAddress\": \"MYEMAIL@MYDOMAIN.COM\",\"inviteRedirectUrl\": \"https://MYWEBSITE.COM\"}", Encoding.UTF8, "application/json");
  
              HttpResponseMessage response = await http.SendAsync(request);
              return await response.Content.ReadAsStringAsync();
          }
      }
  
  }
  </code></pre>
  
  <p>Thanks!  I can do other /beta commands just fine.  For example GETting <a href="https://graph.microsoft.com/beta/users" rel="nofollow noreferrer">https://graph.microsoft.com/beta/users</a> returns a user list in my tenant, as expected.</p>
  
  <p>-Dan</p>