Facebook组文件api [英] Facebook group docs api

查看:111
本文介绍了Facebook组文件api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过facebook组API发布和检索组的文档?我已经通过文档,找不到任何解释如何实现这一点,如果有人知道我可以得到这个,请给链接url,以便我可以去阅读它自己。简而言之,我想要检索并能够通过facebook API(或者JavaScript或PHP)将文件发布到Facebook群组。基本上我只是在找一个我可以去的地方,为自己读一下如何做到这一点,不用喂代码,但如果有任何代码在那里工作,那么不要犹豫,发布。



感谢
Donald

解决方案

Facebook API文档中唯一的页面我发现提及组文件是这样的:
https://developers.facebook .com / docs / reference / api / group /



您可以使用该组的文档连接来检索组的文档。



使用此表单的URL:

  https://graph.facebook。 com / group_id / docs?access_token = ... 

使用文档的ID,您可以请求它直接:

  https://graph.facebook.com/doc_id?access_token = ... 

使用 JavaScript SDK

  FB.api(' doc_id',function(doc){
alert(document.body.innerHTML = doc.message);
});



发布文档



(需要权限$ _ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ This This This This This This This This This This This This This This This This This This This This This是一个测试文档'
};
FB.api(group_id +'/ docs','post',doc,function(response){
if(!response || response.error){
alert ');
} else {
alert('Doc ID:'+ response.id);
}
});


Is it possible that i can post and retrieve a group's documents with the facebook group api? i have went through the documentation and couldn't find anything that explain how this can be achieved, if anyone know where i can get this please give the link url so that i can go and read it myself. In short i want to retrieve and be able to post documents to a facebook group through a facebook api, either javascript or PHP. basically i'm just looking for a place where i can go and read for myself how this can be done not to be fed with code but if there is any code working out there then don't hesitate to post it.

Thanks Donald

解决方案

The only page in the Facebook API docs I found that mentions group documents is this: https://developers.facebook.com/docs/reference/api/group/

You can retrieve the documents of a group with the docs connection of the group.

Use a URL of this form:

https://graph.facebook.com/group_id/docs?access_token=...

With the ID of a doc, you can request it directly:

https://graph.facebook.com/doc_id?access_token=...

Using the JavaScript SDK:

FB.api('/doc_id', function(doc) {
  alert(document.body.innerHTML = doc.message);
});

Posting a doc

(requires permissions publish_stream and manage_groups)

var doc = {
  subject: 'Test',
  message: 'This is a test doc.'
};
FB.api(group_id + '/docs', 'post', doc, function(response) {
  if (!response || response.error) {
    alert('Error occured');
  } else {
    alert('Doc ID: ' + response.id);
  }
});

这篇关于Facebook组文件api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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