cancel
Showing results for 
Search instead for 
Did you mean: 

How to download a file using web api.

AZ
Level 3
I want to download a file using Web API. After making request we are getting File data as text in the response content data item.

For your reference I am getting the response as below as text type.

%PDF-1.4 %����
68 0 obj <</Linearized 1/L 1850803/O 70/E 262535/N 13/T 1849323/H [ 916 320]>> endobj
xref
68 31
0000000016 00000 n
0000001236 00000 n
0000001456 00000 n
0000001821 00000 n
0000001957 00000 n
0000002087 00000 n
0000002229 00000 n
0000002972 00000 n
0000003602 00000 n
0000004428 00000 n
0000005000 00000 n
0000005715 00000 n

I am not adding all the content here.

How can we save this content as a original file.

Please help, its an urgent.

Thanks
K

------------------------------
A Z
------------------------------
10 REPLIES 10

If you open the VBO and go to the HTTP Request File action, you should be able to add the following code to include a bearer token header in your request instead of HTTP Basic Auth. Please note, THIS IS A TOTAL HACK. This is a quick fix to address your question. You would need to either define a new input parameter called "token" and pass in your token value or you could just hardcode it in the VB. Ultimately, if you want something maintainable and flexible you'd adjust this code to possibly include a flag to discern between using HTTP Basic or Bearer auth.

Hopefully that makes sense? I'll add an item to our backlog to update the published VBO to include this capability.

16633.png

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------