Could you please tryout in Postman to see if it works for you? Here is a collection you can use as a template for the requests (it is not possible to upload a .json file here, so please copy the text into a textfile and change the file format to .json)
Let me know if it works for you. Otherwise I am happy to send you the Postman collection via mail.
{ "info": { "_postman_id": "64e6ad3a-b1dd-4fef-995b-a23972fc3fab", "name": "VIessmann API - Authentication", "description": "This is a Postman collection for the Viessmann API. It contains the following section:\n\n* Authentication\n \n\nFor general steps to get started, please go to the API documentation page 'getting started': [https://documentation.viessmann.com/static/get-started](https://documentation.viessmann.com/static/get-started)", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Authorization request", "request": { "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "url": { "raw": "https://iam.viessmann.com/idp/v2/authorize?client_id={{client_id}}&redirect_uri=http://localhost:4200/&response_type=code&code_challenge={{code_challenge}}&scope=IoT User offline_access", "protocol": "https", "host": [ "iam", "viessmann", "com" ], "path": [ "idp", "v2", "authorize" ], "query": [ { "key": "client_id", "value": "{{client_id}}" }, { "key": "redirect_uri", "value": "http://localhost:4200/" }, { "key": "response_type", "value": "code" }, { "key": "code_challenge", "value": "{{code_challenge}}" }, { "key": "scope", "value": "IoT User offline_access" } ] }, "description": "The /authorize endpoint of our IAM platform is used to request an authorization code." }, "response": [] }, { "name": "Authorization code exchange", "request": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "urlencoded", "urlencoded": [] }, "url": { "raw": "https://iam.viessmann.com/idp/v2/token?grant_type=authorization_code&client_id={{client_id}}&redirect_uri=http://localhost:4200/&code_verifier={{code_challenge}}&code={{code}}", "protocol": "https", "host": [ "iam", "viessmann", "com" ], "path": [ "idp", "v2", "token" ], "query": [ { "key": "grant_type", "value": "authorization_code" }, { "key": "client_id", "value": "{{client_id}}" }, { "key": "redirect_uri", "value": "http://localhost:4200/" }, { "key": "code_verifier", "value": "{{code_challenge}}" }, { "key": "code", "value": "{{code}}" } ] }, "description": "With the authorization code you can request an access token." }, "response": [] }, { "name": "Authorization code exchange - with Refresh Token", "request": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "urlencoded", "urlencoded": [] }, "url": { "raw": "https://iam.viessmann.com/idp/v2/token?client_id={{client_id}}&grant_type=refresh_token&refresh_token={{refresh_token}}", "protocol": "https", "host": [ "iam", "viessmann", "com" ], "path": [ "idp", "v2", "token" ], "query": [ { "key": "client_id", "value": "{{client_id}}" }, { "key": "grant_type", "value": "refresh_token" }, { "key": "refresh_token", "value": "{{refresh_token}}" } ] }, "description": "With the authorization code you can request an access token." }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }
... Mehr anzeigen