The SharePoint adapter provides a method with which a ClientContext can be created.
You can specify the URL and login data in the IYOPRO.SHAREPOINT.config. If no login data are specified, access is carried out as a service user.
You can find more information on the usage under the following links:
API: https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee538685(v=office.15)
Syntax
public class Adapter : IDisposable
Members
Adapter() |
The constructor |
|
ClientContext GetContext(string url) |
Get the client context for the specified URL |
|
void Dispose() |
Releases the resources used |
Sample
This sample is the Python version of the example found via the link above and gets the title of a SharePoint website.
import clr
clr.AddReferenceToFileAndPath(Session.GetAdapterPath("IYOPRO.SHAREPOINT"))
from IYOPRO.SHAREPOINT import *
with Adapter() as sharepoint:
ctx = sharepoint.GetContext("<URL>")
web = ctx.Web
ctx.Load(web)
ctx.ExecuteQuery()
print web.Title