I am trying to add some data from a JSON file that has the same structure as a goal SharePoint list. I have previously checked that I can access the list with a get method and that I can authenticate and get the token. The problem is that I can't seem to figure out how to properly do the data upload.
Below is my simplified code
URL= 'https://graph.microsoft.com/vx.x/sites/sharepointname/sites/group/lists/listId/rows/add'
json_file = a pandas file converted to json
post_data = requests.post( URL,
headers={'Authorization': 'Bearer ' + token['access_token'], 'Content-Type': 'application/json'},
data = json_file
)
This does not work, some of the errors I got are "Resource not found for the segment \uxxxrows\uxxx." I would be very grateful for any help.