Postman Collection

Overview

Smile ID offers a Postman collection as a convenient way to test our Rest API endpoints without having to write code. Postman is a standalone tool that lets you test API functionality by sending requests and receiving response, Postman handles the HTTP client infrastructure code. This article is a comprehensive step-by-step guide to setting up your Postman and Smile ID Postman Collection, to enable you explore and test Smile ID Rest APIs.

  • The Smile ID Postman Collection URL is here and the import method in Postman is Link.

Getting Started

  1. Install Postman

  2. Import the Smile ID Postman Collection

  3. Configure Smile ID Postman Collection

1. Installing Postman

Postman is available on Linux, Mac and Windows. The tool can be downloaded from the Postman website. Launch the tool after installation, you should see a user interface similar to the one below:

2. Importing the Smile ID Postman Collection

  1. Click on Import

  2. Select Link as the import option

  3. Copy and paste the Smile ID Postman Collection Url in the Enter a URL field

  4. Click Continue to import the collection

  5. We have named the collection Smile ID Product Endpoints.

3. Configuring Smile ID Postman Collection

To use the collection, you need to specify your partner_id , signature api_key and callback_url in the collection variables.

You can get both your partner_id and signature api_key in your Smile ID portal. Ensure you copy the api_key of the environment you intend to test the collection in.

To quickly see and examine how Smile ID responses returned to your callback looks, you can generate a free webhook url using the Webhook Tester tool. You can use the url you generate as yourcallback_url.

Setting the Collection Variables

  1. Click the options icon ... next to the Smile ID Product Endpoints collection

  2. Select Edit

  3. Select Variables to edit the collection variables

  4. Set your partner ID in the initial value field of the variable partner_id

  5. Set your signature api key in the initial value field of the variable api_key

  6. Set your callback url in the initial value field of the variable callback_url

  7. Click on Reset All

  8. Click Save to store the values you inputted for each of the variables

  9. Ensure you leave all other variables unchanged

You do not need to set the signature and timestamp variables as there are scripts we have added in the collection that calculates them automatically. You can generate your signature and timestamp using any of our provided sample codes, in the language of your choice.

Using the Smile ID Postman Collection

Understanding the Structure of the Collection

The collection contains sub-folders, each representing a Smile ID product. Within the sub-folders are the sets of requests to run a successful job for that product.

Testing Sandbox or Production Requests

You can run both Sandbox and Production requests using the Smile ID postman collection. The base urls for the Sandbox and Production environments have been pre-set as variables in the collection.

Test Sandbox Requests

Set the base_url variable in the request url section to {{sandbox}}

Test Production Requests

Set the base_url variable in the request url section to {{prod}}

Running a Request

  1. Choose your Product of choice and select the first endpoint that is not marked OPT

  2. Navigate to Body in the Postman interface

  3. Set the appropriate values for each of the keys that are contained in the body section of the endpoint. Do not set values for any key with a {{xxxx}} in the value section as these are set automatically by the collection. For ID information, not all the keys in the body of the endpoint are required, you can get the list of required keys per ID Type here.

  4. Switch to the environment you want to run tests in - Sandbox is {{sandbox}} while Production is {{prod}}

  5. Click on Send to send your request

Your response is either displayed on Postman or in the cases of products that require a callback_url to your callback url.

Running the Requests in the Correct Order

It is important that you run the requests in the order in which they are arranged in the collection sub-folders, since some of the data returned by one request may be used by the next.

Any request marked OPT e.g. OPT`` Request Name is optional and that request can be skipped.

Collection Endpoints

Last updated