How best do you represent a bi-directional sync in a REST api?
Posted
by
Edward M Smith
on Programmers
See other posts from Programmers
or by Edward M Smith
Published on 2012-02-16T16:16:20Z
Indexed on
2012/03/20
5:39 UTC
Read the original article
Hit count: 405
Assuming a system where there's a Web Application with a resource, and a reference to a remote application with another similar resource, how do you represent a bi-directional sync action which synchronizes the 'local' resource with the 'remote' resource?
Example:
I have an API that represents a todo list.
GET/POST/PUT/DELETE /todos/, etc.
That API can reference remote TODO services.
GET/POST/PUT/DELETE /todo_services/, etc.
I can manipulate todos from the remote service through my API as a proxy via
GET/POST/PUT/DELETE /todo_services/abc123/, etc.
I want the ability to do a bi-directional sync between a local set of todos and the remote set of TODOS.
In a rpc sort of way, one could do
POST /todo_services/abc123/sync/
But, in the "verbs are bad" idea, is there a better way to represent this action?
© Programmers or respective owner