Best way to consume Third party rest api | Adobe Higher Education
Skip to main content
Level 2
June 8, 2016
Respondido

Best way to consume Third party rest api

  • June 8, 2016
  • 4 respostas
  • 3454 Visualizações

What is best method to use third party rest api. According to me there are two ways.

Approach 1. Make JavaScript Ajax Calls to consume the REST API.
Approach 2. Use a HttpClient on the OSGI Service Layer to consume these services.

What is they best way and why. Can you please help. 

Este tópico foi fechado para respostas.
Melhor resposta por stevec2515680

Back end is the way to go as you have much better control with Java/OSGi. Use front end to display the data. 

There is a sample package and article for this use case: 

https://helpx.adobe.com/experience-manager/using/restful-services.html

This will point you in the right direction. 

4 Respostas

kautuk_sahni
Community Manager
Community Manager
June 8, 2016

Hi 

It really depends on the use-case we are trying to achieve.

Front-End

1. Load on server reduces.

2. Number of hops to the data reduces.

3. If we are using public api's.

 

Back-End

1. Can be more Secure 

2. If authentication is needed them Back-End is considered.

3. If we are calling same API's over and over, then we can save/cache the data (caching) and revert immediately.

4. if we need to change/validate the data so Back-end is used.

 

Article:- http://programmers.stackexchange.com/questions/229079/should-the-views-or-front-end-server-call-the-restful-api-layer

 

I hope this will answer your problem.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Level 4
June 8, 2016

Back end is the way to go as you have much better control with Java/OSGi. Use front end to display the data. 

There is a sample package and article for this use case: 

https://helpx.adobe.com/experience-manager/using/restful-services.html

This will point you in the right direction. 

smacdonald2008
Level 10
June 8, 2016

I agree with Steve - Approach 2 is far better way to consume a 3rd party Restful service. 

Level 2
August 31, 2022

The URL in these answers really need to be updated. There's a lot of old accepted solutions here with dead documentation links.