-
Notifications
You must be signed in to change notification settings - Fork 10
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
Getting password protected sharing link with expiry date #16
Comments
Sharing link functionality differs between personal OneDrive and organisation OneDrive (work/school accounts). It seems that you are wanting to create a password protected link for an organisation which is not possible:
For personal accounts you can use: {
"type": "view",
"password": "1234",
"scope": "anonymous"
} For organisation accounts the process would be to first create a sharing link, and then grant permissions to specific users. I will look at this in more detail and carry out some testing. |
Okay , then could you please add one functionality which generates sharing link for the organisation onedrive which should have edit or view option. Thanks |
I have drafted this feature, refer to the branch sharing-links. You can test and use this development build by installing the branch directly: pip install https://github.com/dariobauer/graph-onedrive/archive/sharing-links.zip Please let me know if you experience any issues. |
This has been merged into main and will be in the next release. You can use the development version before then if you are so inclined: |
Hi @dariobauer I have already given all the permissions in my azure AD as per the permissions given here I am testing this from a work account. please let me know whether I am getting item not found error by doing some mistakes in calling the API or I am missing something in Microsoft Azure App. Thanks |
This error can occur due to several reasons. Most likely your work is blocking "anonymous" links, unfortunately the Graph API returns "item not found" in this instance, so this is noted in the docs. You can check this by going to the website and manually creating a sharing link, there you will see "Anyone with the link" has been disabled by your organisation. Try specifying the scope: my_drive.create_share_link(item_id="01H56XG2DAWFPVXRN6T5FYXDJRVYZ2WRBA", scope="organization")
I have not yet added permissions methods as there are several so will take some time to add. |
Yeah Thanks , its perfectly working for personal Accounts. but I am still getting FileNotFound for Work Account as I provided scope: "organization". |
Can you please confirm:
|
yeah sure
If I am trying to make a post request on graph explorer then there also I am getting 404 response as fileNotFound. |
I cannot reproduce this issue (sharing a file Can you please try the following steps:
If you get a |
Yeah Its not the issue of python packages. |
Hi @dariobauer and @Shub77
I tried to implement an addition feature for getting a password protected sharing link of DriveItem but the post request I had created with the help of this link is not able to get the item using its item_id as it is returning fileNotFound in its response_data.
here is my code, please improve it or add the feature mentioned above.
` @token_required
def get_sharinglink(self, item_id: str):
Thanks
The text was updated successfully, but these errors were encountered: