2011-12-07 2 views
1

Facebook Graph API Post 설명서에서 이미지를 벽 (사용자 또는 페이지)에 게시하는 유일한 방법은 그림 필드를 요청하는 것입니다.facebook graph api를 사용하여 디스크에서 직접 사용자의 벽에 이미지를 게시하는 방법은 무엇입니까?

그래서 사용하여 하드 디스크의 이미지를 서버에 업로드하고 해당 URL을 사용할 수 있습니다. 이처럼 :

curl --form picture=http://userserve-ak.last.fm/serve/174s/66037848/Foals+png.png --form access_token=AAADChj --form message=msg1 https://graph.facebook.com/242001885843121/feed 

그러나 나는 게시물의 유형 필드가 "상태"로 설정되지 "사진"으로 가져옵니다 수행 할 때.

내가 성공하지 앨범에 이미지를 업로드에 사용 된 것과 같은 요청 매개 변수를 사용하여 같은 몇 가지 다른 일을 시도 :

curl --form [email protected]/tmp/fb_gallery.png --form access_token=AAADChj --form message=msg2 https://graph.facebook.com/242001885843121/feed 

curl --form [email protected]/tmp/fb_gallery.png --form access_token=AAADChj --form message=msg2 https://graph.facebook.com/242001885843121/feed 

나는 또한 행운과 함께 "사진"에 ​​대한 유형 필드를 설정하는 데 노력했다.

답변

0

는 시간

curl 
–F 'access_token=…' \ 
-F 'batch=[{"method":"POST", \ 
       "relative_url":"me/photos", \ 
       "body":"message=My cat photo" \ 
       "attached_files":"file1" \ 
      }, 
      {"method":"POST", \ 
       "relative_url":"me/photos", \ 
       "body":"message=My dog photo" \ 
       "attached_files":"file2" \ 
      }, 
      ]' 
-F '[email protected]' \ 
-F '[email protected]' \ 
https://graph.facebook.com 
+0

감사 Virendra에서이 사진을 업로드 할 수 있습니다이 하나를 사용해보십시오. 나는 결코 "/ 나/사진"을 생각하지 않았다. 감사! –

+0

환영합니다 !! –

관련 문제