How to make an HTTP POST request TO SharePoint

Brendon Browning 6 Reputation points
2022-04-23T20:39:39.86+00:00

First of all, let me apologize! I recognize this is basic stuff. But I am literally brand new to all of this, and I don't know anything about SharePoint. A colleague and I are actually working on a game (an online version of a board game). My colleague has been collecting a large amount of data for this board game and is using SharePoint and Power BI to display data to a website. We would like to incorporate functionality into the game script that will send statistics to his SharePoint for each game played. (Here is his website in case it would be helpful to see https://www.smashupdata.com/)

The game "engine" is called Tabletop Simulator (through Steam), which allows designers and users to create mods to simulate board games. The mods are all written in Lua Script (no compiling), so anything I put into the mod will be potentially visible to users, so I wouldn't want to include anything that could potentially cause harm (like a username/password, etc).

The Tabletop Simulator has a class called "WebRequest" with a "post" method that requires 2 parameters: a url and the form to send.

First I just want to know if it is possible to send data to SharePoint this way, or to Power BI even, and if it can indeed be done in a way that is unable to cause harm.
Second, what would I use for the URL? Is there a specific SharePoint API that would be referenced with an ID that directs to his SharePoint? Would my colleague's SharePoint have a URL directly?

Thank you very much for your time and help!

Microsoft 365 and Office SharePoint Development
{count} vote

1 answer

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,251 Reputation points
    2022-04-25T07:31:52.877+00:00

    Hi @Brendon Browning ,

    According to my research and testing, you can use REST API to make POST request to SharePoint site.

    For reference:
    https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service?tabs=csom
    https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-rest-endpoints


    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.