---
title: Enterprise API integration guide
description: Find here instructions and documentation for API integration at enterprise level for granualr report generation
---

[Skip to content](https://help.appsecengineer.com/enterprise-api-integration-guide#main-content)

English

Show submenu for translations

[![AppSecEngineer logo](https://help.appsecengineer.com/hubfs/AppSecEngineer%202023%20logo%20%20glasses%20MASTER-01.svg)](https://www.appsecengineer.com/)

- [Home](https://www.appsecengineer.com/)
- [Resources](https://www.appsecengineer.com/enterprises/blogs)
- [Course Library](https://www.appsecengineer.com/enterprises/courses)

Open main navigation

Close main navigation

- [Home](https://www.appsecengineer.com/)
- [Resources](https://www.appsecengineer.com/enterprises/blogs)
- [Course Library](https://www.appsecengineer.com/enterprises/courses)
- English
  
  Show submenu for translations

 How can we help you?

- There are no suggestions because the search field is empty.

1. [AppSecEngineer Knowledge Base](https://help.appsecengineer.com/?hsLang=en)
2. [Integrations](https://help.appsecengineer.com/integrations?hsLang=en)

# Enterprise API integration guide

## Integrate AppSecEngineer’s API to fetch learning data, process it for reporting, automate report generation, and distribute insights via email or cloud storage.

Here’s your article cleaned up, de-duplicated, and formatted with proper code blocks. You can paste this directly into your knowledge base.

---

We provide most of the reports that are present in our dashboard as APIs, which can be integrated into your own system, Business Intelligence (BI) tools, or other dashboards/systems. This will provide insights and help you track progress directly in your own environment.

Find the API documentation at:  
[https://apidocs.appsecengineer.com](https://apidocs.appsecengineer.com/)

---

#### Steps

### 1. Generate API Keys

These APIs are authorized using API keys, which can be generated from the AppSecEngineer Admin section.

1. Log in to the AppSecEngineer Portal.
2. Go to **Admin → Integrations → Enterprise APIs**.
3. You’ll find the API URL and a button to generate an API secret.
4. Generate the API secret and make sure to store it securely.

### 2. Review API Docs

We provide different types of reports such as:

- Reporting categorized by learning paths
- Per-user reporting
- Learning journeys reports

Carefully review:

- The payload (request body)
- HTTP method
- API path

The required headers and other attributes are also documented in the API docs.

---

#### Example Code in Python

```
import requestsapi_url = "https://api.appsecengineer.app/enterprise/report/proficiency-report"headers = {    "X-ASE-API-Token": "<secret api key>",    "X-ASE-Customer-ID": "<customer id shown in dashboard>",    "Content-Type": "application/json",}body = {}try:    response = requests.post(api_url, json=body, headers=headers)    if response.status_code == 200:        print("Request successful!")        print("Response:", response.json())    else:        print(f"Request failed with status code: {response.status_code}")        print("Response:", response.text)except requests.exceptions.RequestException as e:    print("An error occurred:", e)
```

> **Note:** We only support JSON data as both request and response.

The response can be transformed into CSV/sheet/PDF, etc., using your own system if needed. Or it can be directly represented in BI tools.

---

#### Process and Clean the Data

**Objective:** Prepare the retrieved data for reporting by extracting, cleaning, and organizing it.

1. Parse the JSON response and extract relevant fields.
2. Format the data (e.g., clean dates, remove unnecessary fields).
3. Structure the data into a consistent format for report generation.

### Example Python

```
cleaned_data = []for item in data["results"]:    cleaned_data.append({        "date": item["date"],        "sales": item["sales"],        "transactions": item["transactions"],    })
```

---

#### Generate the Report

**Objective:** Create a professional report in the desired format (e.g., CSV, Excel, PDF, or HTML).

### Options for Report Generation

#### CSV Format (using `csv` library)

```
import csvkeys = cleaned_data[0].keys()with open("report.csv", mode="w", newline="") as file:    writer = csv.DictWriter(file, fieldnames=keys)    writer.writeheader()    writer.writerows(cleaned_data)
```

#### Excel Format (using `pandas`)

```
import pandas as pddf = pd.DataFrame(cleaned_data)df.to_excel("report.xlsx", index=False)
```

#### HTML Format

Generate web-friendly reports using HTML tables or templates.  
(For example, you can use Jinja2 templates or directly construct HTML with tables from `cleaned_data`.)

---

#### Step 6: Automate Report Generation (Optional)

**Objective:** Schedule automated report generation for regular intervals (e.g., daily, weekly, monthly).

### Automation Methods

- **Linux cron jobs:** Automate execution of the script at specific intervals.  
  Example (run at midnight daily):
  
  
  
  ```
  # Edit crontabcrontab -e# Add the following line:0 0 * * * python3 /path/to/report_script.py
  ```
- **Windows Task Scheduler:** Schedule scripts to run on Windows systems.
- **Cloud services:** Use tools like AWS Lambda or Google Cloud Functions for serverless automation.

---

#### Step 7: Distribute the Report

**Objective:** Share the generated report with stakeholders or automate the distribution process.

### Options for Distribution

#### Email (Python with `smtplib`)

```
import smtplibfrom email.mime.multipart import MIMEMultipartfrom email.mime.base import MIMEBasefrom email import encoderssender_email = "your_email@example.com"receiver_email = "receiver@example.com"password = "your_email_password"msg = MIMEMultipart()msg["From"] = sender_emailmsg["To"] = receiver_emailmsg["Subject"] = "Monthly Sales Report"attachment = MIMEBase("application", "octet-stream")with open("report.csv", "rb") as file:    attachment.set_payload(file.read())encoders.encode_base64(attachment)attachment.add_header(    "Content-Disposition",    "attachment",    filename="report.csv",)msg.attach(attachment)with smtplib.SMTP("smtp.example.com", 587) as server:    server.starttls()    server.login(sender_email, password)    server.sendmail(sender_email, receiver_email, msg.as_string())
```

#### Cloud Storage

Upload the report to platforms like Google Drive or AWS S3 and share access links.

---

#### Step 8: Monitor and Improve

**Objective:** Continuously optimize the report generation process.

- **Feedback collection:** Gather input from stakeholders on the report’s accuracy, relevance, and design.
- **Improvements:** Refine parameters, enhance formatting, and address any data inconsistencies.
- **Error handling:** Implement error logging and handling to ensure reliability.

Track learning journey results through our guide on **Reports about Learning Journeys**.

---

#### Summary of Steps

1. **Select API:** Identify the appropriate API for retrieving the required data.
2. **Authenticate:** Set up secure access using API keys or OAuth tokens.
3. **Fetch Data:** Retrieve data using well-configured API requests.
4. **Process Data:** Clean and organize the data for analysis and reporting.
5. **Generate Report:** Create reports in desired formats (CSV, Excel, PDF, HTML).
6. **Automate:** Schedule recurring report generation using automation tools.
7. **Distribute:** Share reports via email or upload them to cloud storage platforms.
8. **Monitor & Improve:** Continuously test and enhance the process for reliability and usability.

- [Getting started](https://help.appsecengineer.com/getting-started?hsLang=en#main-content)
  
  
  
  
  
    - [Welcome to AppSecEngineer](https://help.appsecengineer.com/getting-started?hsLang=en#welcome-to-appsecengineer)
    - [ILT (Instructor Led Training)](https://help.appsecengineer.com/getting-started?hsLang=en#ilt-instructor-led-training)
    - [Onboarding Guide](https://help.appsecengineer.com/getting-started?hsLang=en#onboarding-guide)
    - [Platform Navigation](https://help.appsecengineer.com/getting-started?hsLang=en#platform-navigation)
    - [Quick Start Guide](https://help.appsecengineer.com/getting-started?hsLang=en#quick-start-guide)
- [Integrations](https://help.appsecengineer.com/integrations?hsLang=en)
- [Sandbox](https://help.appsecengineer.com/sandbox?hsLang=en)
- [Achievement](https://help.appsecengineer.com/achievement?hsLang=en)
- [Roadmap](https://help.appsecengineer.com/roadmap?hsLang=en)
- [Interviews](https://help.appsecengineer.com/interviews?hsLang=en)
- [Course recommendations](https://help.appsecengineer.com/course-recommendations?hsLang=en)
- [AppSecFlag](https://help.appsecengineer.com/appsecflag?hsLang=en)
- [Team Manager](https://help.appsecengineer.com/team-manager?hsLang=en)
- [Creator Studio](https://help.appsecengineer.com/creator-studio?hsLang=en)
- [Onboarding Guide](https://help.appsecengineer.com/onboarding-guide?hsLang=en)
- [Certification Pricing](https://help.appsecengineer.com/certification-pricing?hsLang=en)
- [Tournaments](https://help.appsecengineer.com/tournaments?hsLang=en)
- [Bootcamps](https://help.appsecengineer.com/bootcamps?hsLang=en)
- [Hands On Labs](https://help.appsecengineer.com/hands-on-labs?hsLang=en)
- [Users & Teams](https://help.appsecengineer.com/users-teams?hsLang=en#main-content)
  
  
  
  
  
    - [Users](https://help.appsecengineer.com/users-teams?hsLang=en#users)
    - [Teams](https://help.appsecengineer.com/users-teams?hsLang=en#teams)
- [Challenges](https://help.appsecengineer.com/challenges?hsLang=en#main-content)
  
  
  
  
  
    - [For individuals](https://help.appsecengineer.com/challenges?hsLang=en#for-individuals)
    - [For Admins](https://help.appsecengineer.com/challenges?hsLang=en#for-admins)
- [Report](https://help.appsecengineer.com/report?hsLang=en#main-content)
  
  
  
  
  
    - [User / Team Level Reports](https://help.appsecengineer.com/report?hsLang=en#user-team-level-reports)
    - [Feature Level Reports](https://help.appsecengineer.com/report?hsLang=en#feature-level-reports)
- [Assignments](https://help.appsecengineer.com/assignments?hsLang=en#main-content)
  
  
  
  
  
    - [For Individuals](https://help.appsecengineer.com/assignments?hsLang=en#for-individuals)
    - [For Admins](https://help.appsecengineer.com/assignments?hsLang=en#for-admins)
- [Learning Journeys](https://help.appsecengineer.com/learning-journeys?hsLang=en)
- [Certifications](https://help.appsecengineer.com/certifications?hsLang=en)
- [Pricing](https://help.appsecengineer.com/pricing?hsLang=en#main-content)
  
  
  
  
  
    - [Trial & Queries](https://help.appsecengineer.com/pricing?hsLang=en#trial-queries)
- [Subscription Cancellation](https://help.appsecengineer.com/subscription-cancellation?hsLang=en)

- [Home](https://www.appsecengineer.com/)
- [Resources](https://www.appsecengineer.com/enterprises/blogs)
- [Course Library](https://www.appsecengineer.com/enterprises/courses)

[![AppSecEngineer logo](https://help.appsecengineer.com/hubfs/AppSecEngineer%202023%20logo%20%20glasses%20MASTER-01.svg "AppSecEngineer logo")](https://www.appsecengineer.com/)

<https://www.facebook.com/> <https://www.twitter.com/> <https://www.instagram.com/> <https://podcasts.apple.com/> [mailto:email@email.com](mailto:email@email.com)

Copyright © 2026,