cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

ATD Upload file via API

Hi,

I'm using python to interact with ATD's api. I can successfully login and retrieve reports etc. However, when I attempt to upload a file to be analysed, I am met with errors. Any feedback would be greatly appreciated.

{"success":false,"errorMessage":"Bad Request. Check input data and payload size(<=200M)"}

I have follwed the documentation (https://kc.mcafee.com/resources/sites/MCAFEE/content/live/PRODUCT_DOCUMENTATION/25000/PD25810/en_US/...). I have tried variouis combinations of the code, below is the basic version.

 

postdata = {'data': {"data":
                {"xMode":"0",
                 "overrideOS":"1",
                 "messageId":"Testing API",
                 "vmProfileList":"11",
                 "submitType":"0",
                 "url":"",
                 "analyzeAgain": '1'
                 },
                "filePriorityQ":"run_now" 
                }
            }


file_up = {'amas_filename':open(r'C:\Python36-32\test.pdf','rb')}
file_upload_req=requests.post(url,data=postdata,files=file_up,heades=headers,verify=False)
print (file_upload_req.text)
2 Replies
Reliable Contributor mjesmer
Reliable Contributor
Report Inappropriate Content
Message 2 of 3

Re: ATD Upload file via API

Just my thoughts... I do not have an ATD to test this on.

-Try removing filePriorityQ and surround the entire string after 'data': in single quotes.

Example:

postdata = {'data': '{"data":{"xMode":"0","overrideOS":"1","messageId":"Testing API","vmProfileList":"11","submitType":"0","url":"","analyzeAgain": '1'}}'}

Reliable Contributor mjesmer
Reliable Contributor
Report Inappropriate Content
Message 3 of 3

Re: ATD Upload file via API

Any progress on this issue/request?

More McAfee Tools to Help You
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • Visit: Business Service Portal
  • More: Search Knowledge Articles
  • ePolicy Orchestrator Support
  • The McAfee ePO Support Center Plug-in is now available in the Software Manager. Follow the instructions in the Product Guide for more.