Ricardo,
Having one web app call a hypermedia web api when both pieces are
under your control and both trying to achieve the same goal is going
feel a bit weird. Using hypermedia to enable decoupling requires a
certain amount of overhead that is probably going to feel like
overkill when you control both ends of the wire.
As an aside, do you really need your web app to talk to your web api?
Could both products not share some other implementation component that
would avoid making that extra HTTP request within your own data
center?
Assuming you do have a good reason to add the extra layer, I see you
as having two choices:
a) Don't try and create any correlation between the two sets of
resources Build the hypermedia in the web app as if you were not
talking to a web api at all. Then consume your Web API to generate
the content for the web app. However, I suspect this approach is going
to feel very redundant.
b) Create a portion of the URI space in your web application that is a
function of of the Web API URI path. e.g. If you want to build a
resource that renders in HTML some content from content in your Web
API, then define something like
http://webapp.example.org/appviews/{apipath}
If your api uses query parameters, then you are going have to find a
process of merging query parameters from the api with query parameters
from the web app. You might just combine them and ensure that you
avoid duplicate names.
Darrel
On Fri, Apr 4, 2014 at 10:41 AM, Ricardo Kirkner