Tenant ID is missing Path when trying to upload document to sharepoint

SirFaksalot 0 Reputation points
2023-07-20T18:25:31.7266667+00:00

Hi, I'm trying to upload document to sharepoint using microsoft graph php library. Last year it worked, and now it stoped working (don't know exact dates when it stoped working), after debuging it, i see the error "Tenant ID is missing Path". What does this mean ? And how can i fix this problem ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,935 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,152 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 29,031 Reputation points Microsoft Vendor
    2023-07-21T02:37:28.0233333+00:00

    Hi @SirFaksalot

    The process of uploading a file to SharePoint via Graph API involves sending a request to the SharePoint Graph API endpoint. Before sending a request to the SharePoint Graph API endpoint, the developer must authenticate and authorize the request using Microsoft's authentication mechanism based on OAuth 2.0 protocol. This involves obtaining an access token that allows the developer to access the required SharePoint site. You can follow the steps to  Register your App in Azure Portal

    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread

    Here is a similar issue with yours, please make a reference

    https://stackoverflow.com/questions/42936026/sharepoint-upload-file-contents-with-graph-microsoft-com-beta-and-php-cakephp


    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.