Testing requests and responses

Developers who work with system APIs typically use a tool that can send requests and get responses within an acceptable amount of time. Guidewire recommends Postman. This tool has the ability to:

  • Save API calls, including headers and payloads
  • Save collections of calls
  • Automatically create a collection of calls for a schema's paths by importing the Swagger schema file
  • Share collections with other developers on your team

For more information and to download the tool, see https://www.postman.com/.

Note: Swagger UI is also able to send requests to a working API and show responses. However, the system APIs are significantly robust, and performance time for getting responses to requests can be unacceptably long. Guidewire recommends using Swagger UI only for viewing system API documentation.

Tutorial: Set up your Postman environment

The system API documentation contains a set of tutorials that guide you through examples of how to send requests and review the responses. All of these tutorials assume the following base environment:

  • A default instance of ClaimCenter installed on your machine that contains only the Demo sample data set.
  • An instance of Postman.

This tutorial walks you through the process of setting up this environment.

Note: If your instance of ClaimCenter is installed on a different machine, you will need to adjust the endpoint URLs provided in the tutorials. Also, if you create data in addition to the Demo sample data, then your responses may differ from the ones described in the tutorials.

Tutorial steps

  1. Install Postman. (For more information, refer to https://www.postman.com/.)
  2. Start ClaimCenter and load the Demo sample data set.

You can test your environment by sending your first Postman request.

  1. Open Postman.
  2. Start a new request by clicking the + to the right of the Launchpad tab.
  3. Every request in Postman requires some form of authorization:
    1. Click the Authorization tab.
    2. For the Type drop-down list, select Basic Auth.
    3. In the Username field, enter aapplegate.
    4. In the Password field, enter gw.
  4. Under the Untitled Request label, make sure that GET is selected. (This is the default operation.)
  5. In the Enter request URL field, enter the following URL: http://localhost:8080/cc/rest/common/v1/activities
  6. Click the Send button to the right of the request field.

Checking your work

Once a response has been received, its payload is shown in the lower portion of the Postman interface. If your environment has been set up correctly, the first few lines of the response payload are:

{
    "count": 25,
    "data": [
        {
        "attributes": {
            "activityPattern": "contact_claimant",
            "assignedGroup": {
                "displayName": "Auto1 - TeamA",
                "id": "demo_sample:31"
            },
            "assignedUser": {
                "displayName": "Andy Applegate",
                "id": "demo_sample:1"
            },

Troubleshooting: No response

Requests can be sent only to running applications. All of the tutorials in this documentation require that ClaimCenter is running. If you send a request when the application is not running, you will see an error similar to the following:

Could not get any response

There was an error connecting to http://localhost:8080/cc/rest/common/v1/activities.

Troubleshooting: NotFoundException

Unless it is stated otherwise, all of the tutorials use basic authentication and the aapplegate user. If you encounter a NotFoundException such as the following example, this could be caused by not providing correct authentication information for this user.

"status": 404,
"errorCode": "gw.api.rest.exceptions.NotFoundException",
"userMessage": "No resource was found at path /common/v1/activities"