appknox.client¶
- class appknox.client.ApiResource(request_session: object, host: str = 'https://api.appknox.com', headers: object | None = None, auth: Dict[str, str] | None = None)[source]¶
Class to perform API requests
- class appknox.client.Appknox(username: str | None = None, password: str | None = None, user_id: int | None = None, organization_id: int | None = None, token: str | None = None, access_token: str | None = None, host: str = 'https://api.appknox.com', log_level: int = 20, http_proxy: str | None = None, https_proxy: str | None = None, insecure: bool = False)[source]¶
Client to interact with API server
- create_report(file_id: int) Report [source]¶
Create a Report object and returns a report ID. The report ID can then be used to download reports in different formats.
- download_report_data(url: str) bytes [source]¶
Downloads the resppnse body in bytes format for a given absolute URL
- get_analyses(file_id: int) List[Analysis] [source]¶
List analyses for file
- Parameters:
file_id – File ID
- get_files(project_id: int, version_code: int | None = None) List[File] [source]¶
List files in project
- Parameters:
project_id – Project ID
- get_last_file(project_id: int, version_code: int | None = None) File [source]¶
Fetch latest file for the project
- Parameters:
project_id – Project ID
- get_organization_id(organization_id: int | None = None) int [source]¶
Return organization id if exists otherwise first entry of organizations
- get_organizations() List[Organization] [source]¶
List organizations for currently authenticated user
- get_profile_report_preference(profile_id: int) ProfileReportPreference [source]¶
Fetch profile report preference
- get_project(project_id: int) Project [source]¶
Fetch project by project ID
- Parameters:
project_id – Project ID
- get_projects(platform: int | None = None, package_name: str = '', search: str = '') List[Project] [source]¶
List projects for currently authenticated user in the given organizations
- get_summary_csv_report_url(report_id: int) str [source]¶
Returns the absolute URL to download Report Summary in CSV format
- get_summary_excel_report_url(report_id: int) str [source]¶
Returns the absolute URL to download Report Summary in Excel format
- get_unselected_report_preference(file_id: int) list [source]¶
Get a list of unselected report preference items
- get_vulnerability(vulnerability_id: int) Vulnerability [source]¶
Fetch vulnerability by vulnerability ID
- Parameters:
vulnerability_id – vulnerability ID
- login(otp: int | None = None)[source]¶
Authenticate with server and create session
- Parameters:
otp – One-time password, if account has MFA enabled
- poll_for_file_from_submission_id(submission_id: int) int [source]¶
Using the submission id, keep checking its status. Returns file instance when it’s available
- Parameters:
submission_id –
The ID of the submission object created for the scan
- return:
The File ID
- recent_uploads() List[Submission] [source]¶
List details of recent file uploads
- rescan(file_id: int) int [source]¶
Start a rescan for a file id
- Parameters:
filed_id – File ID
- Returns:
The ID of the File created in rescan
- switch_organization(organization_id: int | None = None) bool [source]¶
Switch organization_id of client instance