cancel
Showing results for 
Search instead for 
Did you mean: 

Utility - HTTP - 10.0.0: HTTP Request File

rachkim1617
Level 4
I am using an Ariba API to download a file and received a response, but need to use the HTTP Request File action to save a PDF file. I filled out the Address URL, Method, Accept, Use Bearer Token, Bearer Token, and File Path inputs and stepped through the action, but received a 401 status code: remote server returned an error: (401) Unauthorized. 

How do I format the headers collection to use the Request File action? Is there anything else needed?
4 REPLIES 4

ewilson
Staff
Staff
@rachkim1617,

There are multiple Ariba APIs. Can you be more specific about which one you're using?

Cheers,
Eric​

ewilson
Staff
Staff
FWIW - Here's a screenshot of the SAP Ariba connector on the DX and the common headers it sets. Note: The Authorization header is automatically created and populated by your use the Bearer Token parameter on the HTTP VBO.

35223.png

Cheers,
Eric

rachkim1617
Level 4
@ewilson Thank you for the quick response! I'm using the Project Document Management Download API (Project Document Management API endpoints | SAP Help Portal). I copied the common headers from BluePrism SAP Ariba connector for this API and created a single row Headers collection to use in the HTTP Request File action (Fields: Content-Type, APIKey, accept, Authorization)

But I am getting the following error message after running this action: 

​ERROR: internal: Could not execute code stage because exception thrown by code stage: The 'Content-Type' header must be modified using the appropriate property or method. 

I set current values for Content-Type as application/json and accept: application/pdf

ewilson
Staff
Staff
@rachkim1617,

There's a dedicated Content-Type​ property exposed by the actions on the HTTP VBO, so you don't need to add that to the Headers Collection.

Cheers,
Eric