cancel
Showing results for 
Show  only  | 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
Highlighted
Reliable Contributor
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
Reliable Contributor
Report Inappropriate Content
Message 3 of 3

Re: ATD Upload file via API

Any progress on this issue/request?

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

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