1
votes

I use rest api "https://api.onedrive.com/v1.0/drive/root/view.delta?token=***" "reference page" to get oneDrive files changes, it work for add file or folder or delete, but i need to get old path and new path for move, and get old name and new name for renamed file or folder.

Is there any way to get the rename and move changes?

1
as far as I understand you can navigate through the changes within a folder (e.g. with @odata.nextLink ) - so it should be theoretically possible to determine changes of a file (e.g. in one state file with ID=111 has name 'a' then in next state file with ID=111 has name 'b' => a rename was done) and so on. - Ovidiu Dolha
@OvidiuDolha Thanks for your answer but it didn't help me because the 'view changes api' returns "@odata.deltaLink" and not return the old and new changes , just return the new change. - Abd

1 Answers

3
votes

The API doesn't return / track the old-state of items.

To accomplish this, you need to maintain that state in a cache by tracking items with their unique identifier. You can then process the changes coming from the delta API, and when the change record is returned to you, you can evaluate your current state vs. the new state provided by the delta API, and use that to have the old-name and new-name, or old-path and new-path.