Hello,
In Postman you can add the following:
1. Add New collection:
Type: OAUTH 2.0
Add auth data to: Request Headers
Access Tokens: Available Tokens
Header Prefix: Bearer
Token Name: S2S OAUTH2
Grant Type: Authorization Code
Callback Url: {{PublicWebBaseUrl}}/OAuthLanding.htm
Authorize URL: login.microsoftonline.com/.../authorize
Access Token URL: login.microsoftonline.com/.../token
Client ID: {{CLIENTID}}
Client Secret: {CLIENTSECRET}}
Scope: {{SCOPE}} //NOTE THAT {SCOPE}} is a variable defined in postman: https : // api.businesscentral.dynamics.com/.default) (without the additional spaces to prevent reformatting of the url)
Client Authentication: Send client credentials in body
NOTE: add environmental values in Postman and add actual values for SCOPE, ClientID, etc.
In BC210, you need to specify values in ValidAudiences:
Set-NAVServerConfiguration -ServerInstance $ServerInstance -KeyName "ValidAudiences" -KeyValue "api.businesscentral.dynamics.com; {{PublicWebBaseUrl}}; {{CLIENTID}}"
NOTE: replace everything between {{}} with your own values within Set-NavServerConfiguration
2. Then add a tab with "Get" and ensure Type is set to inherit from parent.
https : //{{PUBLICODATABASEURL}}/ODataV4/Company('{{COMPANYNAME}}') //(without the additional spaces)
Result should be like this (example):
{
"@odata.context": "d365bc.melsbergmans.nl:21048/.../$metadata
"Name": "CRONUS International Ltd.",
"timestamp": 152313,
"Evaluation_Company": false,
"Display_Name": "",
"Id": "97bf99d2-d83a-ed11-bbaa-6045bd8e54cb",
"Business_Profile_Id": "",
"SystemCreatedAt": "2022-09-23T00:44:04.9Z",
"SystemCreatedBy": "00000000-0000-0000-0000-000000000001",
"SystemModifiedAt": "2022-09-23T00:44:04.9Z",
"SystemModifiedBy": "00000000-0000-0000-0000-000000000001"
}
Hope it helps.