Share Dashboards Securely
Generate shareable URLs, manage access permissions, and control dashboard visibility.
GET /api/
Get Shareable URLs
Generates and retrieves shareable URLs for a dashboard, including public view links and embeddable iframe URLs.
Parameters
| Parameter | Type | Location | Description |
|---|---|---|---|
tenantId |
GUID | Path | The tenant identifier |
projectId |
GUID | Path | The project identifier |
dashboardId |
GUID | Path | The dashboard identifier |
includePublic |
boolean | Query | Include public access URLs (default: false) |
Response
{
"dashboardId": "550e8400-e29b-41d4-a716-446655440000",
"dashboardName": "Process Performance Dashboard",
"urls": {
"authenticated": "https://your-instance.com/dashboard/550e8400-e29b-41d4-a716-446655440000",
"embed": "https://your-instance.com/embed/dashboard/550e8400-e29b-41d4-a716-446655440000",
"public": "https://your-instance.com/public/dashboard/550e8400-e29b-41d4-a716-446655440000?token=abc123",
"publicEmbed": "https://your-instance.com/public/embed/dashboard/550e8400-e29b-41d4-a716-446655440000?token=abc123"
},
"permissions": {
"publicAccess": false,
"embeddingEnabled": true,
"expirationDate": "2024-12-31T23:59:59Z"
}
}
POST /api/
Create Public Share Link
Creates a public access link for a dashboard with configurable permissions and expiration settings.
Request Body
{
"permissions": {
"allowPublicAccess": true,
"allowEmbedding": true,
"allowDownload": false,
"allowPrint": true
},
"expiration": {
"enabled": true,
"expirationDate": "2024-12-31T23:59:59Z"
},
"accessControl": {
"requirePassword": false,
"password": "",
"allowedDomains": ["company.com", "partner.org"]
}
}
Response
{
"shareId": "abc123def456",
"publicUrl": "https://your-instance.com/public/dashboard/550e8400-e29b-41d4-a716-446655440000?token=abc123def456",
"embedUrl": "https://your-instance.com/public/embed/dashboard/550e8400-e29b-41d4-a716-446655440000?token=abc123def456",
"permissions": {
"allowPublicAccess": true,
"allowEmbedding": true,
"allowDownload": false,
"allowPrint": true
},
"expiration": {
"enabled": true,
"expirationDate": "2024-12-31T23:59:59Z"
},
"dateCreated": "2024-01-15T10:30:00Z"
}
PUT /api/
Update Share Settings
Updates permissions, expiration, and access control settings for an existing share link.
Request Body
{
"permissions": {
"allowEmbedding": false,
"allowDownload": true
},
"expiration": {
"expirationDate": "2025-06-30T23:59:59Z"
}
}
Response
Returns the updated share link object with the same structure as the creation response.
DELETE /api/
Revoke Share Link
Permanently disables a public share link, making it inaccessible immediately.
Response Codes
204 No Content- Share link revoked successfully404 Not Found- Share link not found403 Forbidden- Insufficient permissions to revoke
GET /api/
List Share Links
Retrieves all active share links for a dashboard with their current settings and usage statistics.
Response
{
"dashboardId": "550e8400-e29b-41d4-a716-446655440000",
"shares": [
{
"shareId": "abc123def456",
"publicUrl": "https://your-instance.com/public/dashboard/550e8400-e29b-41d4-a716-446655440000?token=abc123def456",
"permissions": {
"allowPublicAccess": true,
"allowEmbedding": true,
"allowDownload": false
},
"expiration": {
"enabled": true,
"expirationDate": "2024-12-31T23:59:59Z"
},
"usage": {
"totalViews": 247,
"uniqueVisitors": 89,
"lastAccessed": "2024-01-20T14:30:00Z"
},
"dateCreated": "2024-01-15T10:30:00Z"
}
]
}
Dashboard Embedding
mindzieStudio dashboards can be embedded in external applications using iframe technology:
Basic Embedding
<iframe
src="https://your-instance.com/embed/dashboard/550e8400-e29b-41d4-a716-446655440000"
width="100%"
height="600"
frameborder="0"
allowfullscreen>
</iframe>
Embedded with Parameters
<iframe
src="https://your-instance.com/embed/dashboard/550e8400-e29b-41d4-a716-446655440000?theme=dark&toolbar=false&filters=hidden"
width="100%"
height="600"
frameborder="0"
allowfullscreen>
</iframe>
Embedding Parameters
| Parameter | Values | Description |
|---|---|---|
theme |
light, dark | Dashboard color theme |
toolbar |
true, false | Show/hide dashboard toolbar |
filters |
visible, hidden | Display filter controls |
refresh |
auto, manual | Data refresh behavior |
Security and Access Control
Dashboard sharing includes comprehensive security features:
Access Control
Control who can access shared dashboards.
- Domain-based restrictions
- Password protection
- IP address filtering
Time-based Expiration
Set automatic expiration for share links.
- Custom expiration dates
- Automatic revocation
- Usage limit controls
Usage Monitoring
Track and monitor dashboard access.
- View count tracking
- Unique visitor analytics
- Access time logging
Permission Granularity
Fine-grained control over user actions.
- View-only access
- Download restrictions
- Print permissions
JavaScript Example: Share Management
class DashboardSharing {
constructor(baseUrl, tenantId, projectId, token) {
this.baseUrl = baseUrl;
this.tenantId = tenantId;
this.projectId = projectId;
this.headers = {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
};
}
async getShareableUrls(dashboardId, includePublic = false) {
const url = `${this.baseUrl}/api/${this.tenantId}/${this.projectId}/dashboard/${dashboardId}/url?includePublic=${includePublic}`;
const response = await fetch(url, {
headers: this.headers
});
return await response.json();
}
async createPublicShare(dashboardId, settings) {
const url = `${this.baseUrl}/api/${this.tenantId}/${this.projectId}/dashboard/${dashboardId}/share`;
const response = await fetch(url, {
method: 'POST',
headers: this.headers,
body: JSON.stringify(settings)
});
return await response.json();
}
async updateShareSettings(dashboardId, shareId, updates) {
const url = `${this.baseUrl}/api/${this.tenantId}/${this.projectId}/dashboard/${dashboardId}/share/${shareId}`;
const response = await fetch(url, {
method: 'PUT',
headers: this.headers,
body: JSON.stringify(updates)
});
return await response.json();
}
async revokeShare(dashboardId, shareId) {
const url = `${this.baseUrl}/api/${this.tenantId}/${this.projectId}/dashboard/${dashboardId}/share/${shareId}`;
const response = await fetch(url, {
method: 'DELETE',
headers: this.headers
});
return response.status === 204;
}
async listShares(dashboardId) {
const url = `${this.baseUrl}/api/${this.tenantId}/${this.projectId}/dashboard/${dashboardId}/shares`;
const response = await fetch(url, {
headers: this.headers
});
return await response.json();
}
}
// Usage example
const sharing = new DashboardSharing(
'https://your-mindzie-instance.com',
'tenant-guid',
'project-guid',
'your-token'
);
// Create a public share with restrictions
const shareSettings = {
permissions: {
allowPublicAccess: true,
allowEmbedding: true,
allowDownload: false,
allowPrint: true
},
expiration: {
enabled: true,
expirationDate: '2024-12-31T23:59:59Z'
},
accessControl: {
allowedDomains: ['company.com']
}
};
sharing.createPublicShare('dashboard-guid', shareSettings)
.then(result => {
console.log('Public URL:', result.publicUrl);
console.log('Embed URL:', result.embedUrl);
});
Python Example: Dashboard Sharing
import requests
import json
from datetime import datetime, timedelta
class DashboardSharing:
def __init__(self, base_url, tenant_id, project_id, token):
self.base_url = base_url
self.tenant_id = tenant_id
self.project_id = project_id
self.headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
def get_shareable_urls(self, dashboard_id, include_public=False):
"""Get all shareable URLs for a dashboard"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/dashboard/{dashboard_id}/url"
params = {'includePublic': include_public}
response = requests.get(url, headers=self.headers, params=params)
return response.json()
def create_public_share(self, dashboard_id, permissions=None, expiration_days=30, allowed_domains=None):
"""Create a public share link with default settings"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/dashboard/{dashboard_id}/share"
# Default settings
expiration_date = (datetime.now() + timedelta(days=expiration_days)).isoformat() + 'Z'
payload = {
'permissions': permissions or {
'allowPublicAccess': True,
'allowEmbedding': True,
'allowDownload': False,
'allowPrint': True
},
'expiration': {
'enabled': True,
'expirationDate': expiration_date
},
'accessControl': {
'allowedDomains': allowed_domains or []
}
}
response = requests.post(url, json=payload, headers=self.headers)
return response.json()
def list_shares(self, dashboard_id):
"""List all active shares for a dashboard"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/dashboard/{dashboard_id}/shares"
response = requests.get(url, headers=self.headers)
return response.json()
def revoke_share(self, dashboard_id, share_id):
"""Revoke a public share link"""
url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/dashboard/{dashboard_id}/share/{share_id}"
response = requests.delete(url, headers=self.headers)
return response.status_code == 204
def generate_embed_code(self, dashboard_id, theme='light', toolbar=True, filters='visible'):
"""Generate HTML embed code for a dashboard"""
urls = self.get_shareable_urls(dashboard_id, include_public=True)
embed_url = urls.get('urls', {}).get('embed', '')
# Add parameters
params = []
if theme != 'light':
params.append(f'theme={theme}')
if not toolbar:
params.append('toolbar=false')
if filters != 'visible':
params.append(f'filters={filters}')
if params:
embed_url += '?' + '&'.join(params)
embed_code = f'''<iframe
src="{embed_url}"
width="100%"
height="600"
frameborder="0"
allowfullscreen>
</iframe>'''
return embed_code
# Example usage
sharing = DashboardSharing(
'https://your-mindzie-instance.com',
'tenant-guid',
'project-guid',
'your-auth-token'
)
# Create a public share for company domains
share = sharing.create_public_share(
'dashboard-guid',
expiration_days=90,
allowed_domains=['mycompany.com', 'partner.org']
)
print(f"Public URL: {share['publicUrl']}")
print(f"Share ID: {share['shareId']}")
# Generate embed code
embed_code = sharing.generate_embed_code('dashboard-guid', theme='dark', toolbar=False)
print("Embed code:")
print(embed_code)