How to create Web API project to retrieve Sharepoint Online list and result in JSON format

THM THM 1 Reputation point
2020-12-13T05:43:34.983+00:00

Hi I am new to API project with Sharepoint Online (MFA) to retrieve list items and result in JSON format. I want to ensure i am on the right track by using either WebAPI or Webservices in Visual Studio. or any other suggestions?

Is there an project example with a step by step reference ?

Thank you.

Developer technologies ASP.NET ASP.NET API
Microsoft 365 and Office SharePoint For business Windows
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2020-12-14T05:51:31.897+00:00

    Hi @THM THM ,

    For SharePoint Online MFA enabled Tenant, it's suggested to use App-Only authentication with CSOM code to connect with SharePoint Online list:

    Connect To SharePoint Online Site With App Only Authentication

    For building the custom web API to connecting with SharePoint Online, here is a complete example for start:

    Building a Custom Web API for use with SharePoint Online


    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.


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.