Facebook PHP SDK app to upload photo to page

前端 未结 1 1137
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 09:19

I am trying to create a Facebook application that uploads images to a page. I can manage to upload photos to the user\'s photo album but not to the page\'s.

Here\'s my c

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-21 09:47

    When you do:

    $facebook->api('/XXXXXXXXXX/photos', 'POST', array(
    

    ... is XXXXXXXXXX your appId or the albumId? You must do the call to your album ID.

    Also make sure you are using the correct $access_token. To make sure look at:

    https://graph.facebook.com/yourPageID?fields=access_token&access_token=YourPersonalAccessToken

    where yourPersonalAccessToken is:

    A Page admin access_token for this page; The current user must be an administrator of this page; only returned if specifically requested via the fields URL parameter.

    Your must grant to graph api manage_pages permissions.

    0 讨论(0)
提交回复
热议问题