- Overview
- Using P2A
- Getting Started
- Analysis options
- Analysis Events
- API reference
- FAQ
- Release Notes
API Documentation
Submit a File for Analysis
To submit a file for analysis, make a POST request to /submit
.
Example using CURL
curl -X POST "https://p2a.cert.orangecyberdefense.com/submit" \
-H "Content-Type: multipart/form-data" \
-H "ocd-p2a-apikey: Your-API-Key" \
-H "ocd-p2a-dtype: file" \
-F "file=@/path/to/your/file" \
-F "timeout=60" \
-F "vm=Windows10x64"
Example using Python (requests library)
import requests
url = "https://p2a.cert.orangecyberdefense.com/submit"
headers = {
"ocd-p2a-apikey": "Your-API-Key",
"ocd-p2a-dtype" : "file"
}
files = {
"file": ("/path/to/your/file", open("/path/to/your/file", "rb"))
}
data = {
"timeout": "60",
"vm": "Windows10x64"
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.text)
You can check whether the analysis is ready:
import requests
url = "https://p2a.cert.orangecyberdefense.com/api/{analysis}/status"
headers = {
"ocd-p2a-apikey": "Your-API-Key"
}
response = requests.get(url, headers=headers)
if response.ok:
status_data = response.json()
if status_data["status"] == "ready":
print("Analysis is completed and ready.")
else:
print("Analysis is still in progress.")
else:
print(f"Failed to check analysis status. Status code: {response.status_code}")
Download Analysis Results
To download analysis results, make a GET request to /download/{analysis_id}
.
Example using CURL
curl -X GET "https://p2a.cert.orangecyberdefense.com/download/{analysis_id}" \
-H "ocd-p2a-apikey: Your-API-Key" \
-o "analysis_results.zip"
Example using Python (requests library)
import requests
url = "https://p2a.cert.orangecyberdefense.com/download/{analysis_id}"
headers = {
"ocd-p2a-apikey": "Your-API-Key"
}
response = requests.get(url, headers=headers)
with open("analysis_results.zip", "wb") as f:
f.write(response.content)
Get Analysis Status
To get the analysis status, make a GET request to /status/{analysis_id}
.
Example using CURL
curl -X GET "https://p2a.cert.orangecyberdefense.com/status/{analysis_id}" \
-H "ocd-p2a-apikey: Your-API-Key"
Example using Python (requests library)
import requests
url = "https://p2a.cert.orangecyberdefense.com/status/{analysis_id}"
headers = {
"ocd-p2a-apikey": "Your-API-Key"
}
response = requests.get(url, headers=headers)
print(response.text)
Get Historical Analysis Data
To get historical analysis data, make a GET request to /history/{analysis_id}
.
Example using CURL
curl -X GET "https://p2a.cert.orangecyberdefense.com/history/{analysis_id}" \
-H "ocd-p2a-apikey: Your-API-Key"
Example using Python (requests library)
import requests
url = "https://p2a.cert.orangecyberdefense.com/history/{analysis_id}"
headers = {
"ocd-p2a-apikey": "Your-API-Key"
}
response = requests.get(url, headers=headers)
print(response.text)