Passing XML body to REST API client

Highlighted
Five Stars

Passing XML body to REST API client

Hi All,

 

First let me say that I am really, really, really new to Talend, but not to IT.  I know what I want to do, but I need help figuring out how to do it in Talend.

 

I am trying to pass a small bit of XML to a tREST_Client.

Here is what I have so far:

talend_qb_xml_body.png

As you can see I have an exclamation point which is there because of:

Warning: No schema has been defined yet

Error: Parameter (Mapping) must have at least one value.

 

When I run the job as is I get the following:

talend_qb_xml_body_error.png

 

I am trying to access Quickbase, but to do that the first thing you have to do is get an authentication token which I am planning to write to the outfile and retrieve it for the next process.

The working curl statement I have is:

curl --request POST \
  --url https://mycompany.quickbase.com/db/main \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/xml' \
  --header 'quickbase-action: API_Authenticate' \
  --data '<qdbapi>\n   <username>me@mycompany.com</username>\n   <password>ReallyCleverPassword01</password>\n   <hours>1</hours>\n   <udata>optional data</udata>\n</qdbapi>'

 

Any thoughts on where I am going wrong?

 

Thanks!

Moderator

Re: Passing XML body to REST API client

Hello,

If you want to pass directly the xml file as request to the web service when calling, read the root element as a node, see below:

xml.png

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch