get, array, response, api, request, response, send, soap, rest, get, post, put, delete

Method GetArrayResponse

API

Returns data array of entire or partial API response by the given path

Watch this video to learn how to use this method

Have a problem with playback?
GetArrayResponse method Returns data array of entire or partial API response by the given path. Prior to use this function you need to insert Execute method. The input of this method is optional "path" parameter. The Output - is the array with data. Lets get array of user's awards. To get more information about path usage refer separate video how to use paths for getting API method response. We will use messagebox to demonstrate the output.

Usage

Function GetArrayResponse(
    String Path [Optional],
    Boolean Report [Optional]
)

Method

ZAP API Method step

GetArray...ponse

[0].Awards

True

Path

Report

Output Parameter

Parameters

Path (optional)

Type: String

Default Value: Empty String

Path to the object: User[5].Information.Awards

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Array

Example

VBScript

Server("API Server").Method("GetUsers").Execute
msgbox Server("API Server").Method("GetUsers").GetArrayResponse("[0].Awards", True)

JavaScript

Server("API Server").Method("GetUsers").Execute();
alert(Server("API Server").Method("GetUsers").GetArrayResponse("[0].Awards", true));

GetUsers

ZAP API Method step

Execute

Script-Less next step

Variable

awards

ZAP API Method step

GetArray...ponse

[0].Awards

True

Script-Less next step

GetUsers

ZAP Utility step

Zap.Comm...Box

Zap.Var...("awards")

Contact Us

3150 Roswell Rd NW

Atlanta, GA, 30305, USA

(800) 795-3552