Unable to get a successful response to API using JWT
AnsweredWe are developing an application which uses Box to store files in specific folder. Until now we were using the User Authentication and everything went smooth.
Recently we had switched to the Server Authentication (JWT), we had successfully authorized our app but were unable to upload or search a specific folder (by id) - an error was raised, 404 not found.
I've looked a bit in your community forum and it seems like we net to set some permissions somewhere...
Please advise how could we initiate successful calls to the BOX API using JWT. As mentioned, our main use-case is searching, uploading and deleting files/folders.
Original error:
boxsdk.exception.BoxAPIException: Message: Not Found Status: 404 Code: not_found Request id: xxxxxx Headers: {'Strict-Transport-Security': 'max-age=31536000', 'Cache-Control': 'no-cache, no-store', 'Content-Encoding': 'gzip', 'Vary': 'Accept-Encoding', 'BOX-REQUEST-ID': 'xxxxxx', 'Date': 'Mon, 19 Mar 2018 14:56:39 GMT', 'Content-Type': 'application/json', 'Age': '0', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive'} URL: https://api.box.com/2.0/folders/xxxxxx Method: GET Context info: {'errors': [{'reason': 'invalid_parameter', 'name': 'item', 'message': "Invalid value 'd_xxxxx'. 'item' with value 'd_xxxxx' not found"}]}
-
Hi — a 404 like this usually means that the user you're authenticated as does not have permission to view the item you're trying to see (in this case a folder). If you're authenticating via JWT, you might be running into the issue that the Service Account that you're authenticated as is not collaborated on the folder you're trying to view. Other users have had the same question, and there's a previous thread that has some detailed information about it. In general, if you're using JWT auth to authenticate as a Service Account or App User, those users do not have access to arbitrary folders in the enterprise by default — you'll need to ensure that the account has access by collaborating it, or you'll need to generate tokens to authenticate as a user who does have permissions to the folder.
Please sign in to leave a comment.
Comments
1 comment