API Tokens
API Tokens let external systems connect to the OpenMES REST API. Create tokens for ERP platforms, BI tools, mobile apps, and automation scripts.
Creating a Token
To create a new API token:
- Navigate to Settings → API Tokens.
- Enter a clear, descriptive name for the token (e.g., "ERP Sync", "Power BI Reports", "Mobile App").
- Click Create Token.
- Copy the token string immediately – it is displayed only once and cannot be retrieved later.
Security Best Practice: Create separate tokens for each integration. If a token is compromised, you can revoke it without disrupting other systems. Never share tokens via email or chat – use a secure secrets manager.
How to Use
Include the token in the Authorization header of every API request as a Bearer token:
POST /api/v1/work-orders HTTP/1.1
Host: your-openmes-instance.com
Authorization: Bearer YOUR_TOKEN_HERE
Content-Type: application/json
All standard REST API endpoints accept Bearer token authentication. Refer to your instance's API documentation for available endpoints and request formats.
Power BI Integration: When connecting Power BI to OpenMES, use the API token as the Bearer credential in the Web data source connector. This allows Power BI to pull production data directly for real-time dashboards and reports.
Managing Tokens
The API Tokens page lists all active tokens with their names and creation dates. From this list you can:
- View active tokens – See which tokens exist and when they were created. The token string itself is not shown after creation.
- Revoke a token – Click the revoke button next to any token to immediately invalidate it. Any system using that token will lose API access.
OpenMES