Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
References:
- https://gist.github.com/zplume/9f4c1a658517802701deff3473f23a60
- https://gist.github.com/zplume/21248c3a8a5f840a366722442cf9ee97
"NameConflictBehavior":0 = think means fail
"NameConflictBehavior":1 = think means replace
"NameConflictBehavior":2 = Rename at destination
Based on similar bejaviour at: https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0
"IsMoveMode":true|false = if true the source folder is removed, otherwise it remains (copy)
POST https://platinumdogsconsulting.sharepoint.com/sites/hubsitetest/_api/site/CreateCopyJobs
HEADERS
{
accept: application/json;odata=verbose
content-type: application/json;odata=verbose
}
BODY
{
"exportObjectUris":[
"https://platinumdogsconsulting.sharepoint.com/sites/hubsitetest/Shared%20Documents/Folder%202"
],
"destinationUri":"https://platinumdogsconsulting.sharepoint.com/teams/hubjoinedsite01/Archive",
"options":{
"IgnoreVersionHistory":true,
"IsMoveMode":true,
"AllowSchemaMismatch":true,
"NameConflictBehavior":2
}
}
RESPONSE
{
"d": {
"CreateCopyJobs": {
"__metadata": {
"type": "Collection(SP.CopyMigrationInfo)"
},
"results": [
{
"EncryptionKey": "6YIOwbP9/TSLiw6D0H+mvsiRbgjSvJLs5L28Pfx/0BQ=",
"JobId": "d0a42793-f995-4ce2-b0fb-cc3c0e819e19",
"JobQueueUri": "https://spodb1am1m025pr.queue.core.windows.net:443/1217pq20190522-d6b14cff5d28495b83e38b66e3c96c60?sv=2017-07-29&sig=PZQnN9zfInHrH8fbJkm7r77FeWJePHFyb4K6Q3GMmuA%3D&st=2019-05-21T07%3A00%3A00Z&se=2019-06-12T07%3A00%3A00Z&sp=rap",
"SourceListItemUniqueIds": {
"__metadata": {
"type": "Collection(Edm.Guid)"
},
"results": [
"208875e4-2659-433d-acd8-4d77fc76e1ef"
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.