Postman

Postmanarrow-up-right is an API platform for developers to design, build, test and iterate their APIs. Spark makes it easy to test the generated APIs on Postman. Here is how we recommend it can be done!

Upload the following service to Spark to follow along!

file-download
11KB

Exporting the cURL Command from Spark

cURL is a computer software project providing a library (libcurl) and command line tool (curl) for transferring data using various network protocols. Start by exporting the cURL command from Spark to import the API data into Postman.

  1. Go to the API Tester page for the target service.

  2. Click on the Integration tab select Code snippet and choose the curl - cURL option.

  3. At the bottom of the page is the option to copy the snippet or download.

Importing cURL Command into Postman

  1. Open the Postman application.

  2. Click on Import in the workspace.

  3. If the cURL was downloaded as a file, drag the file into Drop anywhere to import.

  4. If the cURL was copied as text, paste the text into the textbox.

Add Authentication to the API Request

Spark provides multiple methods of authentication to be added to an API request.

Bearer token

Pasting bearer token into Postman
  1. Retrieve the bearer token here, see Authorization - Bearer token.

  2. Create a new Authentication header and paste the bearer token from the previous step.

  3. OR Open the API in Postman and open Authentication tab.

    1. Select Bearer token as option.

    2. Remove the word Bearer preceding the Bearer Token paste the field.

API Key manager x-synthetic-key

  1. Generate the API key using the procedure mentioned in Authorization - API keys.

  2. Open the API in Postman and open the Headers tab.

  3. Ensure the x-tenant-name is populated.

  4. Create a new header called x-synthetic-key and use the key that was previously generated.

Pasting x-synthetic-key in Postman

Checking API Response

API response body in Postman
  1. The API request can be sent to Spark by clicking the Send button.

  2. The API response can be checked using the Body tab of the interface.

  3. The response codes (HTTP status codes) generated by Spark can be referenced in Execute API (v3).

Last updated