根据以下链接 using the v2 box api: how do I get a user id
电子邮件应该作为协作的ID工作,但是当我尝试将其与电子邮件ID一起使用时,它会因以下错误而失败,并且当我使用帐户ID时它可以正常工作
请注意我已在回复中替换了实际的电子邮件ID
{
"type": "error",
"status": 404,
"code": "not_found",
"context_info": {
"errors": [
{
"reason": "invalid_parameter",
"name": "id",
"message": "Invalid value '<my email id>'. 'id' with value '<my emmail id>' not found"
}
]
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "183660525751e95b3044f1d"
}
答案 0 :(得分:0)
问题出在您发送的JSON中。目前你有:
{
"item": {
"id": "YOUR_FOLDER_ID",
"type": "folder"
},
"accessible_by": {
"id": "YOUR_EMAIL"
},
"role": "editor"
}
如果您使用的是电子邮件地址而不是用户ID,则应使用login
属性,即
{
"item": {
"id": "YOUR_FOLDER_ID",
"type": "folder"
},
"accessible_by": {
"login": "YOUR_EMAIL"
},
"role": "editor"
}