Skip to content

What is the correct usage of suppress notifications feature in Java SDK? #972

Description

@kmazurek93
  • I have checked that the SDK documentation doesn't solve my issue.
  • I have checked that the API documentation doesn't solve my issue.
  • I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
  • I have searched Issues in this repo and my issue isn't already reported.
  • I have asked assistance in Box Support, but they pointed me here.

Description of the Issue

Hello,

I have a Box App registered with notification suppressing feature enabled. I'd like to have this working using Box Java SDK specifically on file downloads.
Unfortunately even with correct permissions I'm getting 403/401 errors.
The sample code snippet, assuming that I have already created valid BoxAPIConnection object:

connection.suppressNotifications();
var file = new BoxFile(connection, "file_id_is_here"); //most probably 403 is returned on fetching this file data
// then download using file.getDownloadUrl()

I'd like to know about correct API/SDK usage, so please confirm if:

  • header will work when using new BoxFile(connection, "fileId") or
  • header will work only if we send it during the request to the URL got from BoxFile object boxFile.getDownloadUrl() or
  • header will work only if we send it during the call of GET /files/:id/content

It is worth mentioning, that after enabling required scopes, I did a reauth to the app as an admin user.

Steps to Reproduce

  1. Have an app with correct permissions set and suppressing notifications enabled.
  2. Create proper BoxAPIConnection object.
  3. Try abovementioned code snippet.

Expected Behavior

I'd expect to not get a 403 error on creating BoxFile/downloading file.
I'd expect file to download without e-mail notification.

Error Message, Including Stack Trace

I'm getting BoxAPIException with responseCode 403.

 Caused by: com.box.sdk.BoxAPIResponseException: The API returned an error code [403 | .0213727714915930b09b5704a89e3fd76] access_denied_insufficient_permissions - Access denied - insufficient permission.

Screenshots

N/A

Versions Used

Java SDK: 11+

Metadata

Metadata

Labels

questionAdded to questions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions