Attempting to update file info returns "invalid parameter" item error
回答済みHi there
When trying to move an item I send a request that updates the parent id of a file and it returns an error 404 with reason "invalid parameter" item. But there is no item parameter as far as I can see in the docs, it's also a value that I don't send: f_61412404350 which is the id of the file (a path parameter in this request) prefixed with f_. Is this something internal or am I supposed to send an undocumented item parameter?
{"type":"error","status":404,"code":"not_found","context_info":{"errors":[{"reason":"invalid_parameter","name":"item","message":"Invalid value 'f_61412404350'. 'item' with value 'f_61412404350' not found"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Not Found","request_id":"q3mbdefya6q6guoc"}
-
They're a test file and folder that are created in the line above with the same (only) access token. Any other idea? It can also be deleted again by this token the lines beneath it, given the same id so it appears to be a valid file id that I have access to.
Here's what postman echoes back to my PUT request:
{ "args": { "fields":"parent" }, "data": { "parent": { "id":"***number removed for privacy***98" } }, "files": {}, "form": {}, "headers": { "x-forwarded-proto": "https", "host": "postman-echo.com", "content-length": "31", "accept": "application/json", "authorization": "Bearer JrUalrqUxWB47Pb72dVA50SmEIATxDtA", "content-type": "application/json", "user-agent": "GuzzleHttp/6.3.3 curl/7.51.0 PHP/7.1.1", "x-forwarded-port": "443" }, "json": { "parent": { "id": "***number removed for privacy***98" } }, "url":"https://postman-echo.com/put?fields=parent" }
And this is what Postman echoes to the Box Content API "Move a File" postman collection request:
{ "args": {}, "data": "{\"parent\": {\"id\" : ***number removed for privacy***98}}", "files": {}, "form": {}, "headers": { "x-forwarded-proto": "https", "host": "postman-echo.com", "content-length": "34", "accept": "*/*", "accept-encoding": "gzip, deflate", "authorization": "Bearer JrUalrqUxWB47Pb72dVA50SmEIATxDtA", "cache-control": "no-cache", "content-type": "text/plain", "postman-token": "f85cf6c0-462a-41cc-b237-ae647809b577", "user-agent": "PostmanRuntime/7.4.0", "x-forwarded-port": "443" }, "json": null, "url": "https://postman-echo.com/put" }
-
Nevermind, while looking around in a function I use to make the request I discovered that the variables for both the id of the file to be moved and the id of the parent folder were the same resulting in me giving folder X, parent folder X, trying to move a folder inside itself.
The error that I got back could be improved I think, seems like internal stuff reported back to me.
サインインしてコメントを残してください。
コメント
5件のコメント