Cannot execute PUT /api/trackedEntityInstances/{tei}/potentialDuplicate

Hi there,

I found few TEIs marked as potential duplicates. Although the records consists only one teiA as shown below:

{
      "lastUpdated": "2021-10-19T16:20:28.646",
      "created": "2021-10-19T16:20:28.646",
      "id": "PTfXXgP0Vo9",
      "teiA": "VvjPGc6fyM9",
      "status": "OPEN",
      "lastUpdatedBy": {
        "displayName": "userName",
        "name": "userName",
        "id": "HmHGTJES06Z",
        "username": "userName"
      }

So as long as there are no teiB, I have decided to update the flag by executing

PUT http://serverAddress:port/api/trackedEntityInstances/VvjPGc6fyM9/potentialDuplicate

command. But failed as shown below:

<body>
	<h1>HTTP Status 404 – Not Found</h1>
	<hr class="line" />
	<p><b>Type</b> Status Report</p>
	<p><b>Description</b> The origin server did not find a current representation for the target resource or is not
		willing to disclose that one exists.</p>
	<hr class="line" />
	<h3>Apache Tomcat/9.0.67</h3>
</body>

Have tried to send the “flag” parameter as payload {"flag": false} and just part of uri ?flag=false.

Could anyone tell me how I can unflag the TEIs by using this API point?
I am using DHIS 2.36

Thank you
Regards, Ulanbek

Hi @Ulanbek

Thank you for your post! I’m trying to understand…

Where are they marked as duplicates? Does clearing the server cache, Data Administration app → Maintenance, not solve the issue?

If does say in the docs:

To update a potential duplicate status:

```PUT /api/potentialDuplicates/<id>```

(source)

Maybe if you try the /potentialDuplicates endpoint?

Hello @Gassim ,

Thank you for your reply. I have found all those TEIs marked as potential duplicates on GET /api/potentialDuplicates endpoint. I have tried to clean the server caches, but it doesn’t help much.

Where are they marked as duplicates? Does clearing the server cache, Data Administration app → Maintenance, not solve the issue?

I got the reason why I couldn’t - simply I read wrong documentation. So just used DELETE /api/potentialDuplicates/ endpoint and all duplicate records are now gone.

Thank you

2 Likes