2014-02-20 35 views
0

在Brightcove公司網站的例子提供更新標籤在我的圖書館特定視頻所需的JSON:有沒有編輯Brightcove視頻參考ID的編程方式?

{"method":"update_video","params":{"video":{"id":"123456", 
    "shortDescription":"vidDesc","Name":"vidName","startDate":1392912992000, 
    "endDate":null,"tags":["tag1","tag2","tag3"]},"token":"someToken.."}} 

我已經試過這一點,它的工作原理。

但是,當我嘗試發佈相似,但有一個更新的參考ID的東西,像這樣:

{"method":"update_video","params":{"video":{"id":"123456", 
    "shortDescription":"vidDesc","Name":"vidName","startDate":1392912992000, 
    "endDate":null,"referenceId":"newReferenceId","token":"someToken.."}} 

我得到這個錯誤從服務回:

{"error": {"name":"MissingJSONError","message":"Could not find JSON-RPC.", 
    "code":211}, "result": null, "id": null} 

我試過路過它也是ref - 沒有骰子。有誰知道是否可以通過Brightcove的門戶網站以外的任何方式更新此值?

回答

2

確保您將JSON作爲表單數據發送,而不是發送到郵件正文中。

例如與捲曲,

curl -F 'json={"method":"update_video","params":{"video":{"id":"123456789","referenceId":"newrefid"},"token":"myToken"}}' https://api.brightcove.com/services/post 
+0

偉大的工程。感謝分享 – kieste

+0

如果你的JSON文件在一個文件中,你必須使用'curl -F'json =