custom web api crud operations in sharepoint online in c# code without js and jquery is it possible

prashant sharma 21 Reputation points
2022-12-06T10:07:33.677+00:00

Hi @ZhengyuGuo can please help
custom web Api which Do CRUD operations in SharePoint online in C# code without js and jQuery is it possible or is it or not be so please let me know about it or with example it will be so great full of you

Microsoft 365 and Office Development Office JavaScript API
Microsoft 365 and Office SharePoint For business Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-12-06T16:57:42.58+00:00
    0 comments No comments

  2. Tong Zhang_MSFT 9,251 Reputation points
    2022-12-07T07:06:13.537+00:00

    Hi @prashant sharma ,

    According to my research and testing, you can use C# with REST API, here is an example about how to use C# make GET request:

    HttpWebRequest endpointRequest =  
      (HttpWebRequest)HttpWebRequest.Create(  
      "http://<site url>/_api/web/lists");  
    endpointRequest.Method = "GET";  
    endpointRequest.Accept = "application/json;odata=verbose";  
    endpointRequest.Headers.Add("Authorization",  
      "Bearer " + accessToken);  
    HttpWebResponse endpointResponse =  
      (HttpWebResponse)endpointRequest.GetResponse();  
    

    More information for reference: Complete basic operations using SharePoint REST endpoints

    Hope it can help you. Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.