我正在使用 Dropbox SDK for Javascript 并尝试为文件添加自定义属性:
var fetch = require('isomorphic-fetch');
new Dropbox({
fetch: fetch,
accessToken: '...'
})
.filePropertiesPropertiesAdd({
path: '/wallpapers/WhatsApp Image 2018-12-31 at 20.55.09.jpeg',
property_groups: {
'template_id': '...',
'fields': [
{
'name': 'Theme',
'value': 'Animais'
},
{
'name': 'Author',
'value': 'Ana Flávia'
}
]
}
})
.then(this.successMeta).catch(this.errorMeta)
但是我收到了这个错误:
"Error in call to API function "file_properties/properties/add": request body: property_groups: expected list, got dict"
最佳答案
显然他们希望 property_groups 是一个列表(Python 中的数组)并得到一个 dict(Python 中的对象)
将值更改为数组,它应该按照调试消息正常工作
关于javascript - Dropbox API : Error when adding custom properties to a file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54515896/