Using Postman

Medium

Postman is a toolset for API testing. It is a development environment that lets you create, test, manage, and publish API documentation.

Working with requests in Postman consists of the following general stages:

  • Adding a request
  • Setting up the request
  • Executing the request
  • Saving the request

A collection of requests lets you execute several requests consecutively. Any collection of requests to Creatio must include a POST request to AuthService.svc and a user request for working with data. Using collections facilitates faster testing of large sets of requests.

Working with collections of requests in Postman consists of the following general stages:

  • Adding a collection of requests
  • Adding requests to the collection
  • Setting up variables for the request collection
  • Executing the collection of requests

We recommend using Postman for testing queries when developing integrations with Creatio via OData 3 or OData 4. More information about working with Postman is available in the Postman documentation.

Working with requests in Postman
Medium

Adding a request 

There are two ways of adding a request in Postman:

  • Open the Create New tab, then in the Building blocks click New –> Request.
    scr_New_button_Building_blocks.gif
  • In the dropdown menu of the New button, click Request.
    scr_New_button_Request.png

Populate the fields in the new request window:

New request fields
Field name Description
Request name The name of the new request.
Request description (Optional) Additional information about the request (optional).
Search for a collection or folder Search for an earlier created collection of requests, or create a new one.
New request window
scr_CreateRequestWindow.png

Populate the fields and click Save. The button becomes active only after the Search for a collection or folder field is populated.

Setting up the request 

To set up the request:

  1. Select the request method.
    src_Method_Choosing.png
  2. Enter the request string.
  3. Set the data format of the request. Go to the Body tab, select the “raw” option and JSON type.
    scr_Request_Type.gif
  4. Populate the request body for POST and PATCH methods.
  5. Go to the Headers tab and set the headers.
    Headers
    Accept: application/json
    Content-Type: application/json; charset=utf-8
    ForceUseSession: true
    

Executing the request 

To execute a request, click Send.

scr_Send_button.png

Saving the request 

To save a request, click Save.

scr_Save_button.png

We recommend using Postman for testing queries when developing integrations with Creatio via OData.

Working with request collections in Postman
Medium

Adding a collection of requests 

There are two ways of adding a collection of requests in Postman:

  • Click New –> Collection in the Building blocks of the Create new tab.
    scr_Collection_button_Building_blocks.gif
  • In the dropdown menu of the New button, click Collection.
    scr_New_button.png
  • On the Collections tab, click + New Collection.
    scr_New_Collection_button.png

Populate the fields in the new collection window:

Fields of the new request collection window
Field name Description
Name The name of the collection.
Description The description of the collection.
New collection window
scr_CreateCollectionWindow.png

Click Create.

Adding requests to the collection 

There are two ways of adding a request to a collection in Postman:

  • Drag and drop an existing request to the collection.
  • Right-click the name of an earlier created collection, then click Add Request.
    scr_AddRequestInCollection.gif

Setting up variables for the request collection 

Collections enable setting up common variables and parameters for all requests that it contains. To set the collection variables:

  1. Right-click an earlier created collection.
  2. Click Edit, then go to the Variables tab.
    scr_VariablesSettings.gif
  3. Create the following variables for the collection:
    Collection variables
    Variable name Description
    BaseURI Creatio application URL.
    UserName Creatio application user name.
    UserPassword Creatio application user password.
    BPMCSRF CSRF protection token.
    CollectionName Object collection (database table) name.

Variable values in the Initial value and Current value must be duplicated.

Executing the collection of requests 

To execute a collection of requests:

  1. Click scr_RunCollection_button.png next to the collection name.
  2. Click Run.
    scr_Run_button.png
  3. In the Run order block, select requests to run and set their order (1).
    scr_RequestOrder.png
  4. Select the Save responses checkbox (2).
  5. Click Run (3).

Getting data of the request structure elements and the response:

  • Click the request name.
    scr_RequestElements.png
  • Click View –> Show Postman Console or press Alt+Ctrl+C on the keyboard.
    scr_PostmanConsole.gif

    Select the needed item.