Obtaining sharing links
I am trying to use the package to create sharing links. I can successfully connect to my site and access folder and files but can't find the API to create a link. I've had a quick look through the functions and classes in office365.sharepoint.files.file but I think I'm looking in the wrong part of the object model.
Apologies for posting questions on the issue tracker, but can you give me a pointer?
Hey, I am walking through the same issue. Did you find a solution?
I did not, sorry.
Thanks for the answer, I found a way to do it.
If you could post an example of the code, that would be fantastic!
I will prepare it in the next days
Hi,
although this is the relatively old thread, but in case if anyone stumble upon it, here is an example how to create a sharing link for the file:
ctx = ClientContext(site_url).with_credentials(user_credentials)
file = ctx.web.get_file_by_server_relative_url("Shared Documents/Archive/Report.xlsx")
result = file.share_link(SharingLinkKind.AnonymousView).execute_query()
print(result.value.sharingLinkInfo.Url)
A complete example could be found here and a few more examples could be found in examples section.