title: Oauth not working CX api
body: <p>I'm trying to use the oauth for CX exposed api, I followed their documentation, still I'm getting HTTP "BAD REQUEST" error, Here is the code -</p>
  
  <pre><code>    String method = "POST";
      String code = "";
      NameValuePair[] data = {
                               new NameValuePair("grant_type", "authorization_code"),
                               new NameValuePair("code", code),
                               new NameValuePair("redirect_uri",URLEncoder.encode(CALLBACK_URL, "UTF-8"))              
                              }; 
      String secret = CONSUMER_KEY+":"+CONSUMER_SECRET;
      String encodedSecret = Base64.encodeBase64String(secret.getBytes("UTF-8"));
      org.apache.commons.httpclient.HttpClient httpClient = new org.apache.commons.httpclient.HttpClient();
      PostMethod httpMethod = new PostMethod(ACCESS_TOKEN_ENDPOINT_URL);
      httpMethod.addRequestHeader("Authorization","Basic "+encodedSecret);
      httpMethod.setRequestBody(data);
      System.out.println("HTTP call -- " + method + " " + ACCESS_TOKEN_ENDPOINT_URL);
      httpClient.executeMethod(httpMethod);
  </code></pre>
  
  <p>Thanks,
  Hemant</p>