1
我剛剛閱讀了關於更新狀態消息的Lotus Connection API手冊(來源:http://www-10.lotus.com/ldd/lcwiki.nsf/dx/Updating_a_status_message_ic301),但是我沒有找到 關於如何更新用戶狀態消息的示例腳本?如何將用戶狀態消息更新到IBM Connections(Lotus連接API)?
我做了一個基本的Ruby腳本。見下:
url = "https://w3-connections.ibm.com/profiles/atom/mv/theboard/entry/status.do?userid=#{username}"
auth = 'Basic ' + Base64.encode64("#{username}:#{password}").chomp
message = '<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text">Hi!</title>
<category term="entry" scheme="http://www.ibm.com/xmlns/prod/sn/type" />
<category term="status" scheme="http://www.ibm.com/xmlns/prod/sn/message-type" />
<content type="text">Morning! Have a nice day ahead!</content>
</entry>'
resource = RestClient::Resource.new(url, { :headers => { 'Authorization' => auth } })
response = resource.put message, :content_type => 'application/atom+xml'
puts response.inspect
我在Ruby中使用RestClient(rest-client(1.6.7))進行HTTP身份驗證。 但是,它沒有按照我的預期工作。錯誤說「... 400錯誤請求(RestClient :: BadRequest)」
有什麼我失蹤了嗎? 從你們任何幫助/想法將不勝感激。謝謝!
您是否嘗試過使用基於瀏覽器的休息客戶端?這將允許您在發送請求之前確認瀏覽器中的身份驗證成功。 – 2013-04-26 08:59:39
查看IBM Social Business Toolkit:http://www-10.lotus.com/ldd/appdevwiki.nsf/xpViewCategories.xsp?lookupName=IBM%20Social%20Business%20Toolkit%20SDK%20documentation – 2013-04-26 16:21:41