Get Bearer token for Sustainability APIs in Postman and/or Python

VIPPALA MADHAVA REDDY 50 Reputation points
2023-03-23T12:29:18.7866667+00:00

I'm working on Microsoft Cloud for Sustainability REST APIs. Each of these APIs require a bearer token for authorization except the Metadata API.

For example, I made a GET request on Emissions By Enrollment API and I have my primary and secondary keys (subscription keys) with me. Now, I'm unable to find a way to get a bearer token from these subscription keys. I have tried passing the subscription key in the header, but that did not work as I get this - "401 unauthorized" error. In the response header I am seeing that the Bearer token is required for authorization.

I need a way to get bearer for these sustainability APIs using the subscription keys or any other better way of getting the data from these APIs from Postman and/or Python.

Please help me. Thanks in advance.

IssueScreenshot 2023-03-23 173136

References:

  1. Microsoft Cloud for Sustainability REST API reference
  2. Emissions by Enrollment
Community Center | Not monitored
0 comments No comments
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.