title: http post facebook graph api processing
body: <p>i want to post something on the wall of a facebook user via a processing applet. first i get the access_token for the user with the app_id and user_id through the Oauth authentication.
  i used this <a href="http://jorgecardoso.eu/blog/index.php?/archives/171-Facebook-OAuth-class-for-Processing.html" rel="nofollow noreferrer">code</a>, thanks Jorge</p>
  
  <p>now i want to publish a post on the wall of the user.
  i make a http post request to <a href="https://graph.facebook.com/USER_ID/feed" rel="nofollow noreferrer">https://graph.facebook.com/USER_ID/feed</a>
  with these arguments "access_token", "XXX ; "message", "Check ... Processing!"</p>
  
  <p>the response of the request is</p>
  
  <pre><code>executing request: POST https://graph.facebook.com/USER_ID/feed HTTP/1.1
  ----------------------------------------
  HTTP/1.1 403 Forbidden
  ----------------------------------------
  {"error":{"type":"OAuthException","message":"(#200) This API call requires a valid app_id."}}
  </code></pre>
  
  <p>what does that mean?
  i have entered a valid app_id...otherwise i didn't get the access_token?</p>
  
  <p>regards,
  peter</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  
  void setup()
  {
    String url = "https://graph.facebook.com/USER_ID/feed";
  
    try
    {
      DefaultHttpClient httpClient = new DefaultHttpClient();
  
      HttpPost          httpPost   = new HttpPost( url );
      HttpParams        postParams = new BasicHttpParams();
                        postParams.setParameter( "access_token", "XXX" );
                        postParams.setParameter( "message", "Check ... Processing!" );
                        httpPost.setParams( postParams );    
  
      println( "executing request: " + httpPost.getRequestLine() );
  
      HttpResponse response = httpClient.execute( httpPost );
      HttpEntity   entity   = response.getEntity();
  
  
      println("----------------------------------------");
      println( response.getStatusLine() );
      println("----------------------------------------");
  
      if( entity != null ) entity.writeTo( System.out );
      if( entity != null ) entity.consumeContent();
  
  
      // When HttpClient instance is no longer needed, 
      // shut down the connection manager to ensure
      // immediate deallocation of all system resources
      httpClient.getConnectionManager().shutdown();       
  
    } catch( Exception e ) { e.printStackTrace(); }
  
    exit();
  }
  </code></pre>