How does Apigee supports hypermedia/HAL ?

Hi all,

I want to know how can Apigee handle hypermedia APIs. Especially I am interested in learning more about how can Apigee handle HAL ? What all support does Apigee provides ?

How will I proxy those APIs , create products out of them and finally document them ?

Thanks

Sarthak

Solved Solved
3 6 473
1 ACCEPTED SOLUTION

Ok lets see

1. Apigee is format agnostic, but it provides certain capabilities for application/xml, application/json [for transformations]-- so am not sure if it will handle application/hal+json the same way as json. You might have to modify headers in apigee to do [xml to json] or [json to xml]

2. To replace URIs in the response, you could javascript or regex

3,4. Smartdocs/Products would still be the same how you would do for any other APIs - so we should look at API product best practices

View solution in original post

6 REPLIES 6

It depends on whether you are trying to build or proxy an existing API,

Apigee is format agnostic, If you are proxying an HAL api, then, i think, all you have to do is point all your href's to Apigee, so you could proxy all the links and relations. As you know, you could easily do this in Apigee,

If you are building a API from ground up, its even easier - you could use node to build HAL APIs

Ok let me be more specific :

Lets say I am building a proxy of an existing API. The backend is sending the URIs in the payload. How can Apigee rewrite the base paths of the URIs ? Or that needs to handled at the backend ? If the content type is application/hal+json will Apigee handle it any differently than an application/json content type ?If I want to do json to xml or xml to json with the HAL payload will Apigee be able to handle it OOB ?

Also most importantly how do you create Products for HAL APIs ? Any best practices ?

How do you document the APIs ? Does smartdocs support HAL ?

Sarthak

Ok lets see

1. Apigee is format agnostic, but it provides certain capabilities for application/xml, application/json [for transformations]-- so am not sure if it will handle application/hal+json the same way as json. You might have to modify headers in apigee to do [xml to json] or [json to xml]

2. To replace URIs in the response, you could javascript or regex

3,4. Smartdocs/Products would still be the same how you would do for any other APIs - so we should look at API product best practices

Ok lets see

1. Apigee is format agnostic, but it provides certain capabilities for application/xml, application/json [for transformations]-- so am not sure if it will handle application/hal+json the same way as json. You might have to modify headers in apigee to do [xml to json] or [json to xml]

2. To replace URIs in the response, you could javascript or regex

3,4. Smartdocs/Products would still be the same how you would do for any other APIs - so we should look at API product best practices

Is there anything specific to HAL or hypermedia in general which Apigee supports for documentation ? I am thinking like http://audreydemo.aws.af.cm/hal-browser/#/ . Is there anything similar to this that can be done using Apigee ?

Can I define HAL using swagger ?

Does apigee support URL rewriting in context of hypermedia in the payload...I this sarthak has asked this but i am not able to find a reply to the question specifically...Can we assume we can do the coding required to rewrite the URLs but nothing is provided out of box

THanks

Vijay