2013-08-28 20 views
0

我想(以編程方式)向IBM Connections(4.0)中的活動流發佈狀態更新。我在尋找正確的地方,把這個JSON什麼是將標記添加到IBM Connections中的statusupdate的JSON語法?

"tags":[{"objectType":"tag","displayName":"ibms"}], 

我已經試過這樣:

{ 

"actor": { 

"id": "@me" 

}, 

"verb": "post", 

"title": "${share}", 



"content":"This event is my <i>second entry</i> #ibms", 

"updated": "2013-01-01T12:00:00.000Z", 

"object": { 

"summary": "First Entry details #ibms", 

"tags":[{"objectType":"tag","displayName":"ibms"}], 

"objectType": "note", 

"id": "objectid5", 

"displayName": "First entry", 

} 

} 

而且條目成功地發佈,但標籤是不存在的,我找了一個樣本正確地向包含標籤的活動流發佈註釋

回答

2

我不認爲你可以添加標籤狀態更新。至少你似乎無法在Connections UI中使用,所以我不明白你爲什麼能夠以編程方式。我相信你應該使用micro-blogging API發佈狀態更新。

+0

是的,它與ublog一起工作,非常容易(twitter like)。你知道我是否可以向社區ublog? – mpjjonker

+0

我不這麼認爲,因爲你不能微博到社區飼料專門 –

+0

好吧,以便排除在帶有標籤的社區中創建statusupdate? – mpjjonker

0

我知道活動流有一些建議的基本擴展,如此處所示。 http://activitystrea.ms/head/activity-schema.html#tags-property

"tags": [ 
     { 
     "objectType": "person", 
     "displayName": "John" 
     }, 
     { 
     "objectType": "person", 
     "displayName": "Jane" 
     } 
    ] 

如下面的例子

{ 
      "provider": { 
       "id": "http://www.ibm.com/xmlns/prod/sn", 
       "displayName": "IBM Connections - News Service", 
       "url": "https://greenhouse.lotus.com/news" 
      }, 
      "generator": { 
       "image": { 
        "url": "https://greenhouse.lotus.com/connections/resources/web/com.ibm.oneui3.styles/imageLibrary/Icons/ComponentsGray/ProfilesGray16.png?etag=20130711.110413" 
       }, 
       "id": "profiles", 
       "displayName": "IBM Connections - Profiles", 
       "url": "https://greenhouse.lotus.com/profiles" 
      }, 
      "actor": { 
       "objectType": "person", 
       "id": "@me", 
       "displayName": "Paul Bastide" 
      }, 

      "title": "Test from Paul", 
      "object": { 
       "summary": "TTest", 
       "objectType": "note", 
       "author": { 
        "connections": { 
         "state": "active" 
        }, 
        "objectType": "person", 
        "id": "urn:lsid:lconn.ibm.com:profiles.person:9f9c3740-88ed-102b-9b41-bfd8328767c1", 
        "displayName": "Paul" 
       }, 
       "id": "urn:lsid:lconn.ibm.com:profiles.note:74b5fd86-3a1d-4f11-93a2-8a771d9e877e", 
       "likes": { 
        "totalItems": 0 
       }, 

      }, 
      "verb": "post", 
"tags": [ 
     { 
     "objectType": "person", 
     "displayName": "John" 
     }, 
     { 
     "objectType": "person", 
     "displayName": "Jane" 
     } 
    ] 
     } 

也許上下文中還添加下吧...

+0

第一次嘗試,沒有給出想要的結果,如果你指定objectType:「tag」而不是「person」,它還能工作嗎? – mpjjonker

+0

你在4.5嗎?或4.0?我嘗試了4.5哎呀,我沒有嘗試與另一個對象 –

3

關於向社區發佈狀態更新的問題,只需將/ ublog/@ me/@中的@me替換爲有問題的社區的ID並照常發佈即可。例如

/connections/opensocial/rest/ublog/urn:lsid:lconn.ibm.com:communities.community:7ee13563-a7d6-41f1-9fdb-e7eb979900e4/@all 

您確實需要有發佈給社區的權利,不用說了。

+0

是的,這工作,謝謝! – mpjjonker

相關問題