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
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community