The EGU Partner Portal provides secure external API access for authorized partners to retrieve turnaround report data programmatically using OAuth2 authentication.
┌─────────────────┐
│ External System │ 1. Request Token
│ (Partner) │────────────────────┐
└─────────────────┘ │
v
┌────────────────┐
│ Azure AD │
│ Validates: │
│ - Credentials │
│ - Role │
└────────┬───────┘
│
│ 2. Issues JWT Token
│ - appid claim
│ - ExternalSystem.Access role
│ - 1 hour expiry
v
┌─────────────────┐
│ External System │ 3. Call API with Token
└────────┬────────┘
│
v
┌────────────────────────────┐
│ Partner Portal API │
│ │
│ ✓ JWT Validation │
│ ✓ Role Check │
│ ✓ Route Restriction │
│ ✓ Company Authorization │
│ │
│ → Query Database │
│ → Return JSON │
└────────────────────────────┘
ExternalSystem.Access role can authenticate/api/external/* endpoints| Item | Value |
|---|---|
| Token URL | https://login.microsoftonline.com/6073ce8b-73f3-4df4-9b80-5e40cdc6965f/oauth2/v2.0/token |
| Client ID | 1f018c75-2ea9-4d46-a4f1-a45d2d47d043 |
| Client Secret | YOUR_CLIENT_SECRET |
| Grant Type | client_credentials |
| Scope | api://4dad5d62-dc8c-4378-8bd0-ae736a4d73fe/.default |
| Content-Type | application/x-www-form-urlencoded |
POST https://login.microsoftonline.com/6073ce8b-73f3-4df4-9b80-5e40cdc6965f/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=1f018c75-2ea9-4d46-a4f1-a45d2d47d043
&client_secret=YOUR_CLIENT_SECRET
&scope=api://4dad5d62-dc8c-4378-8bd0-ae736a4d73fe/.default
Response:
{
"token_type": "Bearer",
"expires_in": 3599,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGci..."
}
Token Lifetime: 1 hour
| Item | Value |
|---|---|
| API Base URL | https://apiservice.gentledesert-fcac7adc.swedencentral.azurecontainerapps.io/api/external |
| Authentication | Authorization: Bearer <token> |
| Content Type | application/json |
Retrieves work order turnaround data with status transitions.
GET /turnaround-report
Query Parameters:
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
companyNumber | string | Yes | Company identifier | SonlincXML3 |
dateFrom | string | No | Start date (YYYY-MM-DD) | 2025-01-01 |
dateTo | string | No | End date (YYYY-MM-DD) | 2025-12-31 |
Request Example:
GET /api/external/turnaround-report?companyNumber=SonlincXML3&dateFrom=2025-01-01&dateTo=2025-12-31
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGci...
Accept: application/json
Response (200 OK):
{
"turnaroundReportItems": [
{
"workOrderID": 1503,
"workOrderNumber": "E261503",
"workOrderTypeID": 1,
"workOrderType": "New Installation",
"consumptionCategoryID": 1,
"consumptionCategoryName": "Apartment",
"preFuseAmpere": 10,
"preFuseTypeID": 1,
"preFuseType": "Switch",
"workOrderStatusID": 2,
"workOrderStatus": "Registration Sent",
"timestamp": "2025-12-20T10:30:00Z"
}
]
}
Response Fields:
| Field | Type | Description |
|---|---|---|
workOrderID | integer | Work order identifier |
workOrderNumber | string | Work order number |
workOrderType | string | Type (e.g., "New Installation") |
consumptionCategoryName | string | Category (e.g., "Apartment") |
preFuseAmpere | integer | Pre-fuse amperage |
preFuseType | string | Pre-fuse type |
workOrderStatus | string | Status (e.g., "Registration Sent") |
timestamp | string | ISO 8601 timestamp |
HTTP Status Codes:
| Code | Description |
|---|---|
200 | Success |
400 | Invalid parameters (e.g., date range > 5 years) |
401 | Missing or invalid token |
403 | Not authorized for this company |
500 | Server error |
Validation Rules:
dateFrom must be ≤ dateToCreate App Registration
PartnerPortal-External-{CompanyName}Generate Client Secret
Assign Permissions
EGU.PartnerPortal.ApiServiceExternalSystem.AccessCompany Mapping (API side configuration)
{
"ExternalCompanies": {
"Ravdex": {
"AppId": "1f018c75-2ea9-4d46-a4f1-a45d2d47d043",
"CompanyNumber": "SonlincXML3",
"Name": "Ravdex"
}
}
}