Hello @Shadi Rashed,
Thank you for reaching Microsoft!
I attempted the PATCH request for drive/{drive-id}/items/{item-id} and was successful in moving the file. Refer to the screenshots provided below:
The screenshot below displays the parent reference ID of the CIPost.docx document before using move file Graph API.
The screenshot below indicates that the document has been renamed and transferred to a different folder using Graph API.
I suggest you recheck the id and also If a file with the same name already exists in the target directory, you might need to handle conflicts by setting the conflictBehavior
parameter to replace
or rename
.
Documentation reference: https://learn.microsoft.com/en-us/graph/api/driveitem-move?view=graph-rest-1.0&tabs=http
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".