From a Secured Endpoint

(note: This can only be done once confirmed that client ID provided to the xMart administrator has already been granted the rights to use the specific Mart tables data)

i. Launch Postman Application

ii. Add a new tab to test the API endpoint

img

iii. Choose “GET” method

iv. Type in the API endpoint of where you want to fetch the data from xMart

img

v. Click on the “Authorization” tab

vi. Choose from “Type” list “OAuth 2.0”

img

vii. Make sure the on the next window the “Add authorization data to” is in “Request Headers”

viii. Choose the necessary picks from the list and fill in the fields required on the tab “Configuration Options”

  1. Access Token: “Available Token”

  2. Header Prefix: “Bearer”
  3. Token Name: [Choose a name you prefer]

  4. Grant Type: “Client Credentials”

  5. Access Token URL: https://login.microsoftonline.com/f610c0b7-bd24-4b39-810b-3dc280afb590/oauth2/token

  6. Client ID: [Your app client ID that was given to the xMart Mart administrator]

  7. Client Secret: [Your client secret value for the client ID given]

  8. Scope: “api://b85362d6-c259-490b-bd51-c0a730011bef/odata”

  9. Client Authentication: “Send client credentials in body”

    Example:

img

ix. On the tab “Advanced Options” fill the “Resource” field with value “b85362d6-c259-490b-bd51-c0a730011bef”

img

x. Click on “Get New Access Token”

img

xi. On the next popup window click “proceed” or wait for it to automatically close

xii. On the “MANAGE ACCESS TOKEN” popup window, click “USE TOKEN” (This will copy the Access Token to the Authorization Access Token Field)

img

(DO NOT REPLACE THE VALUE HERE BUT IF TOKEN EXPIRED PLEASE REPEAT FROM STEP 6 ONWARDS)

img

xiii. Click on “Send” Button

img

xiv. On the response window, you should receive a Status: 200 OK and the Response json

img