title: Error code 2500 Facebook graph api
body: <p>I do not understand why this query does not work in android and "Graph Api Explorer" if it</p>
  
  <blockquote>
    <p>111891332274505?fields=albums.fields(id,name,description,updated_time,created_time,cover_photo)</p>
  </blockquote>
  
  <p><strong>Error Code</strong></p>
  
  <blockquote>
    <p>Error code: 2500 Error mensaje: {HttpStatus: 400, errorCode: 2500,
    errorType: OAuthException, errorMessage: Syntax error "Expected end of
    string instead of "?"." at character 6:
    photos?access_token=XXXXXXXXXXXX}</p>
  </blockquote>
  
  <p><strong>Code</strong></p>
  
  <pre><code>     public void getAlbumFacebook () {
       Request request = new Request(session, "/111891332274505?fields=albums.fields(id,name,description,updated_time,created_time,cover_photo)", null, HttpMethod.GET, new Request.Callback() {
          @Override
          public void onCompleted(Response response) {
              GraphObject graphObject = response.getGraphObject();
              FacebookRequestError error = response.getError();
  
               if (error != null) {
                   DebugLog.log("Error code: " + error.getErrorCode() + " Error mensaje: " + error.toString());
  
              }
  
              if (graphObject != null) {
                  JSONArray jsonArray = (JSONArray) graphObject.getProperty("data");
                  DebugLog.log("JSON Facebook "+ jsonArray.toString());
              } else {
                   DebugLog.log("Es null");
  
              }
          }
      });
  
      Request.executeBatchAsync(request);
   }
  </code></pre>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>I've already been able to solve the problem I can deduce is that the "Request" class can not consult with inserted fields.</p>
  
  <p>In the end what I have done is to build the url and request data through the url.</p>
  
  <p><strong>Build URL</strong></p>
  
  <pre><code> String id = "111891332274505";
   String url = "https://graph.facebook.com/" + id + "/albums?access_token=" + session.getAccessToken() + "&amp;fields=id,name,description,updated_time";
  </code></pre>
  
  <p><strong>Code request</strong></p>
  
  <pre><code>     public JSONObject getRequestFromUrl (String url) {
       try {
           httpClient = new DefaultHttpClient();
           HttpGet get = new HttpGet(url);
  
           HttpResponse httpResponse = httpClient.execute(get);
           HttpEntity responseEntity = httpResponse.getEntity();
           is = responseEntity.getContent();
           DebugLog.log("Estoy aqui");
      } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
      } catch (ClientProtocolException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      try {
          BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8);
          StringBuilder sb = new StringBuilder();
          String line = null;
  
          while ((line = reader.readLine()) != null) {
              sb.append(line + "\n");             
          }
  
          is.close();
          json = sb.toString();
          Log.e("JSON", json);
      } catch (Exception e) {
          Log.e("Buffer Error", "Error converting result " + e.toString());
      }
  
      try {
          jObj = new JSONObject(json);
      } catch (JSONException e) {
          Log.e("JSON Parser", "Error parsing data " + e.toString());
      }
  
      return jObj;
   }
  </code></pre>