Skip to content

Postman collection#

To test and debug requests to the Green API, you can use the API section in your profile or the Postman collection. To simplify the integration process, you can use ready-made libraries available in the SDK section.

Postman - a widespread tool for API testing and development. To make it easier for developers to integrate with the Green API, we have created a Postman collection with a complete set of required API.

  1. Setup: collection setup
  2. Configure: environment setup
  3. Test: API methods use

Video instruction#

Setup#

To start, download the components below and install Postman:

After installing and running Postman, click on Import and select the two JSON files collection.json and environment.json from the Postman collection on GitHub.

Step 1

Step 2

After importing, you will see a Green API item in Collections section and you can select Green API Developer asEnvironment.

Configure#

A custom Postman environment is actually a collection of "key-value" pairs. You can create standard variables that will be then used in different requests. More on Postman environment variables.

The pre-configured Green API Developer environment contains the complete set of variables, referened by the collection. Some of these variables should be edited and replaced with customer values. To open the edit dialog, click the little eye button next to the environment dropdown and select Edit.

Set values of the two variaables idInstanceand apiTokenInstance, which were got at Before you start stage.

Test#

Now you can select any API method in the collection and start sending requests. For convenience, all methods are listed in the same order as they are reviewed in API documents. You can make any changes to these methods to make it easier to test them and process responses.