添加上传到skydrive的文件评论 [英] Add comment on file uploaded to skydrive
问题描述
我正在尝试使用rest为文件添加注释。
I'm trying to add a comment to a file using rest.
文件上传工作正常。我得到了fileId。
File upload works fine. And i get fileId back.
我使用这个API为我上传的文件添加评论https://apis.live.net/v5.0/file.8790c2f546dba19a.8790C2F546DBA19A! 639 /评论
I use this API to add a comment to a file i uploaded https://apis.live.net/v5.0/file.8790c2f546dba19a.8790C2F546DBA19A!639/comments
Json评论 : {" message":" Comment"}
Json Comment : {"message":"Comment"}
Ouath令牌是很好,因为我可以使用相同的令牌上传文件。我从服务器获得的回复是:
Ouath token is fine, since i can upload a file with the same token. The response i get from the server is :
{
"错误":{
    "code":"resource_locked",
    " message":"评论无法添加到此项目,因为未对此资源启用评论。"
}
}
{
"error": {
"code": "resource_locked",
"message": "The comment couldn't be added to this item because commenting isn't enabled for this resource."
}
}
我尝试了几种不同的文件:pdf,doc和png。我对所有人都有同样的回应。
I tried couple of different files : pdf, doc and png. I got the same responce on all of them.
我做错了什么?
推荐答案
来自文档:
http://msdn.microsoft.com/en- us / library / live / hh826524.aspx#creating_comments
"注意 除非关联资源,否则无法创建评论(例如,文件或照片)已经共享。"
"Note You cannot create a comment unless the associated resource (for example, the file or photo) is already shared."
您上传的文件是否已启用共享?
Do the files you uploaded have sharing enabled?
这篇关于添加上传到skydrive的文件评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!