Skip to main content

Quick start with Postman

Postman is a popular API client that simplifies the process of working with APIs. With its user-friendly interface and robust features, Postman makes it easy to send requests, analyse responses and collaborate with others. In this article, we will take you through a step-by-step guide on how to connect to the ApprovalMax public API using Postman, covering everything from creating an app to generating tokens to making API requests. Whether you're a seasoned developer or just beginning, this guide will help you get started with using the ApprovalMax public API in no time.

Requirements

  • An applicaiton created in ApprovalMax My Applications
  • Postman (desktop or web)

Create your application in My Applications

To establish connection, you need to register your application in ApprovalMax My Applications. If you do not have an app yet, please refer to this article.

warning

Enter https://oauth.pstmn.io/v1/callback as the redirect URL. This is crucial for receiving your token in Postman.

Download and install the Postman application

To download the latest version of the Postman desktop application, visit the Download Postman page and choose the appropriate option for your operating system. Additionally, Postman offers a web app accessible on go.postman.co/home, which allows you to perform your API calls directly in your web browser.

note

Some features may not be available in the web app. So, for the full range of Postman capabilities, it is recommended to use the desktop application.

For more details on Postman installation steps, please refer to the official step-by-step guide.

Import a JSON collection and set up authorisation

Once you are done with the app installation, you have to import .json collection into Postman. For this follow the steps below:

  1. Click on the Import button:

Press "Import" button to open a pop-up

  1. In the Import pop-up, paste the URL https://public-api.approvalmax.com/swagger/v1/swagger.json of the JSON collection:

Enter URL to import collection

  1. Click on the Import button:

Confirm importing collection

After importing the collection into Postman, you will need to do some fine-tuning.

Set up the Postman collection

Once imported, you will need to update the collection with additional information to ensure a seamless execution. This step involves making adjustments to variables and authorisation settings.

  1. Click on the three-dot menu next to the collection name and select "Edit":

Press the "Edit" button to set up authorisation

  1. In the opened window, click on the Authorization tab and fill in the following data:
    • Specify the authorisation type as OAuth 2.0
    • In the Callback URL field, enable the Authorize Using Browser option by activating the checkbox
    • Enter your application's client-id (generated in My Applications) in the Client ID field
    • Enter your application's client-secret (generated in My Applications) in the Client Secret" field
    • In the Scope field, specify the desired scopes for your application to operate within your Organisations. All available default scopes are pre-entered here:

Fill in data in Authorization tab

note

All available scopes are prepopulated by default. For more information about scopes, please refer to scopes.

note

When using Public API Write and Public API Read scopes in Postman, ensure that they match the scopes you configured for your application in My Applications. If the scopes in your Postman request do not align with the scopes set up in My Applications, the request will be denied.

In other words, the scopes you specify in Postman must be a subset of the scopes you configured for your application in My Applications. If there is a mismatch, the authorisation will fail and the request will be denied.

  1. Click on the Variables tab and paste the URL https://public-api.approvalmax.com/ in the columns Initial Value and Current Value of the baseUrl variable:

Fill in data in Variables tab

  1. Once you have entered all data, click on Save to apply the changes.

Generate your token

With your collection in place, you are ready to obtain a token for authenticating with the ApprovalMax Public API. For this, follow these steps:

  1. Navigate to the Authorisation tab. Scroll down and click on the Get New Access Token button. This will redirect you to your browser:

Press the "Get New Access Token" button to receive a new token

  1. On the Consent page, grant access to proceed:

Choose organisations you want to grant access to and confirm it by clicking the button "Grant Access"

  1. After granting access, click on Open Postman in the pop-up window to redirect to the application:

Move back to the Postman application to proceed

  1. A small pop-up will appear in Postman. Click on the Proceed button to continue:

Proceed to use Access Token

  1. In the Manage Access Token window, click on the Use Token button to start using the newly obtained access token:

Click the button "Use Token" to use the token

Make your first API Call

Now that everything is set up, try calling the /companies endpoint to see it in action:

  1. Double-click the /companies endpoint.

  2. In the opened tab, click on the button Send and wait for the response.

Make your first call