Skip to main content

# Python Bindings for ACE REST API

## Examples

### Connect to a Server

Setting the default remote host:

>>> import ace_api
>>> server = 'ace.integraldefense.com'
>>> ace_api.set_default_remote_host(server)
>>> ace_api.ping()
{'result': 'pong'}

Setting the remote host for an Analysis class:

>>> analysis = ace_api.Analysis('this is the analysis description')
>>> analysis.set_remote_host('something.else.com').remote_host
'something.else.com'

If your ACE instance is listening on a port other than 443, specify it like so:

>>> ace_api.set_default_remote_host('ace.integraldefense.com:24443')

>>> ace_api.default_remote_host
'ace.integraldefense.com:24443'

### Submit a File to ACE

>>> path_to_file = 'Business.doc'
>>> analysis.add_file(path_to_file)
<ace_api.Analysis object at 0x7f23d57e74e0>
>>> analysis.add_tag('Business.doc').add_tag('suspicious doc')
<ace_api.Analysis object at 0x7f23d57e74e0>
>>> analysis.submit()
<ace_api.Analysis object at 0x7f23d57e74e0>
>>> analysis.status
'NEW'
>>> analysis.status
'ANALYZING'
>>> analysis.status
'COMPLETE (Alerted with 8 detections)'
>>> result_url = 'https://{}/ace/analysis?direct={}'.format(analysis.remote_host, analysis.uuid)
>>> print("\nThe results of this submission can be viewed here: {}".format(result_url))

The results of this submission can be viewed here: https://ace.integraldefense.com/ace/analysis?direct=137842ac-9d53-4a25-8066-ad2a1f6cfa17

### Submit a URL to Cloudphish

>>> another_url = 'http://medicci.ru/myATT/tu8794_QcbkoEsv_Xw20pYh7ij'
>>> cp_result = ace_api.cloudphish_submit(another_url)
>>> cp_result['status']
'NEW'
>>>  # Query again, a moment later:
...
>>> cp_result = ace_api.cloudphish_submit(another_url)
>>> cp_result['status']
'ANALYZED'
>>> cp_result['analysis_result']
'ALERT'
>>> result_url = 'https://{}/ace/analysis?direct={}'.format(ace_api.default_remote_host, cp_result['uuid'])
>>> print("\nThe results of this submission can be viewed here: {}".format(result_url))

The results of this submission can be viewed here: https://ace.integraldefense.com/ace/analysis?direct=732ec396-ce20-463f-82b0-6b043b07f941

## Documentation

ACE’s API documentation:

View ACE’s full documentation here: [https://ace-analysis.readthedocs.io/en/latest/](https://ace-analysis.readthedocs.io/en/latest/)

Release files for ace-api 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ace-api 1.0.4
File Size Uploaded
ace_api-1.0.4.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ace-api 1.0.4
File Interpreter ABI Platform
ace_api-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / ace_api-1.0.4.tar.gz

Download URL ace_api-1.0.4.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b915cb744095fc29666d4d7c146210a765bafd363f92a1f9dc436cf8bfbdf416
BLAKE2b-256 checksum
How to use checksums
d876d999fde2a2771c79983fd2be661670dff352617b5447dc5f2740818b8071
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6

Release files / ace_api-1.0.4-py3-none-any.whl

Download URL ace_api-1.0.4-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7eb7072bcd2cbb063fc77177a9596210709ed142683a52f611bc1549929a73dc
BLAKE2b-256 checksum
How to use checksums
970ae2e09d7e1cbd26996422aa0becb2410c896a67a8219bcee785577dae546d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6

Release history Release notifications | RSS feed

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page