Testing requests and responses
Developers who work with Cloud API 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/.
Tutorial: Set up your Postman environment
The Cloud 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:
- For the ClaimCenter tutorial, a default instance of ClaimCenter must be installed on your machine, containing only the Demo sample dataset.
- For the PolicyCenter tutorial, a default instance of PolicyCenter must be installed on your machine, containing only the Large sample dataset.
- For the BillingCenter tutorial, a default instance of BillingCenter must be installed on your machine, containing only the sample dataset.
- An instance of Postman is necessary.
This tutorial walks you through the process of setting up this environment.
If your InsuranceSuite application instance is installed on a different machine, you will need to adjust the endpoint URLs provided in the tutorials. Also, for ClaimCenter, if you create data in addition to the Demo sample data, your responses may differ from those described in the tutorials. Similarly, for PolicyCenter, if you create data in addition to the Large sample data, your responses may differ from those described in the tutorials. For BillingCenter, if you create data in addition to the sample data, your responses may differ from those described in the tutorials.
Tutorial steps
- Install Postman. (For more information, refer to https://www.postman.com/.)
- Start the InsuranceSuite application and load the sample dataset. For ClaimCenter, load the Demo sample dataset. For PolicyCenter, load the Large sample dataset. For BillingCenter, load the sample dataset.
You can test your environment by sending your first Postman request.
- Open Postman.
- Start a new request by clicking the + to the right of the Launchpad tab.
- Every request in Postman requires some form of authorization:
- Click the Authorization tab.
- For the Type drop-down list, select Basic Auth.
- In the Username field in ClaimCenter or PolicyCenter, enter aapplegate. In BillingCenter, enter su.
- In the Password field, enter gw.
- Under the Untitled Request label, make sure that GET is selected. (This is the default operation.)
- In the Enter request URL field, enter the request URL for your
respecgive InsuranceSuite application. For example, use the following URL for ClaimCenter
(use "cc" for ClaimCenter, "pc" for PolicyCenter", or "bc" for BillingCenter):
http://localhost:8080/cc/rest/common/v1/activities - 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, these are the first few lines of the response payload:
ClaimCenter:
{
"count": 25,
"data": [
{
"attributes": {
"activityPattern": "contact_claimant",
"assignedGroup": {
"displayName": "Auto1 - TeamA",
"id": "demo_sample:31"
},
"assignedUser": {
"displayName": "Andy Applegate",
"id": "demo_sample:1"
},
...
PolicyCenter:
{
"count": 11,
"data": [
{
"attributes": {
"activityPattern": "uw_review_contingency",
"activityType": {
"code": "general",
"name": "General"
},
"assignedByUser": {
"displayName": "Alice Applegate",
"id": "pc:105"
},
...
BillingCenter:
{
"count": 1,
"data": [
{
"attributes": {
"accountNumber": "Standard Account",
"billDateOrDueDateBilling": {
"code": "BillDateBilling",
"name": "Bill Date"
},
"billingLevel": {
"code": "Account",
"name": "Account/Default Unapplied"
},
"billingPlan": {
"displayName": "Standard Mail",
"id": "bc:SEvJpIXBd_LAUq5VG-62h"
},
...
Troubleshooting: No response
Requests can be sent only to running applications. All of the tutorials in this documentation require that an InsuranceSuite application 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. (ClaimCenter)
Troubleshooting: NotFoundException
Unless it's stated otherwise, all tutorials use basic authentication. ClaimCenter and
PolicyCenter use the aapplegate user, and BillingCenter uses the
su 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"