Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tHTTPRequest and parameters

Hi all,

I have to upload a csv file using HTTpRequest component.

The API has the following specification:

Body Params

surveyId:
required
string

ID of the survey to import responses into

file:
required
file

A CSV file containing responses for import. [?]

 

I can mention the location of the csv in the "Post parameters from file" option. My csv contains headers and values.

How do I pass the survey ID ? since it is not in the query parameter but in the Body Parameter?

 

Also, I tried using Postman. It shows success message, but I dont see the csv values in the API.

 

Please help me out

Labels (4)
16 Replies
Anonymous
Not applicable
Author

Try using the tFileFetch for this. It is badly named since it is not just for fetching files. This may require a bit playing about before it works. Take a look here for information on this component: https://help.talend.com/reader/MjIZDoU6r0vLbCpGh5GAcg/F4QsQrja9IQEa_kKqmBfNQ

Anonymous
Not applicable
Author

Hi,

Thanks. I need not fetch the file from a URI. 

My situation is to upload a csv file to a site and mention the body parameters.

If I use tFilefetch, where do I mention the URI of my destination and what do I mention in the URI in the basic section.

Could you please elaborate

Anonymous
Not applicable
Author

Read the instructions and you will see that there is an "Upload file" option on the Advanced Settings page. You should be able to supply your parameters in the parameters section. Unless I have access to the API you are using, I cannot help anymore than this. You will need to experiment.

Anonymous
Not applicable
Author

I have mentioned the required information based on the component details. Since tFileFetch is used to download a file and then upload it, I had confusion if it works when there is no need to download.Currently, i mentioned the endpoint in the URI and destination details as blank.

https://api.qualtrics.com/docs/import-responses is the api that i am referring to.

Anonymous
Not applicable
Author

Have tried it? You can upload with tFileFetch as well. Look for the upload file option.
Anonymous
Not applicable
Author

Yes. I tried it. Also, which do you suggest:

tSystem component which runs the curl command as mentioned in the API specification or tFileFetch ?

Is it ok to just upload a file without mentioning the download option in tFileFetch?

Attached is the screenshot for reference. Is my configuration correct?

 


attachments.zip
Anonymous
Not applicable
Author

That looks OK. Are you getting an error message?

Anonymous
Not applicable
Author

This is the error that I get when i try to upload a csv

There isContinue_tFileFetch_1 an exception on: https://au1.qualtrics.com/API/v3/responseimports
java.lang.Exception: Method failed: HTTP/1.1 400 Bad Request
at vocalcomintegration.csv_0_1.csv.tFileInputDelimited_1Process(csv.java:757)
at vocalcomintegration.csv_0_1.csv.runJobInTOS(csv.java:1138)
at vocalcomintegration.csv_0_1.csv.main(csv.java:987)

Anonymous
Not applicable
Author

I'm afraid I think this is a learning curve you are going to have to go through. Using web services with ANY tool requires a fair amount of trial and error....with a lot of time spent filtering through errors, making slight changes and seeing if the errors change. My goto component for uploading files is the tFileFetch. However, if that doesn't work (and I can't get the error message to change), I will go to the tRESTClient or even the tREST. But if you do it via the tREST you will need to convert the file into a bytearray yourself and handle all of the complexities.

 

If I could have access to the web service you are using, I could probably get it sorted pretty swiftly, but doing it via trial and error via proxy is really difficult.