title: One Drive API returns invalid Access Token
body: <p>The authentication process is not working now.(It was working earlier). By following the documentation I'm trying to get the access token from a refresh token. I successfully can get a access token. But it's not valid. I'm setting it as Bearer and send it in my GET request and it returns the following JSON</p>
  
  <pre><code>{"error":{"code":"accessDenied","message":"Access Denied"}}
  </code></pre>
  
  <p>Here is the code sample</p>
  
  <pre><code>    String messageBody = "client_id=" + "9b1a6dbb-7e1f-41b5-b448-9f328169411e" + "&amp;redirect_uri=" + returnURL + "&amp;client_secret={cleindsecret}
              + "&amp;refresh_token={refreshtoken}&amp;grant_type=refresh_token";
  
      RequestBody oAuthCodeRedeemBody = RequestBody.create(MediaType.parse("application/x-www-form-urlencoded"),
              messageBody);
  
      Request request = new Request.Builder().url("https://login.live.com/oauth20_token.srf")
              .post(oAuthCodeRedeemBody).build();
  
      String responseBody = null;
      OkHttpClient client = new OkHttpClient();
      client.setFollowRedirects(false);
      Response response;      
  
      String accessToken = null;
  
      try {
          response = client.newCall(request).execute();
          responseBody = response.body().string();
          resp = (JSONObject) jsonParser.parse(responseBody);
      } catch (IOException | ParseException e) {
          e.printStackTrace();
      }
      accessToken = (String) resp.get("access_token");
  </code></pre>
  
  <p>I'm getting a Access Token here. But I can't use it to do any work.</p>
  
  <pre><code>Request request2 = new Request.Builder().url("https://api.onedrive.com/v1.0/drive/items/1ED8983F38E94F01!107/children").header("Authorization", "Bearer " + accessToken).get().build();
  </code></pre>
  
  <p>The response for the above code is returned as </p>
  
  <pre><code>{"error":{"code":"accessDenied","message":"Access Denied"}}
  </code></pre>
  
  <p>What is the reason here. Is the API returning me a invalid access token or is something wrong in my code?</p>