Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dura45
Contributor II
Contributor II

Iterate tRest API call with dynamic body

Hi everyone, I'm having trouble with a task and need some help.

I have two tables:

  • One with all the products in a CRM - (ImportedProducts)
  • One with all the products and prices from an ERP - (PricebookView)

I want to update the prices of all the products in the CRM (ImportedProducts) based on the prices in PricebookView. To do this, I need to make multiple API calls with the following structure:

URL: www.url.com/products/ {productid} where {productid} is dynamic and represents the ID I have in ImportedProducts

BODY (to update the subtotal, for example):

JSON
{
  "subtotal": {price}
}

where {price} is the price for the {productid} in the URL. Of course, there are many prices to update.

I've implemented the basic job functionality, but I'm stuck on how to pass dynamic values to the URL and body. Any suggestions? Thanks!

Here the actual job has an error (Syntax error on token "") }"", delete this token. But I think this is not only a syntax error but a structure error.

Screenshot_94.png

Talend Studio 

Labels (5)
1 Solution

Accepted Solutions
Shicong_Hong
Support
Support

Hello

You need to escape the double quotes in the body string, eg:

"{\\"key\\":value}"

 

Regards

Shong

 

View solution in original post

1 Reply
Shicong_Hong
Support
Support

Hello

You need to escape the double quotes in the body string, eg:

"{\\"key\\":value}"

 

Regards

Shong