Skip to main content
Solved

HTTPV2 How to use Files Parameter

  • September 9, 2024
  • 2 replies
  • 29 views

Forum|alt.badge.img

I want to use an API endpoint to upload a file from the local file storage system in SOAR (saved to to something like "/opt/siemplify/siemplify_server"). The API documentation mandates using the files parameter like so:

curl -v -X POST https://submissions.emailsecurity.symantec.com/api/v1/fn --header "Content-Type: multipart/ form-data" --header "Authorization: Basic RlBVU0VSMjpRQVBAc3M7MQ==" -F "contactEmailAddress=admin@test.com" - F "emailNotifications=true" -F "sample=@/home/sample.eml" -k

How can I replicate this in SOAR (HTTPV2 does not support the files parameter) besides writing a custom integration/action?

Best answer by f3rz

@dk1271 if API endpoint supports base64 you can use FileUtilities powerup to transfer file to base64 blob and send it as base64 instead of using filepath. 

However, if the only approach that API endpoint allows is using a filepath, then it would be better to submit a Feature Request for HTTPv2 integration and in the meantime create customised action for this approach. 

2 replies

f3rz
Staff
Forum|alt.badge.img+10
  • Staff
  • Answer
  • September 10, 2024

@dk1271 if API endpoint supports base64 you can use FileUtilities powerup to transfer file to base64 blob and send it as base64 instead of using filepath. 

However, if the only approach that API endpoint allows is using a filepath, then it would be better to submit a Feature Request for HTTPv2 integration and in the meantime create customised action for this approach. 


SoarAndy
Staff
Forum|alt.badge.img+12
  • Staff
  • September 13, 2024

 

Should the file payload go into the POST body ?