Fetching Data from an API

Check out the screenshot guide below!

1. Login to Application

Setup:

1. To fetch the data from the Api, click on the edit icon of the particular step, click on Test data source field, choose From Api from the dropdown.

2. Choose the product,module and Api name. Write a query in the Api Query field to specify the data has to be fetched.(Sample Query ex.

~data~users~[1]~name will fetch Bob from this json object

{

  “data”: {

    “users”: [

      { “name”: “Alice” },

      { “name”: “Bob” }

    ]

  }

}

)

3. Submit.

API Setup in API Management Page:
Select Product and module for creating an API

1. Click on Create New API

2. Enter API Name

3. Enter API URL

4. Enter Query Parameters – if you would like to use variables to provide values at run time, define the  query parameters using the API Params in the test data setup within the test case

5. Enter Header Details

6. Enter Body Details

7. Or you can use curl command to import the API

8. Choose the required method

9. Save and Call

Have other questions? Access our full knowledge base!

Verified by MonsterInsights