将图片上传到专辑(如果有的话)创建新专辑 - Facebook [英] Upload image to an album if exist else create new album - Facebook

查看:134
本文介绍了将图片上传到专辑(如果有的话)创建新专辑 - Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过一些努力,我有一些将图像上传到Facebook的代码,但现在的问题是它总是创建一个新的专辑。

我想修改代码,以便它只创建一个专辑如果还没有一个这个名字;

After some hardwork I have some code that uploads an image to Facebook, but now the problem is that it always creates a new album.
I want to modify the code so that it only creates an album if there isn't already one with that name; otherwise, just upload the image to the existing album.

我的代码用于上传图片:从照片上传照片到Facebook相册

My code for uploading images: Upload photos to Facebook Album from an app

推荐答案

该API允许您将图像上传到您应用的现有相册。简单地POST到 https://graph.facebook.com/USER_ID/photos - 照片将发布到为您的应用程序创建的专辑。如果您的应用不存在,我们会自动为您创建相册。所有以这种方式上传的照片将被添加到同一张专辑。

The API allows you to upload an image to an existing album for your app. Simply POST to https://graph.facebook.com/USER_ID/photos - The photo will be published to an album created for your app. We automatically create an album for your app if it does not already exist. All photos uploaded this way will then be added to this same album.

如果要将图像添加到特定的相册,您必须POST到 https://graph.facebook.com/ALBUM_ID/photos - 照片将发布到特定的现有相册,由ALBUM_ID表示。

If you want to add images to a specific album, you must POST to https://graph.facebook.com/ALBUM_ID/photos - The photo will be published to a specific, existing photo album, represented by the ALBUM_ID.

详细的操作指南如下: https://developers.facebook.com/blog/post/498

A detailed How-To Guide is here: https://developers.facebook.com/blog/post/498

这篇关于将图片上传到专辑(如果有的话)创建新专辑 - Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆