Re: hydra and void

Hi Melvin,

> By payment processor, I mean more like a banking facility.  So the API provides:
> 
> Read functions:
> - Get balance (based on a URI)
> - Get transaction history (based on a URI)

So:

</user/345> <hasAccount> </user/345/accounts/5>.
</user/345/accounts/5> <hasBalance> </user/345/accounts/5/balance>.
</user/345/accounts/5> <hasTransactions> </user/345/accounts/5/transactions>.

Would that already help for the read part?

> From that triple (or triples) it needs to work out where are the APIs for balance, deposit etc.  Later on there will be more APIs such as trust scores and reputation for various URIs
> 
> So, I wonder can I say:
> 
> <:user>  <:hasProvider> <http://example.org>
> 
> then
> 
> <http://example.org> <:hasAPIDocs> <URL> .

So in a REST (meaning “hypermedia-driven”) API,
you don't really point to an endpoint or provider;
rather, you relate resources, as I have done above.

> So, if I've understood correctly, there's two parts
> 
> 1. The APIs
> 2. The hydra API description docs
> 
> If I find my way to (2), then the machine can work out where (1) is?

Each resource in the API could indeed link to those docs.

But more importantly, inside of each resource,
there are links to other relevant resources.
E.g., “the user has this account”
(rather than: “this is the user, read the API docs to find out how to get his accounts”).

Best,

Ruben

Received on Thursday, 30 October 2014 13:22:03 UTC