是否可以在Yammer中的消息和活动中使用URL?
使用消息API,可以构造一条消息:
例如:
#!/bin/bash
GROUP={GROUP}
TOKEN={TOKEN}
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
--data "body=hello" \
--data "group_id=$GROUP" \
--data "og_fetch=false" \
--data "og_url=http%3A%2F%2Fwww.example.com%2Fid%2F2%2F" \
--data "og_title=Title" \
--data "og_image=http%3A%2F%2Fplacehold.it%2F100x100" \
--data "og_description=Description" \
--data "og_object_type=page" \
--data "og_private=true" \
https://www.yammer.com/api/v1/messages.json
示例:
#!/bin/bash
TOKEN={TOKEN}
EMAIL={EMAIL}
curl -X POST \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"activity":{"actor":{"email":"'$EMAIL'"},"action":"create","object":{"url":"http://www.example.com/id/1/","image":"http://placehold.it/110x110","title":"Title","type":"page"}},"private":"false","message":"This is an update"}' \
https://www.yammer.com/api/v1/activity.json
问题是现在来自第1步的原始消息:
另外,开放图形对象不会更新活动帖子中提供的新图像(110x110 vs 100x100)。文档(https://developer.yammer.com/v1.0/docs/open-graph)说“当存在OG对象时(使用相同的URL),它会被适当更新。”
答案 0 :(得分:1)
在一个示例中,您将打开的图形对象设置为private,另一个设置为public。这可能会导致您看到的奇怪问题。 “og_private =真”