Get started
Danfoss developer portal is designed to provide easy access and insight into our API solutions.
On this page, you'll find a short guide on how to get you started with our APIs and allow you to begin integrating our services into your applications.
This guide will cover these main areas:
- Register: Information on setting up an account to get you up and running.
- Find the API: How to use API Catalog.
- Start registering your apps: How to add and enable your apps.
- Authenticate: Method and steps for Authentication.
- Consume an API: How to consume an API of your choice.
- Error handling: An overview of the error-handling model.
- Support: Where to go for questions, queries, answers - were here to help.
Register
By logging into the developer portal, you will gain access to detailed information and documentation for our APIs, access to trial, data delivery options as well as schema(s) and sample code.
Who can register for an account?
- Danfoss employees can log in with their Danfoss SSO to get access to Danfoss internal and external APIs.
- Authorized partners can contact their Danfoss account manager and get access to partners specific APIs.
- If you are interested in our public APIs, you can create your own Danfoss Profile login and start exploring.
Log in to the developer portal
- Log in with your existing Danfoss Profile credentials.
- New user? Click Sign up for a Danfoss Profile and follow prompts to register. With a unified Danfoss Profile you will get easy access to a variety of Danfoss applications.
Find the API you need
You can browse the API catalog based on different filters and categories:
- By target audience: based on your credentials and team assignment, you will be able to choose between component internal, business unit internal, company internal, external partner, and external public.
- By maturity: you can filter between development, alpha, sandbox, and production API versions.
- By capability: these filters will guide you through the content types and research for your business needs to highlight the best suited APIs. Currently we have identified the following groups: customer support, finance, people, products, purchasing, sales, and other.
Registering your apps
- Click on your username in the top right corner and select Apps from the menu. Click »App« to create a new app.
- In the »App details« dialog enter an app's name, callback URL and description.
- Under »Add APIs« look for the APIs you need and enable them.
- Click »Create«.
Authentication
The authentication for an API is done based on the access token. To obtain an access token, you need to call our OAuth API. The authentication mechanism can vary per API depending on the required level of authentication.
Environments
These are the URLs for the endpoints to get the tokens:
- Sandbox: https://e2e.api.danfoss.com/oauth2/token
- Production: https://api.danfoss.com/oauth2/token
OAuth Flows
Our APIs are secured using OAuth 2.0. This means you will need to pass an access token when making your request to the APIs. We use the following three flows for getting an access token: Client credentials, Authorization code flow and Refresh token.
If you want to go more in depth on some of the OAuth protocol, have a look at the OAuth RFC.
Get your access token
- Get client credentials: Log in with your developer account > Go to My Apps in the menu under your username > Add a new App. After you add and save a new App, you will see the generated Key and Secret on the App page:
- Generate base64 token from Client ID and Client Secret, like this (pseudo code):
[base64 encoded token] = Base64Encoder([Client ID] + ":" + [Client Secret])
- Request access token, using cUrl:
curl -X POST -H "Authorization: Basic [add base64 encoded token here]" -H "content-type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "grant_type=client_credentials" https://api.danfoss.com/oauth2/token
You can find more about Client Credentials Grant flow here.
Request data
When you have reached the stage of consuming one of our APIs, follow the steps below:
- Find an API from our documentation section
- Include your token/API key in your request as an Authentication header
- Include your token as a "Bearer" token in the "Authorization" header using cURL.
Example:
curl --location --request GET 'https://api.danfoss.com/ally/devices' --header 'Accept: application/json' --header 'Authorization: Bearer [add bearer token here]'
Try the API
Add Client ID and Client Secret
Fill in example and use the Tryout functionality
Error handling
Error Format
During the course of any API consumption, and in the event of receiving an error, all APIs throw errors are returned in the following JSON format:
{
"type": "https://developer.danfoss.com/error-code-reference",
"title": "title",
"status": error code,
"detail": "error-message",
"message_id": "uuid"
}
Support
Questions or problems? Please check out our FAQ page for the answers to frequently asked questions about the Danfoss developer portal. For questions regarding specific APIs, please refer to the contacts listed on the API page.