Skip to main content

Qlik Application Automation

Announcements
Feb 9th, Qlik Product Portfolio Strategy and Roadmap Webinar for Data Integration, last chance to REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Poornima_Menon
Contributor
Contributor

Posting Data to Qlik- Using Java Rest Template giving 308

Hi Qlik users,

I am relatively new to Qlik  and trying to develop a POC. 

My requirement is to post a user data file to Qlik account - call the REST end point -https://your-tenant.us.qlikcloud.com/api/v1/data-files via Java and see the file appear in the Data option in my account . 

When I try the end point via postman getting the error -Request must have 'name' specified while posting new file . Adding my request screen -

Poornima_Menon_0-1653019115721.png

Poornima_Menon_1-1653019128016.png

Response : 

Poornima_Menon_2-1653019139155.pngPoornima_Menon_3-1653019167411.png

Also I tried via calling this with Rest Template - but getting 308 . A sample to make this request successfully would be much appreciated and useful for me . Also an explanation of what the variables in BOLD should be which is given in the  developer portal -

 

'{"name":"MyFile.csv","appId":"f34b91a1-0dc3-44ac-a847-51cb84122c84","connectionId":"ee6a390c-5d33-11e8-9c2d-fa7ae01bbebc","sourceId":"f34b91a1-0dc3-44ac-a847-51cb84122c84","tempContentFileId":"624b0f54459f1c00018dade4"}'

 

Labels (1)
1 Reply
blaise
Partner - Specialist
Partner - Specialist

this post should probably be moved to another section (has nothing to do with Qlik Application Automation) but i would still like to comment on it.

I myself tried this yesterday when I saw this API endpoint. I get the same error message that the request must contain a 'name' parameter (400 - Bad request). I use postman and I believe the request should be ok;

curl --location --request POST "https://xxxxxxx.eu.qlikcloud.com/api/v1/data-files" \
--header "Content-Type: multipart/form-data" \
--header "Authorization: Bearer xxxxxxxxxxxx" \
--form "name=\"testFromAPI.csv\"" \
--form "connectionId=\"9ee38f4f-bedf-44f2-aeba-8c29d82eef5\"" \
--form "file=@\"/C:/xxxxxxx/testFromAPI.csv\""
 
Accourding to qlik.dev data-files post  only name and file is mandatory, others are optional.
 
Br Johan