2

In my SP Hosted App I have a list with 9 items. I deleted item 6 and 7 and changed item 9.

Next I ran the following REST in Postman:

https://mysitecoll-AppGUID.sharepoint.com/sites/developer2/MyApp/_api/Lists/
getbytitle('lstDoelen')/GetChanges?query={"__metadata":
{"type":"SP.ChangeQuery"}, "ChangeTokenStart":null, "ChangeTokenEnd":null,
"Move":true, "Restore":true, "Add":true, "Rename":true, "Item":true}

In the response however, only Changes of Type 1 (item added) appear, all 9 items. I would also expect 1 result of Change Type 2 (update) and 2 results of Change Type 3 (deleteObject) in the response.

I tried to add the "deleteObject":trueto the query in the URL, but then response says that "The property 'deleteObject' does not exist on type 'SP.ChangeQuery'. Make sure to only use property names that are defined by the type."

"deleteObject" however is listed in the SP.ChangeQuery property list on MSDN (link: click).

Also tried adding "Delete":true, which also is an invalid property...

How can I get this working? Thanks in advance for your assistance!

Update: adding "Update":true givens the expected Change Type 2 for the udated item. Still looking for a way to get the deleted ones :).

2
  • Try "'List'":true. Just a wild guess. Jan 28, 2015 at 18:59
  • Adding "List":true gives me 5 more results with Change Type 2 but non item related. Still no Change Type 3... Jan 28, 2015 at 19:08

1 Answer 1

2

The following error:

The property 'deleteObject' does not exist on type 'SP.ChangeQuery'. Make sure to only use property names that are defined by the type.

occurs since the query for getchanges operation is case sensitive.

Solution: replace deleteObject to DeleteObject

Example

url: https://contoso.sharepoint.com/_api/web/getchanges
method: POST
data:  {
    "query": {
        "ChangeTokenEnd": null,
        "ChangeTokenStart": null,
        "DeleteObject": true,
        "Web": true,
        "__metadata": {
            "type": "SP.ChangeQuery"
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.