cancel
Showing results for 
Search instead for 
Did you mean: 

Use a curl via utility-http

dbellazzi
Level 3

Hi,

I need to replicate this curl via utility-http:
curl -X POST --data-binary @c:/profili/User/Desktop/AAAA.eml \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/octet-stream; name=\"File Name.eml\"" \ -H "Content-Transfer-Encoding: base64" \ -H "Content-Disposition: attachment; filename=\"File Name.eml\"" \ "https://storage.googleapis.com /upload/storage/v1/b/BUCKET/o?uploadType=media&name=PATH%2FNAME.eml"

Can you give me support?

Thank you,
Daniel



------------------------------
Daniel Bellazzi
------------------------------
8 REPLIES 8

dbellazzi
Level 3

Hi all,

Could you please help me on this topic?

Thanks,

Daniel



------------------------------
Daniel Bellazzi
------------------------------

ewilson
Staff
Staff

@dbellazzi,

First, make sure you've downloaded the latest version of the Utility - HTTP VBO from the DX. After that, you'll want to take a look at the HTTP Request Multipart action. Pay special attention to the input Collections FileMetadata and FieldMetadata as those are what you'll use to pass in the file(s) to the be uploaded as part of the POST request and any fields, or JSON content, that needs to be included at the beginning of the request body. The request will look something like this:

7171.png

The File Metadata collection will look something like this:

7172.png

In this case it looks like you don't really have any field data, so the Field Metadata can be left blank I believe.

NOTE: The best way to troubleshoot this sort of thing is to run Fiddler and compare the actual on-wire cUrl request to that of Blue Prism. It helps you to see how things might be different between the two.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi Eric,

Thanks a lot, by the way I followed what you suggested but I get this error "Remote server error: (407) Proxy authentication required.". I would like to specify that I can make the call via command prompt. I also noticed that the object specifies "Use Bearer Token is not configured to work using a Proxy." Can you give me support please?

Thanks,

Daniel



------------------------------
Daniel Bellazzi
------------------------------

@dbellazzi,

Ok, there was no mention of the need for proxy settings in your example. My guess is curl is picking up the system settings for that. Unfortunately, the HTTP VBO does not, so you would have to set the Use Proxy flag to True and then fill in the values for Proxy URL, Proxy Username, and Proxy Password.

I'm not sure what you mean "object specifies 'Use Bearer Token is not configured to work using a Proxy.'" There's nothing in that code, that I recall, that would stop the bearer token from being added to the Authorization header even if proxy credentials are included. There is code that checks to ensure we only ever have, at most, 1 Authorization header though which is the HTTP standard.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thanks Eric.

For "object specifies 'Use Bearer Token is not configured to work using a Proxy.'" I mean this note in the object in the  HTTP Request Multipart page7182.png

Is it possible the use of the Bearer token and Proxy together so?

Moreover, could you please indicate where I can find the Proxy URL, Proxy Username, and Proxy Password?

Thanks again,

Daniel



------------------------------
Daniel Bellazzi
------------------------------

@dbellazzi,

As I mentioned previously, there's no code that I recall which would stop the use of bearer token and proxy settings together. Should be pretty easy for you to test it though, and see if you receive an error.

The proxy properties are exposed as input on the action. If you don't see them, you have an old version of the VBO.

7191.png

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi Eric,

Thanks, I see the input on the action but I can't get the values to use. How can I retrieve the information to enter? Is it my PC information or API information?

Also, I made the same request using the SoapUI tool with "Proxy Setting: None". However, if I enable the "Proxy Setting", the request does not work. I'm a little confused about why using another type of tool I can make the call without the Proxy, but I need it for Blue Prism. Do you have any thoughts on this difference?

Thank you,

Daniel



------------------------------
Daniel Bellazzi
------------------------------

@dbellazzi,

I can't really diagnose your network. The best approach I can suggest is to use Fiddler, Wire Shark, or some other capture tool to catch the network traffic created by the successful requests you make from the command line or SoapUI and then capture the requests from Blue Prism and compare the two. That should help you identify what the exact differences are. 

If you're not familiar with those tools, I would engage someone from your IT/network team to assist.

Cheers, 



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------