Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Connecting REST API and extracting JSON Fields to a table

Hi everyone,

I am pretty new to talend and has been trying to connect an API key as below to retrieve lead from a website.

However, i have been finding difficult to idetify the right information to input in my TrestClient (if tha'x the right component to use).

Show

> Example Request:

curl https://api.wishpond.com/api/v1/leads/:lead_id \
-H "X-Api-Token:YOUR_API_KEY"
> Sample Response:
{
    "lead": {
        "id": "xxxxxxx",
        "email": "someone@test.com",
        "status": "active",
        "created_at": "2015-07-xxxx",
        "updated_at": "2015-07-xxxxx",
        "lead_score": 0,
        "subscribed": true,
        "cid": "xxxxx",
        "mid": "263531",
        "dynamic_attributes": {
            "first_name": "xxxx",
            "last_name": "xxxxx"
        }
    }
}
I just want external ideas on how to go about resolving what seems difficult for me now.

 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thank you TRF,

Can you please precise if i should leave the path box empty with quote?

Thank you so much for you help.

View solution in original post

5 Replies
TRF
Champion II
Champion II

So, if I understand you search to tgranslate from curl to tRestClient.

Based on your example, here is how the component should be configured:

- URL: https://api.wishpond/api/v1/

- HTTP Method: GET

- Content Type: JSON

- Accept Type: any

- Query parameters: leads (as name) - lead_id (as value - probably issued from a global variable)

- HTTP Headers (Advanced settings): X-Api-Token (as name) - yourApiKey (as value - probably issued from a global variable)

 

Probably not so far from what you need but you have to try by yourself.

 

Anonymous
Not applicable
Author

Thank you TRF,

Can you please precise if i should leave the path box empty with quote?

Thank you so much for you help.

Anonymous
Not applicable
Author

Thank you so much, your suggestion has been of a great help. I have resolved my issue
TRF
Champion II
Champion II

Great! But you should have selected the answer which help you instead of yours...
Anonymous
Not applicable
Author

Tha'x right !

I made a mistake as i am new here.

However it jut stop working with UnknownHostException invoking https://api.wishpond/api/v1/?Leads=lead_id: api.wishpond