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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,975 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,129 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
351 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    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.