Dynamic value in tRest component

Seven Stars

Dynamic value in tRest component

Hi everyone,

I have a clarification using tRest component is this possible to pass values dynamically?

 

Example : URL  am giving works for POST method only  

URL : "https://development.avalara.net/1.0/tax/get.xml" 

HTTP Method: POST

HTTP Headers : name: "Authorization" Value : "xyz"

HTTP Body: XML content looks like below

"<Request>
<DocDate>2016-12-08</DocDate>
<CustomerCode>XXX</CustomerCode>
<Addresses>
<Address>
<AddressCode>01</AddressCode>
<City>Texas</City>
<Region>US</Region>
<PostalCode>21234</PostalCode>
</Address>
</Addresses>
<Lines>
<Line>
<LineNo>01</LineNo>
<DestinationCode>01</DestinationCode>
<OriginCode>01</OriginCode>
<ItemCode>M324</ItemCode>
<Qty>1</Qty>
<Amount>100</Amount>
</Line>
</Lines>
</Request>"

 

My question is Instead of giving XML content I would like to pass <DocDate>2016-12-08</DocDate> in the URL ,is this possible?

So based on the date am passing it should retrieve data!

 

Thanks in advance. 

Forteen Stars

Re: Dynamic value in tRest component

If endpoint external - You must follow documentation for this service

 

if it also created by You web-service:

 

You can pass parameter as query or xml as body

 

like 

 

"https://development.avalara.net/1.0/tax/get.xml?DocDate=2016-12-08

 

if You want pass it as XML - use body

-----------
Seven Stars

Re: Dynamic value in tRest component

Hi @vapukov

 

We can't open the URL "https://development.avalara.net/1.0/tax/get.xml?DocDate=2016-12-08" in any browser.It will say file not found.

 

Using Fiddler web debug proxy tool this URL brings data

 

So what component I should use for my scenario.Please help me out.

 

Please have a look at the job below

rest_api.PNG

This is the error I'm facing:

Error:

Starting job gettaxrequest at 10:21 16/06/2017.

[statistics] connecting to socket on port 4073
[statistics] connected
.----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------.
| tLogRow_2 |
|=---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------=|
|Body |ERROR_CODE|
|=---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------=|
|{
"ResultCode": "Error",
"Messages": [
{
"Summary": "The request was unable to be successfully serviced, please try again or contact Customer Service.",
"Severity": "Error",
"Source": "Avalara.Web.REST"}
]
}
|500 |
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------'

[statistics] disconnected
Job gettaxrequest ended at 10:21 16/06/2017. [exit code=0]

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch