【问题标题】:How can I schedule posts to Instagram with the Javascript Graph API?如何使用 Javascript Graph API 将帖子安排到 Instagram?
【发布时间】:2021-05-26 20:37:34
【问题描述】:

我设法使用 API 安排了 Facebook 帖子,但如何安排 Instagram 帖子?

这是安排在 Facebook 上发帖。为了能够做到这一点,您必须使用:

published: false,
scheduled_publish_time: convertedtime

所以我在下面使用上面的代码来安排时间。

FB.api('/' + pageId + '/photos', 'post', {
        message :facebooktexten,
        link : lanken, 
        url : bildUrl,
        access_token : aToken,
        published: false,
        scheduled_publish_time: convertedtime
        }, function(response) {             
            if (!response || response.error) {
                app.dialog.alert('Error occured'+response.error);           
            } else {                            
        }
});

但是当我尝试为 Instagram 做同样的事情时,它会直接发布到 Instagram。 首先我获取容器 ID,然后使用该容器 ID 发布。但我应该有

published: false,
scheduled_publish_time: convertedtime

当我请求容器 ID 或发布它时?

FB.api('/' + instagramId + '/media?image_url='+bildUrl+'&caption='+instagramtexten, 'post', {
        published: false,
        scheduled_publish_time: convertedtime
            }, function(response) {
                                                        
            if (!response || response.error) {                              
                app.dialog.alert('Error occured'+response.message);
            } else {
                //first I get the container Id here----                                 
                console.log('Media Container ID: '+response.id)
                
                FB.api('/' + instagramId + '/media_publish?creation_id='+response.id, 'post', {
                    published: false,
                    scheduled_publish_time: convertedtime
                    }, function(response) {

                    if (!response || response.error) {
                        app.dialog.alert('Error occured'+response.message);
                    } else {
                        console.log('It is posted!!!')
                    }
            });
        }
});

或者您如何安排到 Instagram? 另外,我在哪里可以看到 Facebook 中的预定帖子? 我以为我会在您看到所有帖子的业务页面中看到它,但我在那里看不到?也许是因为我的应用仍在审核中?

【问题讨论】:

  • “或者您如何安排到 Instagram?” – 您可以开始查阅 API 文档,以确定您想要的是否是甚至作为一种可能性提供(而不是相当天真地假设它“必须”。)
  • 哈哈我的天!你认为我一直在做什么?你以为我是怎么得到上面的代码的!!耶稣!是的,根据有关 Instagram API 的最新消息,这是可能的!
  • 那么这些最新消息在哪里,链接?
  • 这是一个链接,上面说您可以通过 API 安排发布到 Instagram 的时间。 developers.facebook.com/blog/post/2021/01/26/…
  • 我可以看到developers.facebook.com/docs/instagram-api/guides/… 只提到了一次“计划”这个词,它所指的其他端点描述似乎根本没有提到这个话题。猜猜你必须问 Facebook,这应该如何工作,resp。实际记录在哪里。

标签: api facebook


【解决方案1】:

虽然 Facebook Graph API 允许调度,但新的 Instagram Graph API 目前不允许。

整体内容发布:https://developers.facebook.com/docs/instagram-api/guides/content-publishing/

如果要添加媒体,请先创建IG Media Object Container,然后再创建publish the container

如您所见,Instagram API 的第一个版本非常简单,没有调度功能。我预计未来的版本将支持额外的功能。但是,鉴于每 24 个滚动小时期间只能发布 25 个 Instagram 帖子,他们可能很难通过其 API 允许预定的帖子。

您还可以查看提供未来日程安排的第三方社交媒体 API。

【讨论】:

  • 谢谢 Geoffrey,我已经正常发帖上班了,我只是觉得奇怪的是,他们在给开发人员的时事通讯中将日程安排作为一个新的大事,然后他们没有任何关于它。我只需要等待,看看他们是否会发布它,希望很快:-)
  • 我同意。乍一看,该公告看起来像是 API 允许预定的帖子。但是,内容发布 API 中的措辞表明您可以使用 API 自行安排发布时间。
  • 是的,我被安排去 Facebook 工作,但不能去 Instagram。好吧,我想它会在未来出现。
猜你喜欢
  • 1970-01-01
  • 2019-02-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多