One Star BCG
One Star

Talend Rest API

Hello, I am trying to use Talend to call an internal REST api. This internal Rest API consumes and JSON input and returns JSON output. I am trying to see if there is a sample how to setup Talend to call our internal API. I don't want to sit define the output columns etc. Talend should just return the payload what ever it get from the Internal API call. On the Request I can define the JSON input in Talend and hope it gets passed.
Has any one done this kind of a thing. If you can point me to a link or give a step by step process to do this will be appreciated. FYI I am new to Talend.
4 REPLIES
One Star

Re: Talend Rest API

Hello
please follow any reasonable tutorial (https://www.talendforge.org/tutorials/tutorial.php?idTuto=104) just instead of parsing and mapping individual fields, you pass the "payload" field (typed as "Document")

tRESTRequest -> tRESTClient -> tRESTResponse
                              |_ on failure -> tRestResponse

g.
One Star BCG
One Star

Re: Talend Rest API

Gabriel, thanks for the reply.  I tried your option and it worked. Thanks. I guess there is a bug or something in Talend, I was getting errors, and some one had posted as I search in google that in the tRESTClient the accept type should be set to any. When I change that JSON it did not work. I will try again later with that option, but for now I am good.
Thanks for your help
One Star BCG
One Star

Re: Talend Rest API

Help in implementing REST API. I am using the free ESB download. I have built a successful REST API, thanks to Gabriel's direction got this to work. Now how do I implement this? I read some articles but not very clear. When I do the build job, I have to build it as OSGI bundle. I am supposed to take this OSGI bundle and deploy using the Runtime ESB. My questions are:
1) When I installed ESB, I have a folder called Runtime_ESBSE. How do I start something from this folder to run? . There is a container folder and a bin folder below that? Which exe do I start?
2) I also read I have to build a .CFG file? What should I put in this .CFG file. Based on what I read the .CFG has the parameters being passed? In my case I am using a JSON input, is that what I need?
3) What tool do I use to make sure the Rest service is running? Is this part of the free offering still?
4) Can I take the OSGI bundle and deploy under tomcat or something?

As I stated in this thread, I am new to Talend and Learning reading/watching howto/videos etc. Any help with links for demo or steps with examples is appreciated.
Thanks in advance.
One Star

Re: Talend Rest API

1) When I installed ESB, I have a folder called Runtime_ESBSE. How do I start something from this folder to run? . There is a container folder and a bin folder below that? Which exe do I start?

To run it from CLI, you can use the container/bin/trun.bat command (or trun.sh under Linux). If you want to install the Talend ESB as a service, you can install the "wrapper" feature. For details, search this forum or any reasonable seach engine.


2) I also read I have to build a .CFG file? What should I put in this .CFG file. Based on what I read the .CFG has the parameters being passed? In my case I am using a JSON input, is that what I need?

CFG files are to override your context variable values. Until you don't use context variables, you don't need any custom CFG file. If you want override your context value (e.g. service URL, authentication, ..) you create a config file with the same name as the bundle. There's already a post about it in this forum.

3) What tool do I use to make sure the Rest service is running? Is this part of the free offering still?

Indeed, you need to install the exported bundle (jar file) into the Runtime. You can use a command line (install file://..file url) or drop the jar into the container/deploy folder. The job is immediately installed and started.
You can start / stop the job as a bundle (using the Apache Karaf command line). Talend offers a smarter job server as part of their commercial offering.
You can see exposed services at http://yourserver:8040/services

4) Can I take the OSGI bundle and deploy under tomcat or something?

Simple answer - no. The bundles exported from TOS are made to run on the Taend ESB
I hope it helped.
g.