GSOC 2019: OpenMRS Atlas 3.1

A good RESTful API works with resources (nouns) and not methods (verbs). Since “ping” is a method/action, it doesn’t fit in a RESTful API. While you can approach this using reification - e.g., creating a MarkerUpdate resource that can track the updating of a marker – that’s more useful for long-acting or multi-step workflows.

I would suggest simply supporting an empty body to PATCH /markers/:id (i.e., sending either nothing or an empty object { }) as a mechanism to simply change the date changed (would need to be authenticated and have edit rights to the marker, of course). Since the response should be the updated resource, it would give the client exactly what it needs to update the resource locally.

1 Like