Share via

How to move item specifying @microsoft.graph.conflictBehavior

Eric Mugnier 0 Reputation points
2024-11-06T11:11:41.0733333+00:00

Hello,

I need to move items but need to set the @microsoft.graph.conflictBehavior to replace.

What I'm currently trying to do in python but doesn't set the @microsoft.graph.conflictBehavior strategy:

import requests
import json
requests.patch(
url='https://graph.microsoft.com/v1.0/drives/MYDRIVEID/items/MYITEMID?@microsoft.graph.conflictBehavior=replace',
data=json.dumps({'parentReference': {'driveId': 'MYDRIVEID', 'path': 'MYNEWPARENTLOCATION'}}),
headers={'Authorization': 'Bearer MYTOKEN', 'Content-Type': 'application/json', 'Prefer': 'IdType="ImmutableId",bypass-shared-lock'}
)

 

This gives me error 409 conflict, but I want the replace to force the move of folder to its new parent location.

 

Any idea ?

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.