Relative Content

Tag Archive for pythonsharepointms-wordmicrosoft-graph-apipowerpoint

How can I get the content of word file or a ppt file in sharepoint in python using ms graph api?

def get_file_content(access_token, site_id, drive_id, file_id): headers = { ‘Authorization’: f’Bearer {access_token}’, ‘Accept’: ‘application/json’ } # URL to fetch the file content graph_api_url = f’https://graph.microsoft.com/v1.0/sites/{site_id}/drives/{drive_id}/items/{file_id}/content’ response = requests.get(graph_api_url, headers=headers) if response.status_code == 200: return response.content else: response.raise_for_status() I have ms word file in this link: https://m365x36241825.sharepoint.com/:w:/s/Contoso/EfdVPx-4F85PoTiVi_vjqD0Bk2qXB_dwapVsC5t600YS-g?e=ejxhi6 which is opening file in ms word I have a […]