내 페이스 북의 재미있는 페이지에 자동으로 기사를 게시하는 간단한 Java 프로그램을 개발 중입니다. 앱을 만들었고 URL을 사용하여 access_token을 얻었습니다 : https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=APP_ID&client_secret=CLIENR_SECRET. 나는 재미 페이지 벽에 게시하려면이 자바 코드를 사용사용자가이 작업을 수행하도록 응용 프로그램을 승인하지 않았습니다.
{
"error": {
"message": "(#200) The user hasn't authorized the application to perform this action",
"type": "OAuthException"
}
}
가 어떻게 내 재미 페이지에 게시하는 내 응용 프로그램의 인증을 제공 할 수 있습니다 :
String url = "https://graph.facebook.com/" + PAGE_ID + "/feed"
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("access_token", accessToken));
nvps.add(new BasicNameValuePair("message", item.getTitle()));
HttpClient client = new DefaultHttpClient(params);
HttpPost httpost = new HttpPost(url);
httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
HttpResponse response = client.execute(httpost);
HttpEntity entity = response.getEntity();
나는이 오류가있어?
다음은 article.http : //stackoverflow.com/questions/4474367/upload-photo-to-facebook-with-httpclient 대신 facebook에 사진을 게시하는 것과 비슷한 토론입니다. – kosa