{% extends "base_top_only.html" %} {% block content %}
REST API Key: {{ api_key}}
api/v1/upload - Upload a Fileapi/v1/scan - Scan a Fileapi/v1/delete_scan - Delete a Scanapi/v1/download_pdf - Download PDF Reportapi/v1/report_json - Generate JSON Reportapi/v1/view_source - View Source FilesAPI to upload a file. Supported file types are apk, zip, ipa and appx.
URL: /api/v1/upload
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| file | multipart/form-data |
Yes |
Success Response:
200 application/json; charset=utf-8 {"file_name": "diva-beta.apk", "hash": "82ab8b2193b3cfb1c737e3a786be363a", "scan_type": "apk"}Error Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entity application/json; charset=utf-8{"error": <error message> }OR
401 Unauthorizedapplication/json; charset=utf-8{"error": "You are unauthorized to make this request." }Sample Call:
curl -F 'file=@/Users/ajin/Desktop/diva-beta.apk' http://localhost:8000/api/v1/upload -H "Authorization:563d64fc5054d3b239ac0419f1d6b2378465f5c80e1778c283eb1e3265bdd7ae"
API to scan a file that is already uploaded.
URL: /api/v1/scan
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| scan_type | apk, zip, ipa, or appx | Yes |
| file_name | Name of the app with extension | Yes |
| hash | hash of the scan | Yes |
| re_scan | 0 or 1, default is 0 | No |
Success Response:
200application/json; charset=utf-8{"act_count": "17", "api": {"Loading Native Code (Shared Library) ": {"path":
["jakhar/aseem/diva/DivaJni.java"]}, "Local File I/O Operations": {"path":
["jakhar/aseem/diva/InsecureDataStorage2Activity.java", "jakhar/aseem/diva/SQLInjectionActivity.java"]},
"Starting Activity": {"path": ["jakhar/aseem/diva/AccessControl1Activity.java",
"jakhar/aseem/diva/AccessControl2Activity.java", "jakhar/aseem/diva/AccessControl3Activity.java",
"jakhar/aseem/diva/MainActivity.java"]}, "Query Database of SMS, Contacts etc.": {"path":
["jakhar/aseem/diva/AccessControl3NotesActivity.java", "jakhar/aseem/diva/NotesProvider.java"]}
SNIPPED
Error Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entityapplication/json; charset=utf-8{"error": <error message> }OR
401 Unauthorizedapplication/json; charset=utf-8{"error": "You are unauthorized to make this request." }Sample Call:
curl -X POST --url http://localhost:8000/api/v1/scan --data "scan_type=apk&file_name=diva-beta.apk&hash=82ab8b2193b3cfb1c737e3a786be363a" -H "Authorization:563d64fc5054d3b239ac0419f1d6b2378465f5c80e1778c283eb1e3265bdd7ae"
API to delete scan results.
URL: /api/v1/delete_scan
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| hash | hash of the scan | Yes |
Success Response:
200application/json; charset=utf-8 {"deleted": "yes"} or {"deleted": "scan hash not found"}Error Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entityapplication/json; charset=utf-8{"error": <error message> }OR
401 Unauthorized application/json; charset=utf-8{"error": "You are unauthorized to make this request." }Sample Call:
curl -X POST --url http://localhost:8000/api/v1/delete_scan --data "hash=82ab8b2193b3cfb1c737e3a786be363a" -H "Authorization:563d64fc5054d3b239ac0419f1d6b2378465f5c80e1778c283eb1e3265bdd7ae"
API to generate PDF Report
URL: /api/v1/download_pdf
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| hash | hash of the scan | Yes |
| scan_type | apk, andzip, ioszip, ipa, or appx | Yes |
Success Response:
200application/pdf PDF ContentsError Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entity application/json; charset=utf-8 {"error": <error message> }OR
401 Unauthorized application/json; charset=utf-8 {"error": "You are unauthorized to make this request." }Sample Call:
curl -X POST --url http://localhost:8000/api/v1/download_pdf --data "hash=82ab8b2193b3cfb1c737e3a786be363a&scan_type=apk" -H "Authorization:563d64fc5054d3b239ac0419f1d6b2378465f5c80e1778c283eb1e3265bdd7ae"
API to generate JSON Report
URL: /api/v1/report_json
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| hash | hash of the scan | Yes |
| scan_type | apk, andzip, ioszip, ipa, or appx | Yes |
Success Response:
200application/json; charset=utf-8 JSON ContentsError Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entity application/json; charset=utf-8 {"error": <error message> }OR
401 Unauthorized application/json; charset=utf-8 {"error": "You are unauthorized to make this request." }Sample Call:
curl -X POST --url http://localhost:8000/api/v1/report_json --data "hash=82ab8b2193b3cfb1c737e3a786be363a&scan_type=apk" -H "Authorization:563d64fc5054d3b239ac0419f1d6b2378465f5c80e1778c283eb1e3265bdd7ae"
API to view source files
URL: /api/v1/view_source
Method: POST
Header: Authorization:<api_key>
Data Params
| Param Name | Param Value | Required |
|---|---|---|
| hash | hash of the scan | Yes |
| file | relative file path | Yes |
| type | apk/ipa/studio/eclipse/ios |
Yes |
Success Response:
200application/json; charset=utf-8 JSON ContentsError Response:
500 Internal Server Error or 405 Method Not Allowed or 422 Unprocessable Entity application/json; charset=utf-8 {"error": <error message> }OR
401 Unauthorized application/json; charset=utf-8 {"error": "You are unauthorized to make this request." }Sample Call:
curl -X POST --url http://localhost:8000/api/v1/view_source --data "hash=18e244926da1e49c5b8ffc1c30de8abc&type=apk&file=b/a/a/a/a/a.java" -H "Authorization:7e2ddf418b291d2e070496524d1b8599c31637f84055c5db632f49f1a613f5f5"
curl -X POST --url http://localhost:8000/api/v1/view_source --data "hash=6c23c2970551be15f32bbab0b5db0c71&type=ipa&file=classdump.txt" -H "Authorization:87e2ddf418b291d2e070496524d1b8599c31637f84055c5db632f49f1a613f5f5"