title: Instagram authentication API not returning access token
body: <p>The instagram "server side workflow" for authenticating a user and giving them a session access token doesn't work. First part works in that I can get a code back from here:
  <a href="https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&amp;redirect_uri=REDIRECT-URI&amp;response_type=code" rel="nofollow noreferrer">https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&amp;redirect_uri=REDIRECT-URI&amp;response_type=code</a></p>
  
  <p>However, when posting this code to 
  <a href="https://api.instagram.com/oauth/access_token" rel="nofollow noreferrer">https://api.instagram.com/oauth/access_token</a>
  in order to obtain the access token, it just response with "YOU MUST PROVIDE A CLIENT ID", even though I have provided this as part of the form data - the same client id I used to get the code in the first place!</p>
  
  <p>Here is the code I am using:</p>
  
  <pre><code>getIgToken: function (igCode) {
              let data = {
                  client_id: config.imported.instagram.client_id,
                  client_secret: config.imported.instagram.client_secret,
                  grant_type: 'authorization_code',
                  redirect_uri: 'http://localhost:5000/app/scrape',
                  code: igCode
              }
              return $http({
                  method: 'POST',
                  url: 'https://api.instagram.com/oauth/access_token',
                  data: data,
                  headers: {
                      "Content-Type": "application/x-www-form-urlencoded",
                  },
              })
  
          }
  </code></pre>
  
  <p>Apparently others have reported problems with posting the data as json, which have then been resolved by using "application/x-www-form-urlencoded" - however this doesn't seem to work either now.</p>
  
  <p>Here is the exact error message returned:</p>
  
  <pre><code>{error_type: "OAuthException", code: 400, error_message: "You must provide a 
  client_id"}
  code:400
  error_message:"You must provide a client_id"
  error_type:"OAuthException"
  </code></pre>