Issue Moving File via Microsoft Graph API with Make (Integromat)

KASUKURTI Monica 20 Reputation points
2025-01-21T17:28:44.53+00:00

Hello,I am currently facing an issue using the Microsoft Graph API to move a SharePoint file from one folder to another via Make (formerly Integromat)

Issue Details:

  1. Primary Issue:

   - When sending a PATCH request to the following endpoint:

     [https://graph.microsoft.com/v1.0/drives/b!RVgGByPwgEmkQUmDLMHRwyX_hDxbJvtGgO11BwNy9DJkcT7CHGvDTYdKQeXOXIoo/items/01YHHNUBZWA5532ISFLBA244NDKEESNJ6I](https://graph.microsoft.com/v1.0/drives/b!RVgGByPwgEmkQUmDLMHRwyX_hDxbJvtGgO11BwNy9DJkcT7CHGvDTYdKQeXOXIoo/items/01YHHNUBZWA5532ISFLBA244NDKEESNJ6I)

   - I receive the following error response:

   ```json

   {

       "error": {

           "code": "BadRequest",

           "message": "Empty Payload. JSON content expected.",

           "innerError": {

               "date": "2025-01-21T15:02:40",

               "request-id": "d9d1fc2d-e30b-4c9c-adca-1432ad36ad9c",

               "client-request-id": "d9d1fc2d-e30b-4c9c-adca-1432ad36ad9c"

           }

       }

   }

   ```

  1. Steps Taken:

   - I have confirmed that the Make module has the necessary permissions to perform file operations.

   - I have manually obtained a Graph API Bearer token and attempted the same request using a standard HTTP module in Make.

   - Despite granting admin consent in Azure Portal and assigning necessary app permissions, I still receive the following error when using the HTTP module:

   ```json

   {

       "error": {

           "code": "AccessDenied",

           "message": "Either scp or roles claim need to be present in the token.",

           "innerError": {

               "date": "2025-01-21T16:43:28",

               "request-id": "3d18667b-05bb-4c97-b91a-070586c439a0",

               "client-request-id": "3d18667b-05bb-4c97-b91a-070586c439a0"

           }

       }

   }

   ```

  1. What I Have Tried So Far:

   - Verified and granted the necessary permissions (Files.ReadWrite, Sites.ReadWrite.All) in Azure Portal.

   - Ensured that the token contains the required scopes but still facing the issue.

   - Followed the official documentation for moving files:

     [Move File via Graph API]

     [Access Token Guide]

Could you please assist me in identifying what might be causing this issue? Specifically, I need guidance on:

   - Ensuring the token contains the correct scp or roles claims.

   - Troubleshooting the "Empty Payload" error despite passing a valid JSON body.

   - Any specific configurations required in Azure to enable file moving operations via Make.

Thank you for your support.

Best,

Monica

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,880 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,887 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,228 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 1,245 Reputation points Microsoft Vendor
    2025-01-22T02:55:45.0866667+00:00

    Hi KASUKURTI Monica,

    Thanks for reaching out to Microsoft!

    As per the documentation, I am able to move the file to another folder using the MS Graph API:

    PATCH /drives/{drive-id}/items/{item-id}.

     with request body:

    {
      "parentReference": {
     
        "id": "{new-parent-folder-id}"
      },
      "name": "new-item-name.txt"
    }
    
    

    User's image

    After successful execution of above Graph API, file has been moved to new location.

    Ensure that the token you're using includes the required scopes. For moving files, application permissions add the necessary - Files.ReadWrite.All scopes. Grant admin consent for the permissions.

    You can check the scopes included in your token by decoding it using a tool like jwt.ms.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


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.