PingAuthorize API Reference

Read Test Suite Entity Children

GET {{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}

The GET /test-suite/{{testSuiteEntityId}}/children operation returns the children of the test suite entity identified by {{testSuiteEntityId}}. The request must provide either a branch ID or a snapshot ID in the request URL to specify where the test suite entity children should be read from.

Prerequisites

Only test suite groups can be parents of other test suite entities.

Query parameters
Query parameter Description

branch

Branch ID or name

snapshot

Snapshot ID

Headers

x-user-id      {{userId}}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}' \
--header 'x-user-id: {{userId}}'
var options = new RestClientOptions("{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("x-user-id", "{{userId}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("x-user-id", "{{userId}}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
GET /test-suite/{{testSuiteEntityId}}/children?branch={{branchId}} HTTP/1.1
Host: {{apiPath}}
x-user-id: {{userId}}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}")
  .method("GET", body)
  .addHeader("x-user-id", "{{userId}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "x-user-id": "{{userId}}"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'GET',
  'url': '{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}',
  'headers': {
    'x-user-id': '{{userId}}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}"

payload = {}
headers = {
  'x-user-id': '{{userId}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'x-user-id' => '{{userId}}'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
require "uri"
require "net/http"

url = URI("{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["x-user-id"] = "{{userId}}"

response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{apiPath}}/test-suite/{{testSuiteEntityId}}/children?branch={{branchId}}")!,timeoutInterval: Double.infinity)
request.addValue("{{userId}}", forHTTPHeaderField: "x-user-id")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()

Example Response

200 OK

{
    "pagination": {
        "page": 1,
        "pageSize": 100,
        "totalItems": 1,
        "totalPages": 1
    },
    "data": [
        {
            "objectType": "TestCaseDefinition",
            "id": "e03e2872-9b02-4f6d-b765-fc0637169d32",
            "version": "3509157d-2ad2-4c22-b7a1-881fd2d97c1e",
            "type": "TEST_CASE",
            "name": "Example test",
            "fullName": "Example test group.Example test",
            "description": "",
            "parentId": "adb6a4f9-c371-4725-a3a2-1227b4d1a318",
            "numberOfChildren": null,
            "permissions": {
                "inherit": true,
                "rolePermissions": []
            },
            "testCase": {
                "testScenario": {
                    "request": {
                        "domainId": null,
                        "serviceId": "61b9dc72-36b9-4924-b5a9-c6933192142c",
                        "identityProviderId": null,
                        "actionId": "b072d76e-0085-4423-99c2-4e16b74e88fa",
                        "attributes": {}
                    },
                    "attributeOverrides": {},
                    "serviceOverrides": {}
                },
                "testedEntities": [
                    {
                        "entityId": "25769e5c-5b33-4daf-9780-3e09b6f32207",
                        "entityType": "Definition",
                        "assertions": []
                    }
                ]
            },
            "properties": []
        }
    ]
}