cancel
Showing results for 
Search instead for 
Did you mean: 

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'}}'}

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

Re: ATD Upload file via API

Any progress on this issue/request?

ePO Support Center Plug-in
Check out the new ePO Support Center. Simply access the ePO Software Manager and follow the instructions in the Product Guide for the most commonly used utilities, top known issues announcements, search the knowledgebase for product documentation, and server status and statistics – all from within ePO.