开发者

Facebook API: undocumented 'properties' attribute on Post type

开发者 https://www.devze.com 2023-03-07 04:41 出处:网络
The official API docs are too sparse (here). T开发者_运维知识库here is at least one attribute not listed there which you can use very usefully when making posts. This is a self-answered question to do

The official API docs are too sparse (here). T开发者_运维知识库here is at least one attribute not listed there which you can use very usefully when making posts. This is a self-answered question to document the 'properties' field because I could not find all the information on SO.


The 'properties' field is set by submitting as text a JSON serialised object containing all the properties you want listed at the bottom of your Post:

{
 "name of prop 1" : {"text": "Value of prop 1", "href":"http://..."}, 
 "name of prop 2" : "value of prop 2"
}

The Post will be formatted as follows:

......
.    .  User name
.Pict.
.    .  <message field>
......
        | <name> (linked to <link>)
        | <caption>
        |
        | <description>
        |
        | <name of prop 1>: <value> (linked to its link)
        | <etc>
       [*] Yesterday by <your app>

Note also per this question that you can suppress the picture from appearing by overriding the picture field with a source field; the picture field is not allowed to be set to an invalid link, but the source field can then.

Finally, the properties field is returned when querying the Graph API in a different format to that it is submitted in:

[{
   "name": "Source",
   "text": "Title of site",
   "href": "http://www...."
},
{
   "name": "Published",
   "text": "Thursday 12th"
}]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号