Forum Discussion

ericmugnier's avatar
ericmugnier
Copper Contributor
Oct 30, 2024

How to move item specifying @microsoft.graph.conflictBehavior

Hello,

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

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



import requests
import json
requests.patch(
'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 locaiton.

 

Any idea ?

 

Thanks

No RepliesBe the first to reply

Resources