我如何安排帖子到Instagram与Javascript图形API?



我设法用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上的预定帖子?我以为我会在商业页面看到它,你可以看到你所有的帖子,但我不能在那里看到它?也许是因为我的应用还在审核中?

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

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

如果你想添加媒体,首先创建一个IG媒体对象容器,然后发布容器。

正如你所看到的,Instagram API的第一个版本非常简单,没有调度功能。我希望未来的版本将支持更多的功能。然而,考虑到每24个滚动小时只能发布25个Instagram帖子的限制,他们可能很难通过他们的API允许定期发布帖子。

你也可以看看提供未来调度的第三方社交媒体api。

最新更新