Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate shared link and remove default expiry date (overwrite enterprise admin defaults) #424

Closed
eirerocks opened this issue May 1, 2019 · 3 comments
Labels

Comments

@eirerocks
Copy link

Description of the Issue

Background: Shared Link expiry is set for all new links at enterprise level by Admin and cannot be switched off.

Problem: I need to auto generate new shared links from my python app with no date expiry but having issues trying to pass a null value in 'unshared_at' field.

When I pass "unshared = None" as suggested in forum the shared link is created but it still pulls the default expiry settings from the tenant level, instead of removing the expiry.

refer to developer forum post:

Versions Used

Box Python SDK: 2.3.2
Python: 3.7.3

Steps to Reproduce

  1. set default shared link expiry of 90 days in enterprise admin console
  2. generate a new shared link using python sdk and attempt to remove shared link expiry date
  3. check if new shared link has an expiry date

Error Message, Including Traceback

No error, the link is created but the admin console setting is superseding the unset value in unshared_at field.

I have tried a few iterations of null, 'is null', "Null" , 'null', None, "None" etc but no luck

sharedLinkURL = sa_client.folder(folder_id=sharedFolderID).get_shared_link(access='collaborators', unshared_at=None)

I have tested using postman (curl export below) and it is possible to do this using simple https request:

curl -X PUT \ <a href="https://api.box.com/2.0/files/<file_id>\" target="_blank">https://api.box.com/2.0/files/<file_id>\</a> -H 'Authorization: Bearer <access_token>' \ -d '{"shared_link": {"access": "Open", "unshared_at":null}}'

@carycheng
Copy link

Hey @eirerocks,

We are working on this issue now and will update you, thanks!

@carycheng
Copy link

Hey @eirerocks,

We have a fix for this issue here #425, this will go out with our release next week, thanks for catching this!

@eirerocks
Copy link
Author

Hey @carycheng ,

Thanks for update. I have re-tested now in my project with the latest SDK (boxsdk==2.4.1) and the unshared_at=None is now working as expected.

Thanks for your help with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants