Skip to main content

Is there any way to differentiate file locks created with an OAuth2.0 Application

  • Jun 11, 2024 12:52 PM UTC
  • 2 replies
  • 300 views
  • Translate All

Is there any way to differentiate the two types of file locks, as explained below??

  1. A user can manually lock a file.
  2. A user can click the custom application’s web-integration and it can lock the file using BOX-APIs.

I have a custom application with OAuth2.0 and Web Integrations.
OnClick of a web-integration, I use node-sdk (Initialised with user’s auth-code) to lock the file.

Later, I used the search API to get all files in the folder., Is there any way to identify the files locked via my application, using NodeSDK?

I want to unlock them only, if it is locked by the application itself.

I couldn’t find anything to achieve this. Can you help me find a workaround for this?? Is there any fields in lock object, that i can re-purpose for this use-case?

Thanks, Sarin

2 replies

  • Author
  • Known Participant
  • Jun 13, 2024 12:11 PM UTC

Hi @ostefaniuk, @smartoneinok @pchristensen @rbarbosa,

My apologies for tagging you here, but I need your help on this.
Please help me resolve this tricky situation.

Thanks, Sarin

Translate

pchristensen Box
  • Senior Staff Platform Solutions Engineer
  • Jun 17, 2024 8:20 AM UTC

Hi Sarin

As far as I can see there is no info on the lock object itself that would give this information. There is an “app_type” attribute on the lock object but this is only populated then apps such as office online or google workspace locks it - not when a user manually locks it. The event stream will give you information of each lock created and which app created it (this would be in additional details). You could utilize this or you could keep track external to Box as part of your app…

Rgds,
Peter

Translate