Testing an Open API

To test an Open API:

  1. Select PeopleTools, Integration Broker, Application Services, Test Application Services.

  2. Search for and select the Application Service to test.

  3. Select the path item to test.

  4. Select the Standard option (default).

  5. Select the Populate URI Template link and enter variables for the URL.

  6. Click the Execute Request button.

Select the Populate URI Template link to populate the variables for the event. When the page is closed a URL will appear below the Populate URI template link indicating the URL that will be invoked.

This example illustrates the fields and controls on the URI Template Builder page. You can find definitions for the fields and controls later on this page.

URI Template Builder page

The URI Template displays which variables need to be populated in order to test the URL. In this example the variables instrument and musicCode should be populated from the tree.

The Clear Data link will reinitialize the tree, removing the currently populated values.

Entering Primitive Values

To enter primitive values:

  1. Click the name of a primitive element for which to enter a test value.

  2. Enter the test value on the Set Value page and click Done.

    This is an example of the Set Value page for String.

    Set Value page
  3. The values are displayed in the tree.

Appending and Deleting Collection Element Items

You can append a collection item with a copy of the last row in the collection or delete the last row in a collection.

This example illustrates the fields and controls on the Collection Actions page. You can find definitions for the fields and controls later on this page.

Collection Actions page

Field or Control

Description

Append Collection Item

Select to add an element to the collection. When you click Done, the element is appended with a copy of the last row in the collection.

Delete Last Collection Item

Select to delete an element from the collection. When you click Done, the last row is removed.

This example illustrates URI Template Builder with values entered for the variables in the template.

Populated URI Template Builder page

To test the Service Operation, you will need to add values for all the variables in the URI Template.

When The URI Template Builder page is closed, a URL will appear below the Populate URI template link indicating the URL that will be invoked.

This example illustrates a populated URL that will be invoked.

Example Populated URI Template

When you close the URI Template Builder page, the main tester page showing the fully qualified URL for this specific test is displayed.

Note: The URL is properly encoded using the values defined in the tree.

Click the Execute Request button to run the test.

This example illustrates the Application Service Tester results.

Example Test Results

The output data in standard JSON format is displayed on the right hand side of the page. The Response status code is displayed.  The Response Header link is enabled and if selected will show all the response headers populated for this particular request. The result data along with the status code and response headers can be cleared by selecting the Clear Response link.

If any headers are defined for the Application Service they are shown by default. 

See Defining Headers.

This example illustrates Request Headers defined for a Application Service to be tested.

Request Headers in Application Service Tester

To test a POST Open API:

  1. Select PeopleTools, Integration Broker, Application Services, Test Application Services.

  2. Search for and select the Application Service to test.

  3. Select the POST path item to test.

  4. Select the Standard option (default).

  5. Select the Populate URI Template link and enter variables for the URL.

  6. Select the Provide Data Link.

  7. Select the Example Schema link.

    Copy the schema and paste input data, update the data as appropriate.

  8. Update Request Headers if applicable.

  9. Click the Execute Request button.

This example illustrates the Example Schema page.

Example Schema page

This example illustrates the input data with multi row input.

Input Data

Note: The JSON schema is validated when you click Done on the Enter Input Data page.

This example illustrates a POST Application Service Test.

Example POST Application Service Test

If there are errors when executing a request, a popup message is displayed indicating there is an error and to check the Application Services log for more information.

This example illustrates an Application Service error message.

Example Application Service error message

Selecting the OK button will display the error message in the proper format based on the Test Option selected.