title: Instagram API returning error when requesting access_token on Windows Phone
body: <p>I've been trying to integrate the Instagram API in my app, but am stuck with the authentication. I had it working completely fine when I was just using the implicit flow version which gave me the access_token as part of the URI fragment.
  However, now I'm changing to the server-side flow, in which I receive a code after the user logs in. I then post this code to the access token URL, which will then give me the access_token as well as certain information about the user, such as their username and profile picture link.</p>
  
  <p>I am using the InstaSharp library, modifying the source code.</p>
  
  <pre><code>        HttpClient client = new HttpClient { BaseAddress = new Uri(config.OAuthUri + "access_token/", UriKind.Absolute) };
          var request = new HttpRequestMessage(HttpMethod.Post, client.BaseAddress);
  
          request.AddParameter("client_secret", config.ClientSecret);
          request.AddParameter("client_id", config.ClientId);
          request.AddParameter("grant_type", "authorization_code");
          request.AddParameter("redirect_uri", config.RedirectUri);
          request.AddParameter("code", code);
  
          return client.ExecuteAsync&lt;OAuthResponse&gt;(request);
  </code></pre>
  
  <p>After creating my request, it is formatted as so:
  {Method: POST, RequestUri: '<a href="https://api.instagram.com/oauth/access_token/?client_secret=" rel="nofollow">https://api.instagram.com/oauth/access_token/?client_secret=</a>{CLIENT_SECRET}&amp;client_id={CLIENT_ID}&amp;grant_type=authorization_code&amp;redirect_uri=<a href="http://instagram.com" rel="nofollow">http://instagram.com</a> &amp;code={CODE}', Version: 1.1, Content: , Headers: { }}
  (I inserted the space between the redirect_uri and code because it wouldn't let me post the question otherwise)</p>
  
  <p>Everything appears normal in the address, but I always receive an error in the retuned json file:</p>
  
  <p>"{"code": 400, "error_type": "OAuthException", "error_message": "You must provide a client_id"}"</p>
  
  <p>I have no clue what is causing this error. Any help is greatly appreciated!
  Thanks!
  Elliott</p>