使用API​​将图片上传到Facebook粉丝专页

编程入门 行业动态 更新时间:2024-10-24 00:25:53
本文介绍了使用API​​将图片上传到Facebook粉丝专页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试通过Facebook Graph API的应用程序将图像上传到我的粉丝页面的相册。虽然我提供了相册ID,如上传图片的参数,但它已经上传到我自己的个人资料中的APPLICATION_NAME照片专辑中。粉丝专页的相册留空。我也尝试发送我的粉丝页面的pageID而不是albumID,但结果是一样的。我用于上传的代码是:

I am trying to upload an image through my application with Facebook Graph API to an album of my fan page. Although I provide the albumID like a parameter for uploading the image, it is uploaded in an album named APPLICATION_NAME Photos on my own profile. The album of the fan page stays empty. I tried also with sending the pageID of my fan page instead of albumID, but the result is the same. The code I use for the upload is:

$fb_pfoto = $facebook->api('/' . $albumID . '/photos','POST', array( 'access_token' => $session['access_token'], 'message' => 'Caption', 'source' => '@' . realpath( '/path/to/image.jpg' ) ));

请给我想法如何将图像上传到粉丝专页,而不是我自己的个人资料相册

Please give me ideas how can I upload the image to the fan page and not to my own profile album.

推荐答案

不知道这是否有帮助,但也许您需要请求 manage_pages 扩展许可,然后使用返回的页面access_token来发布图片。您可以简要地了解此过程此处。

Don't know if this would help but maybe you need to request manage_pages extended permission and then use returned page access_token for posting pictures. You can read briefly about this process here.

然后您可以尝试这些链接与页面访问令牌发布照片:

Then you can try these links with page access token for posting photos:

/me/photos /<page_id>/photos /<album_id>/photos

更多推荐

使用API​​将图片上传到Facebook粉丝专页

本文发布于:2023-06-05 19:41:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/526470.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图片上传   粉丝   专页   API   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!