Sharepoint APIs fro declaring a record using retentionLabels

Karri Jagadeeswara Reddy 21 Reputation points
2021-06-09T10:01:17.21+00:00

For Sharepointonline (SPOnline CSOM 16.1 ver), we were able to get labels using CompliancePolicy.SPPolicyStoreProxy::GetAvailableTagsForSite api. These calls will not work for Onpremisis(SP2019).

Do we have any Apis for SP OP?  Using SP2019 CSOM version(16.0) has no related apis to get labels. Cant find any documentation for onpremisis around labels/retention. Everything is talking abt online.

Also, should the above complaince API even be used for Online? as this below post suggests it should not be used from API.
https://techcommunity.microsoft.com/t5/microsoft-sharepoint-blog/scripted-application-of-data-governance-labels/ba-p/242412 (under commnets section)

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,971 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,608 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,031 Reputation points
    2021-06-10T08:23:59.35+00:00

    Hi @Karri Jagadeeswara Reddy ,

    There is no such api for SharePoint onpremise. Applying SharePoint Retention Labels Programmatically is only availabel in SharePoint Online.

    For SharePoint Online, I did a test on my end and it worked. I would suggest you test in test environment, then appy it in pro environment.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.