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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help in calling a API in Marketo

I have tried several options to call for the API (details in the API, in URL mentioned below), through Talend.

I am able to call the API from Google/ARC, but is not able to do so from Talend. Would need some guidance on that.  ( http://developers.marketo.com/rest-api/bulk-import/bulk-lead-import/ )

I have tried these options:

i) Read a csv (through tFileInputDelimited) and converted that data to json and call the API via tRestClient component. I keep getting error "Invalid Content Type"

ii) I have also tried just calling the API using tFileInputDelimited(CSV option) and tRestClient giving all the required header parameter.This also gives the same error.

The API request is /bulk/v1/leads.json.Looking at the API call, it looks like it needs json input (as the URL suggest).From documentation, I understand that the API  needs CSV file with content type as multipart-form-data (as part of Header parameter). How do I achieve this in Talend.

Please let me know if you need more details or clarification to guide me.

Labels (5)
15 Replies
Anonymous
Not applicable
Author

You shouldn't be writing the file to your local filesystem, simply picking it up to send. Can you show me your configuration?

Anonymous
Not applicable
Author

I am trying to call a API to POST a csv file to marketo.

Is tFileFetch the right component for me to upload the file to marketo for bulk update.

The description of this component says "tFileFetch allows you to retrieve file data according to the protocol which is in place.".

 

 

 

Anonymous
Not applicable
Author

Attaching the changes.

When I run this, the error message is going to the output.csv as- 

{"requestId":"c92b#1616d14727e","success":false,"errors":[{"code":"1002","message":"Missing value for required parameter 'file'"}]}

 

And the Execution output is as:

Starting job pocbulkleadstfilefetch at 16:45 06/02/2018.

[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - TalendJob: 'pocbulkleadstfilefetch' - Start.
[statistics] connecting to socket on port 3659
[statistics] connected
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tFileFetch_1 - Connection attempt to 'mktorest.com/bulk/v1/leads.json?access_token=2282365a-1a99-46c5-927b-1e7fdc8590e0:ab&format=csv&file=BulkLeads.csv&content-type=multipart/form-data
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tFileFetch_1 - Connection to 'mktorest.com/bulk/v1/leads.json?access_token=2282365a-1a99-46c5-927b-1e7fdc8590e0:ab&format=csv&file=BulkLeads.csv&content-type=multipart/form-data' has succeeded.
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tFileFetch_1 - Closing the connection to the server.
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tFileFetch_1 - Connection to the server closed.
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tLogRow_1 - Content of row 1: ,
,
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - tLogRow_1 - Printed row count: 1.
[statistics] disconnected
[INFO ]: redshift_dev.pocbulkleadstfilefetch_0_1.pocbulkleadstfilefetch - TalendJob: 'pocbulkleadstfilefetch' - Done.
Job pocbulkleadstfilefetch ended at 16:45 06/02/2018. [exit code=0]


Bulk_Lead_Load_02062018_5pm.docx
Anonymous
Not applicable
Author

Why do you have headers in your URL? They should be configured in the headers section (Content-Type, etc). Also, the information as to what the service needs is very light. How have you got it to work with Google/ARC? What did you send? WHat did you get back? It is REALLY hard to debug web services when you can't try them yourself.

Anonymous
Not applicable
Author

I am attaching the ARC request/response screen shots along with Talend setup.

In Talend I have been trying all possible combinations- with header in URL or without header in URL and as part of header parameters we well.

So far no luck.

I re-tried using setting as you mentioned. In the response (part of attachment), I see that it is taking  "Content-Type: application/json;charset=UTF-8" - Not sure how.

Also output.csv file says:"Invalid multipart request".

Also if you please let me know if it is worthwhile trying with tRestClient or tFileFetch (Doc says tFileFetch- tFileFetch allows you to retrieve file data according to the protocol which is in place.). We are not retrieving file, but sending it. Am I on right track using tFileFetch?

I am really looking forward for some directions from you.I appreciate all your help.

Thanks,


TC_02072018_1.docx
Anonymous
Not applicable
Author

The tFileFetch component is poorly named. I believe the "Upload File" functionality was introduced as an enhancement. The name should have changed. I noticed in your tFileFetch that you didn't have a Parameter called "file" configured. This *could* be the issue given your last error message. In fact ALL of your Query Parameters need to be specified in the Talend Parameters section. Try the configuration exactly as before when you got the last error message about a missing "file" parameter and add the parameters I mentioned above.