After various difficulties, requests to the RetrieveDuplicates WebAPI finally work ... at least in principle.
For example, this request runs without errors and returns either an empty array or duplicates, if there are any:
https://<URL>/api/data/v9.2/RetrieveDuplicates(MatchingEntityName='account',BusinessEntity=@BE,PagingInfo=@PI)?@BE={"@odata.type":"Microsoft.Dynamics.CRM.account","name":"ABC (123)"}&@PI={"Count":10,"PageNumber":1,"PagingCookie":null}
But as soon as the requested account name is like "ABC (123) X" I get a BAD REQUEST error. What are I'm doing wrong, or is it a bug in the WebAPI?
Interestingly one of my first difficulties with this API was that I got BAD REQUEST but only if the account name contains brackets. Later I figured out, that the order of the json values of the business entity parameter matters.
While
@BE={"@odata.type":"Microsoft.Dynamics.CRM.account","name":"ABC (123)"}
was working,
@BE={"name":"ABC (123)","@odata.type":"Microsoft.Dynamics.CRM.account"}
did not.
Now, with the "correct" order of the entity values, the request is still failing, if the account name has more characters after the closing bracket and I have no clue what to try next.
Any help is greatly appreciated, even a statement that this is a bug in the API would be of help, obviously.