title: How to get a list of users from azure graph API
body: <p>I am trying to get a list of users from azure ad using graph api. I have got the access token by using the below query:</p>
  
  <pre><code>https://login.microsoftonline.com/&lt;tenant-Id&gt;/oauth2/token
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ABSeH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ABSeH.jpg" alt="enter image description here"></a></p>
  
  <p>I got below response:</p>
  
  <pre><code>{
      "token_type": "Bearer",
      "expires_in": "3600",
      "ext_expires_in": "3600",
      "expires_on": "1559555742",
      "not_before": "1559551842",
      "resource": "https://graph.microsoft.com",
      "access_token": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFBQUFEQ29NcGpKWHJ4VHE5Vkc5dGUtN0ZYUy1XcWZRa2RmUmVnSVJfWE4yLXdYSFZwLXJKdlltcWVzTzAwSmd1V2dJOVVQUVBWbldScjhtZjM1SHhXblhFcWhIMVlWY1Y2NlYS00ZTE1LTQ0NWEtOTM0Ni02YTBhOGQxN2UxOTYvIiwib2lkIjoiYzE0YzFlYmEtYzExMS00ZmMxLTllYjAtYTJmNGMwNjg4MDEyIiwic3ViIjoiYzE0YzFlYmEtYzExMS00ZmMxLTllYjAtYTJkKgCbMg5jElY2I83cKpRos6Jti3SUYIVTYiyF__gMsKzCQWgRZFUWnTi7syaypCrPEExPw_OMRJMNMOrYixTBZjwUi0H6ThGNxQOMt5mXhzvlVYRMdyChdmv4r2-JK-LX9yjBN8BWG78e3FYhWQCRERh5H3zNpdX1ln79QY38mhn-XJViA2vX-VCYqZhoUo-c_iR-_HZ3CLCHxRxgRHtT_oGXuX1Kegxo3F6FsuQ2Vj1WT5VjCRGCi71pY_lU_EROzkLdefS84fur4jBawvd1ccCf8u9U0kYy3xu0m02wNxKPe2Weg"
  }
  </code></pre>
  
  <p>Once I have the token, I am referring to this <a href="https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&amp;tabs=cs" rel="nofollow noreferrer">link</a> and using below url to get the user list:</p>
  
  <p><a href="https://graph.microsoft.com/v1.0/users" rel="nofollow noreferrer">https://graph.microsoft.com/v1.0/users</a></p>
  
  <p>and also passing the token in header but getting below error:</p>
  
  <pre><code>{
      "error": {
          "code": "InvalidAuthenticationToken",
          "message": "CompactToken parsing failed with error code: 80049217",
          "innerError": {
              "request-id": "f03e6cc4-1888-406d-9ee4-2558b96e7fb4",
              "date": "2019-06-03T09:22:30"
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sLjl1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sLjl1.jpg" alt="enter image description here"></a></p>
  
  <p>I am doing this from postman as of now but later have to do it from python script. Can anyone please suggest what is wrong here. Thanks</p>