Where to find file_id for download with box-node-sdk
回答済みI know this is a really dumb question but I cannot find a clear answer: what is a file_id? If I get a shared link for one of my files I see this:
https://---.box.com/s/w6623rvaz36xucb0jlmukio5zyk6se97
Is w6623rvaz36xucb0jlmukio5zyk6se97 the file_id? Or is it found somewhere else? The file properties does not show a file_id field. If I use the string above to download in a file in box-node-sdk I get a "not_found" error.
Postman:
localhost:5000/boxapi/file/w6623rvaz36xucb0jlmukio5zyk6se97/
Node Server boxapi.js:
"statusCode": 404,
"body": {
"type": "error",
"status": 404,
"code": "not_found",
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "w7aivvg0fg1n54or"
},
-
Hi !
Not a dumb question at all 🙂 You're really very close. A file ID is a numeric identifier for a file, unique across all of Box. The shared "hash" in a shared link is technically also a type of ID in the sense that it's a unique identifier for an item, but it's not the actual file ID.
To get the file ID, try this method:
https://github.com/box/box-node-sdk/blob/master/docs/shared-items.md
It'll return a numeric file ID, assuming that the link is either open or your user has access to the item via a collaboration.
If you want to see an example of what the base API call looks like (and the response), check out this section:
https://developer.box.com/reference#get-a-shared-item
A sample response is on the right hand side. Hope that helps!
Thanks,
Jason
サインインしてコメントを残してください。
コメント
1件のコメント