Getting Started¶
The Siemens Building X APIs let you retrieve real-time information from your building, including devices, points, events, and energy data. This guide walks you through everything you need to make your first API call.
!!! note
For the LifecycleTwin API, refer to the [LifecycleTwin Getting Started page](../api/lifecycletwin-api/quickstart.md) instead.
Step 1: Get Your Credentials¶
Choose the path that matches your situation:
- Log in to API Manager. To access API Manager you need to have
API Manager BasicorAPI Manager Advancedrole. Go to Machine Users and create a new machine user with user groups access based on the APIs you need:
Role API Access Access Level Operations API Machine User Read Operations API Read Operations API Machine User Read+Write Operations API Read + Write Structure API Machine User Read Structure API Read Structure API Machine User Read+Write Structure API Read + Write Point Value Ingest API Machine User Write Point Value Ingest API Write Geometry API read Geometry API Read Geometry API read+write Geometry API Read + Write Energy API Machine User Read Energy API Read Sustainability API Machine User Read Sustainability API Read Identities & Privileges API read Identities & Privileges API Read Identities & Privileges API read+write Identities & Privileges API Read + Write Activities API read Activities API Read Security Workflows API read & write Security Workflows API Read + Write Security Monitoring API read Security Monitoring API Read Visitor Manager API read & write Visitor Manager API Read + Write Intrusion API Machine User Read+Write Intrusion API Read + Write Note down the
clientIdandclientSecret.
Note
You need the API Manager Basic or API Manager Advanced and Machine User Administrator role to perform these steps. If you cannot see the Machine Users menu, contact the administrator in your organization.
You can use our sandbox environment in a read-only mode to explore the APIs:
- Request access via the developer dashboard. Credentials are granted immediately.
- View your credentials on the My Credentials page. Note down the
clientIdandclientSecret.
Note
The Fire, LifecycleTwin and Physical Security domain APIs are not part of the sandbox environment yet. Please use Contact Us to explain your use case and request access.
Step 2: Authenticate and Make Your First Call¶
- In the API Manager go to the API documentation page, select your machine user and partition, then generate the token by providing the client secret key.
- You are ready to call the APIs! Select the APIs of interest from the navigation below and try out your first calls.
Use your clientId and clientSecret to request an authorization token:
export CLIENT_ID=<YOUR_CLIENT_ID>
export CLIENT_SECRET=<YOUR_CLIENT_SECRET>
curl https://siemens-bt-015.eu.auth0.com/oauth/token \
-H 'content-type: application/json' \
-d "{
\"client_id\": \"$CLIENT_ID\",
\"client_secret\": \"$CLIENT_SECRET\",
\"audience\": \"https://horizon.siemens.com\",
\"grant_type\": \"client_credentials\"
}"
If the request is successful, you will receive a response like this:
{
"access_token": "eyJ0eXAiOiUSJ9.eyJpc3MiOiJdGlhbHMifQ.MJpcxLfyOt",
"token_type": "Bearer",
"expires_in": 86400
}
The access_token value is your API token (a JWT). The expires_in property indicates how long the token is valid, typically 24 hours. After it expires, repeat this step to get a new one.
Warning
Store your token securely. Never share it or commit it to source control. Anyone with your token can access the system on your behalf.
Make your first API call¶
Pass the token in the Authorization header of your API requests. For example, to list devices using the Operations API:
export TOKEN=eyJ0eXAiOiUSJ9.eyJpc3MiOiJdGlhbHMifQ.MJpcxLfyOt
export PARTITION=1bcaafc3-d4d3-43e1-ab64-89d8518d5951
curl -H "Authorization: Bearer $TOKEN" "https://eu.buildingx.siemens.com/api/openness/operations/partitions/$PARTITION/devices"
Tip
Don't know your partition ID? Use the Accounts API to retrieve it.
Next Steps¶
- Integration Guide -- understand the data model and follow the step-by-step onboarding flow with a Postman collection.
- Try Out APIs -- explore all available APIs interactively from the Developer Portal.
- Developer's Guide -- learn about filtering, pagination, error handling, and other API conventions.
- Are you interested in obtaining a customer account or connecting your building? Contact Siemens Regional Support.