Working with request collections in Postman
Glossary Item Box
Introduction
Postman is a toolset for API testing. It is a development environment that lets you create, test, manage, and publish API documentation.
A collection of requests lets you execute several requests consecutively. Any collection of requests to Creatio must include a POST request to AuthService.svc (Creatio’s authentication service) 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 request collections
Adding a collection of requests
There are two ways of adding a collection of requests in Postman:
- Open the [Create new] tab, then in the [Building blocks] click [New] –> [Collection] (Fig. 1).
Fig. 1. Adding a collection
- In the dropdown menu of the [New] button, click [Collection] (Fig. 2).
Fig. 2. Clicking [New] –> [Collection]
- On the [Collections] tab, click [+ New Collection] (Fig. 3).
Fig. 3. Adding a new collection
Populate the fields in the new collection window (Fig. 4), see table 1:
Table 1. Fields of the new request collection window
Field name | Description |
---|---|
[Name] | The name of the collection. |
[Description] | The description of the collection. |
Fig. 4. New collection window
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] (Fig. 5).
Fig. 5. Adding requests to the collection
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:
- Right-click an earlier created collection.
- Click [Edit], then go to the [Variables] tab (Fig. 6).
Fig. 6. Setting up common variables
- Create the following variables for the collection (see table 2): see table 2:
Table 2. 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:
- Click next to the collection name.
- Click [Run].
Fig. 7. Running the collection of requests
- In the [Run order] block, select requests to run and set their order (Fig. 8, 1).
Fig. 8. Running a collection
- Select the [Save responses] checkbox (Fig. 8, 2).
- Click [Run] (Fig. 8, 3).
Getting data of the request structure elements and the response:
- Click the request name (Fig. 9).
Fig. 9. Request structure elements
- Click [View] –> [Show Postman Console] (Fig. 10) or press “Alt” + “Ctrl” + “C” on the keyboard.
Fig. 10. Opening the console
Select the needed item.