I have a scenario where:
I have a REST API to manage resources, for instance
workspaces. This REST API is closed in the sense that cannot be altered.I want to CRUD
workspacesbut save additional information about them, which the main REST API does not support.So, i create another REST API, call it client API, which CRUDs
workspacesin the main REST API and saves additional information in a database.Important to note that there's no other clients using the main REST API, that is, there's no sync problems.
My issue is what's the best way to keep integrity between workspaces in the main REST API and workspaces that live in the client REST API?
As an example, to create a workspace, there's POST /workspaces in the client API which:
1 - Create a workspace in main REST API.
2 - Create a workspace in client database.
If step 2 fails, i have a created workspace in the main REST API and not in the client database.
What's the best approach to tackle this?
workspacein the vendor API and them save workspace id and additional data in my database). 2 - I mean it's a vendor software which i cannot modify. I cannot enhance the vendor API. 3 - 2 answer that if i correctly understood. 4 - Yes, only my API interacts with the vendor software. By clients i mean my API.