0
是否可以在Yammer的消息和活動中使用URL?Yammer活動更改消息
使用消息API,可以構造消息是:
- 正確鏈接(在此示例點擊標題轉到example.com/id/1/);和
- 包含圖像(placehold.it/100x100)。
例如:
#!/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
- 使用活動API它能夠使開放圖形對象:
- 不再鏈接到實際內容(它鏈接到https://www.yammer.com/ {網絡} /圖形/ {ID})
- 失去其圖像(它是現在mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png)
實施例:
#!/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 100x100的VS )。文檔(https://developer.yammer.com/v1.0/docs/open-graph)說「當一個OG對象存在(使用相同的URL)時,它會被適當地更新。」