title: Dynamics Business 365 Central API and Postman
body: <p>I do appreciate the fact that quite a lot of people have asked about this kind of issue before me (maybe there is a reason for that Microsoft?), but I haven't been able to figure out the solution to my problem from reading those.</p>
  <p>I'm trying to call Dynamics 365 BC API (v.2.0) from Postman (AAD auth) and I have tried to follow the descriptions as best as I can, though they seem to be out of sync in a few places.
  <a href="https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-connect-apps" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-connect-apps</a></p>
  <p>The part where I'm to to authorize and receive a token works fine, though it took some time to get it right and I had to use Fiddler to actually see the error messages. But I got it to work so Postman can now retrieve a token and store it for later use.</p>
  <p>The part that doesn't work is the actual calls to the Dynamics BC API. I keep getting the <strong>401 &quot;Unauthorized&quot;, &quot;The credentials provided are incorrect&quot;</strong>, error when I try to call Dynamics BC API using the token I retrieved.</p>
  <p>I don't know why this happens. Maybe the app is configured wrong or maybe the URL is incorrect, I really don't get it.</p>
  <p>I'm trying to call &quot;https://api.businesscentral.dynamics.com/v2.0/production/api/v2.0&quot; which I believe should give me a list of APIs available to me, but as stated above, 401.</p>
  <p>What could be the reason for this, when I have already successfully retrieved a token from Azure?</p>
  <p><strong>Update 1</strong></p>
  <p>I was exploring the jwt token and got curious about this part, as it could be wrong, unless I'm misunderstanding the description. It says that the &quot;iss&quot; part of the token, should end with &quot;/v2.0&quot; if the token was issued by the v2.0 endpoint, and that doesn't seem to be the case here (see image).</p>
  <p><a href="https://i.stack.imgur.com/0pjR0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0pjR0.png" alt="enter image description here" /></a></p>
  <p>Postman Auth URL I use is: <a href="https://login.microsoftonline.com/98...73/oauth2/v2.0/authorize" rel="nofollow noreferrer">https://login.microsoftonline.com/98...73/oauth2/v2.0/authorize</a></p>
  <p>Postman Access Token URL: <a href="https://login.microsoftonline.com/98...73/oauth2/v2.0/token" rel="nofollow noreferrer">https://login.microsoftonline.com/98...73/oauth2/v2.0/token</a></p>
  <p>So maybe there is an issue here?</p>
  <p><strong>Update 2</strong></p>
  <p>OK, so I changed the scope in Postman to the same as you, and now I get the prompt to grant access to the app by the name I created, so that is good.
  As far as I recall, this about the scope is not mentioned in the guide article, while Postman demands a scope so I created one and used that - obviously that is not correct which ought to be updated in that guide article (Microsoft).</p>
  <p><a href="https://i.stack.imgur.com/2FR40.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2FR40.png" alt="enter image description here" /></a></p>
  <p>However, I'm still getting an odd response, when I try to retrieve the available APIs.</p>
  <pre><code>{
      &quot;error&quot;: {
          &quot;code&quot;: &quot;Internal_CompanyNotFound&quot;,
          &quot;message&quot;: &quot;The specified company ID, 98...73, does not exist.  CorrelationId:  434d...235d.&quot;
      }
  }
  </code></pre>
  <p><strong>Update 3</strong></p>
  <p>Strike that error message, that was for trying to retrieve companies and maybe something is wrong with that request.</p>
  <p>The request for available APIs works now - it seems that en whole problem was about the required scope which wasn't covered by the guide article.</p>
  <p>Thanks for the help Carl! :)</p>
  <p><strong>Update 4</strong></p>
  <p>Something is still odd though. If I try the request mentioned in the guide article to get companies &quot;endpoint/companies&quot;, I get a response with the CRONUS company as expected, but if I then try to call &quot;endpoint/companies(cronus-company-id)/customers&quot; to get the customers for CRONUS, then I get <strong>401 &quot;Unauthorized&quot;, &quot;The credentials provided are incorrect&quot;</strong>. The same happens if I try to get details for CRONUS.
  I don't get why though, since the token was just proven to work...</p>