Using the HTTP REST XAPI tester user interface

This topic provides details on how to use the HTTP REST XAPI Tester user interface.

About this task

Procedure

  1. Access the HTTP REST XAPI Tester user interface using this URL https://<hostname>:<portno>/smcfs/yfshttpapi/ibmapitester.jsp
  2. From the API Name drop down, select the REST API that you want to test. Once you select an REST API, the BASE URL field is automatically populated with the base path of the REST API.
    Note: Since the value in the BASE URL field is reset whenever you select a new REST API from the API Name drop down, make sure you update the value in the BASE URL field by prefixing it with "https://<hostname>:<portno>" before making the API call for testing. So, the value must be in the https://<hostname>:<portno>/smcfs/restapi/<resource_group> format.
    Note: You can only test the REST APIs listed in the REST XAPI Javadoc from the HTTP REST XAPI Tester user interface. You can ignore all the non REST APIs listed in the drop down.
  3. Enter the username in the UserId field and password in the Password field.
  4. Select the format (JSON or XML) of the input message to the REST XAPI in the Content-Type field. The content type is the content type of the message, or body of the request.
    Note: For GET request, if a Content-Type is selected, the Send Over POST check box gets automatically selected and also disabled. Therefore, to use these methods without sending over POST, make sure no value is selected for the Content-Type field.
  5. If you want to send the request over POST, select the Send Over POST check box.
  6. Select the format (JSON or XML) of the expected output message from the REST XAPI in the Output Format field.
  7. Optional: Use the Identifier for GET, or PATCH, or DELETE REST XAPIs. For example, you can call the getOrderDetails REST XAPI on a record with OrderHeaderKey=TestOrder. TestOrder is the identifier in this example. The HTTP REST XAPI Tester framework automatically appends this identifier value to the end of the Base URL. Therefore, the complete Base URL becomes this https://<hostname>:<portno>/smcfs/restapi/order/TestOrder.
  8. Optional: Services can also be tested by entering the service name in the Service Name field and selecting the Is a Service check box.
  9. Optional: The History drop down can be used to select a previous API call. On selection of an API, the Message, Base URL and Content-Type fields are populated with the values used in that API call.
    Note: Since the value in the BASE URL field is reset whenever you select a new API from the History drop down, make sure you update the value in the BASE URL field by prefixing it with "https://<hostname>:<portno>" before making the API call for testing. So, the value must be in the https://<hostname>:<portno>/smcfs/restapi/<resource_group> format.
  10. Optional: To save an API call details, click Save API calls. The system prompts the user to save the file as Apicalls.txt. This file contains the current history of input or output for an API call. Then each API call is denoted by <!- - start -- > and <! - - end - - > tags in the file, with the name of the API invoked listed after the start comment.
  11. Enter the input message (XML or JSON) to the REST XAPI in the Message field
  12. Click Test REST XAPI Now!. The output message (XML or JSON) is displayed in the text box on the right hand side.

What to do next

You can access the HTTP REST XAPI Tester at https://<hostname>:<portno>/smcfs/yfshttpapi/ibmapitester.jsp