---
title: "REST API Client"
description: "The InsuranceSuite REST API Client provides functionality to make outbound HTTP calls to internal or third-party REST services. Learn more."
url: "https://www.guidewire.com/de/developers/apis/rest-api-client.md"
language: "de"
locale: "de"
---

# REST API Client

The InsuranceSuite REST API Client provides functionality to make outbound HTTP calls to internal or third-party REST services. Learn more.

Guidewire REST API Client

The InsuranceSuite REST API Client provides functionality to make outbound HTTP calls to internal or third-party REST services.

[Setup](#setup)

[Download the Client](#download-the-client)

## Overview: REST API Client

The Guidewire InsuranceNow API uses the Representational State Transfer (REST) architecture to issue requests and receive responses from the server.

**Available since:**

![](https://edge.sitecorecloud.io/guidewiresodb06-guidewire0f2e-productioncd91-5186/media/images/products/platform-releases/badge--banff--150x150.png)

**Easily connect Guidewire to other services.**

The InsuranceSuite REST API Client provides functionality that Guidewire applications and integrations use to make outbound HTTP calls to third-party OpenAPI Spec-compliant REST services. Using the client enables loosely-coupled external code to be invoked by events that are sourced in InsuranceSuite and other Guidewire applications.

Version compatibility:

- Guidewire Cloud: Banff release of InsuranceSuite or greater
- Self-managed: InsuranceSuite 10.1 or greater

The Guidewire REST API client consists of two modules, a client library and a client plugin:

- The **client library** provides fault tolerance features that integration developers use to make synchronous REST API calls from InsuranceSuite to internal or external services
- The **client plugin** generates REST API for making outbound HTTP requests to internal or external OpenAPI Spec-compliant REST services

## Architecture of the Guidewire REST API.

![](https://edge.sitecorecloud.io/guidewiresodb06-guidewire0f2e-productioncd91-5186/media/images/resources/developer/apis/rest_api_client_architecture--1076w.png?h=699&iar=0&w=1076)

[Access Documentation](https://docs.guidewire.com/is/restapiclient/release/guide/REST-API-Client/topics/c_overview-rest-client.html?_gl=1*1s2jx7q*_gcl_au*MTUwMTA3Nzg0NC4xNzI1MDQ1MDUz*_ga*MTMxNjc5NjMxNi4xNzIyNjIxMTAz*_ga_LN5WM89V7V*MTczMDIzMzkyNi4xMi4xLjE3MzAyNDIzMjMuNjAuMC4w)

API

## Related Information

![](https://edge.sitecorecloud.io/guidewiresodb06-guidewire0f2e-productioncd91-5186/media/images/resources/developer/apis/dev-cloud-api-swagger--560w.jpg?h=320&iar=0&w=560)

[Cloud APIs](/de/developers/apis/cloud-apis)

[See All Resources](/de/resources)

### Featured Content Section Link 1

[Integrations](/de/developers/developer-tools-and-guides/integration-framework)

Tool

### Featured Content Section Link 2

[Stay in the Know: Subscribe to Our Developer Newsletter](/de/developers/developer-resources/developer-newsletter)

Newsletter

## About: Client Library

**Provides fault tolerance features that integration developers use to make synchronous REST API calls from InsuranceSuite to internal or external services.**

The client library is distributed as a JAR file. The library works with OpenFeign annotated API and Jackson annotated data objects. Integration developers can manually create these objects or provide existing. If their REST service complies with the OpenAPI Spec they can use the client plugin to generate that set of classes.

The library provides the following features:

- Code generation in Java and isolation from [Gosu](/de/developers/developer-tools-and-guides/gosu-programming-language) for rapid development
- Integrates with [Resilience4j](https://resilience4j.readme.io/docs/getting-started) to provide lightweight, easy-to-use fault tolerance library. Reseliense4j introduces higher-order functions (decorators) to enhance any functional interface, lambda expression, or method reference with a Circuit Breaker, and Retry. You can stack more than one decorator on any functional interface, lambda expression or method reference
- Integrates with [OpenFeign](https://github.com/OpenFeign/feign) to facilitate the creation of web service client implementations, with quality of service features, configurable and customizable clients. Uses OpenFeign to implement timeout
- Fault tolerance with retry, circuit breaker, and fallback
- Observability with logging and traceability
- Authentication that supports Basic, API Key, Bearer, OAuth 2.0, and Mutual TLS authentications
- Uses Apache HttpClient for robust client connections
- Uses Apache OAuth implementation for OAuth authentication
- By default uses InsuranceSuite standard headers in logging context
- Uses [Jackson](https://github.com/FasterXML/jackson) as JSON parser

## About: Client Plugin

**Generates REST API for making outbound HTTP requests to internal or external OpenAPI Spec-compliant REST services.**

You use the client plugin to generate an OpenFeign based REST client against a service that supports the OpenAPI Spec. If you have an existing OpenFeign based REST API interface you can use the REST API library without the client generation and take advantage of the fault tolerance features.

The client plugin provides the following features:

- Uses [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) to generate API client libraries, server stubs, documentation and configuration automatically against an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification)-compliant REST API service endpoint.

## Setup: Before You Begin

**A few items to explore before you get started.**

Using the REST API client Plugin requires basic familiarity with Gradle. Guidewire recommends using InteliJ as Interactive Development Environment (IDE). To start using the REST API client, install the following software:

| **Software** | **URL** | **Description** |
| --- | --- | --- |
| Gradle | [https://github.com/gradle/gradle](https://github.com/gradle/gradle) | Build automation framework |
| Intellij | [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/) | Interactive Development Environment (IDE |

The REST API client is implemented using the following Open Source libraries. Use the provided links to explore their features:

| **Library** | **URL** | **Description** |
| --- | --- | --- |
| OpenFeign | [https://github.com/OpenFeign/feign](https://github.com/OpenFeign/feign) | OpenFeign is a microservice invocation framework, which is mainly used in the consumer side, that is, invoking services. |
| Resilience4J | [https://resilience4j.readme.io/docs](https://resilience4j.readme.io/docs) | Fault tolerance library |
| Jackson | [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) | JSON library |

## Making Connections: Getting Started with the REST API Client

**Download the client and get started integrating Guidewire to other services.**

The REST API client project is configured to use the [PetStore REST service](https://petstore.swagger.io/) to illustrate how to generate the REST API client with this service. Initially, you use this configuration to test the generated client in your InsuranceSuite application. Next, you modify the project settings to configure the OpenAPI-compliant service endpoints and generate your own client. To start using the code generation plugin you need to unzip the distribution zip file and open the Gradle project in your IDE. The instructions in this guide assume that you use IntelliJ.

### Step 1: Get the REST API Client

For Dobson and later releases, **the REST API Client code is available in your code repository**. As of our Elysian release, it is located in the modules/restapiclient directory.

Self-managed customers and partners can download the REST API Client code by logging into Guidewire Community or our Partner portal, respectively:

Customers:

- Visit [https://community.guidewire.com/s/resources](https://community.guidewire.com/s/resources?_gl=1*1ny7xhs*_gcl_au*MTUwMTA3Nzg0NC4xNzI1MDQ1MDUz*_ga*MTMxNjc5NjMxNi4xNzIyNjIxMTAz*_ga_LN5WM89V7V*MTczMDMwMTcyOS4xMy4xLjE3MzAzMDc1NDAuNjAuMC4w) (login required)
- Click on the &ldquo;Product&rdquo; dropdown menu, and select REST API Client
- Download the latest version of the REST API Client

### Step 2: Unzip the Project to Your Environment

1. Unzip the file to your local file system
2. Import the Gradle project to IntelliJ, or the IDE that you use

### Step 3: Update the Project Configuration

**Update the following configuration files to configure your client:**

1. Open the build.gradle file to update the following three parameters:

- gwRestGen_endpoint_package Defines the generated client package name
- gwRestGen_endpoint_source Defines the source for the endpoint. It can be a REST service endpoint OpenAPI spec URL or a local file path to the OpenAPI spec JSON file.
- gwRestGen_isInsuranceSuite Defines the client deployment target. When the target is an InsuranceSuite application the build task packages the client along with the necessary libraries.

```
ext {
  gwRestGen_endpoint_package = "petstore"
  gwRestGen_endpoint_source = "https://petstore.swagger.io/v2/swagger.json"
  gwRestGen_isInsuranceSuite = "true"
}
```

2. Update settings.gradle to include the client package to the build. You can configure multiple client packages, as shown in the following example. Respectively, you must configure the endpoint parameters for each package in build.gradle:

```
include 'claimcenter:v1'
include 'policycenter:v1'
```

### Step 4: Build the client

The project provides Gradle task that you use to build the client. For details, see REST API client plugin tasks. In this project the code generation plugin generates a client against the PetStore service. Since the endpoint source is defined as an OpenAPI spec URL, you execute the following commands:

1. Run the restDownload task to download the OpenAPI spec JSON file. To run a task with the wrapper, use one of the following commands from a Terminal window:

On Mac or Linux, run:

```
./gradlew restDownload
```

On Windows:

```
gradlew restDownload
```

In IntelliJ, you can also run the restDownload task from Gradle task window.

*Note: If you define the gwRestGen_endpoint_source as a relative path to a JSON file, the restDownload does not appear in the available tasks.*

2. Generate the client. To run a task with the wrapper, use one of the following commands from a Terminal window:

On Mac or Linux, run:

```
./gradlew build
```

On Windows:

```
gradlew build
```

The build generates the client library <project>/endpoint/build/libs/gwgen.petstore-<version>.jar.

### Step 5: Publish the Generated Client

To publish the client to the InsuranceSuite application run the *publish* task. To run a task with the wrapper, use one of the following commands from a Terminal window:

On Mac or Linux, run:

```
/gradlew publish
```

On Windows:

```
gradlew publish
```

In IntelliJ, you can also run the publish task from Gradle task window.

The task zips up the following libraries in build/distribution/endpoints-<version>.zip file:

- The generated client <project>/endpoint/build/libs/gwgen.petstore-<version>.jar
- The REST API client library /client/libs/client-<version>.jar
- All libraries from /libs folder

### Step 6: Deploy to InsuranceSuite application

1. Stop the InsuranceSuite application
2. Extract build/distribution/endpoints-<version>.zip to <IS>modules/configuration/plugins/shared/lib folder in an InsuranceSuite application installation
3. Start the InsuranceSuite application

### Step 7: Test the client in InsuranceSuite application

To test the client you create and run a test in Gosu Scratchpad in InsuranceSuite Studio. The test submits REST API requests to the PetStore service to get the store inventory and get information about the sold and available pets.

- Open InsuranceSuite Studio:

```
gwb studio
```

- To open Gosu scratchpad, click Tools &rarr; Gosu Scratchpad
- In Gosu scratchpad, type the following code:

```
uses gw.restclient.config.Config
uses gw.restclient.util.StaticMapper
uses gwgen.petstore.ApiClient
uses gwgen.petstore.api.StoreApi
uses gwgen.petstore.api.PetApi
uses gwgen.petstore.model.Pet
uses gwgen.petstore.model.Category
uses gwgen.petstore.model.Pet.StatusEnum

var mapper = StaticMapper.yaml()
var config = Config.builder().basePath(ApiClient.BASE_PATH).build()
var storeApi  = config.buildAPI(StoreApi)
var inv = storeApi.getInventory()

inv.forEach( \\ key, cnt -> print("${key} = ${cnt}"))
var petApi = config.buildAPI(PetApi)
var rtn = petApi.findPetsByStatus({ StatusEnum.AVAILABLE.toString(),
                                    StatusEnum.SOLD.toString() })
print(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rtn))
```

- To run the code, click Run on the scratchpad navigation bar.
- The test completes and generates an output similar to the following output. The output below displays only part of the response:

```
"C:\\Program Files\\Java\\jdk1.8.0_152\\bin\\java.exe"
-javaagent:C:\\ClaimCenter\\studio\\sdk\\lib\\idea_rt.jar=50833:C:\\ClaimCenter\\studio\\sdk\\bin
-Dfile.encoding=UTF-8 -classpath C:\\Users\\user1\\AppData\\Local\\Temp\\classpath7313323.jar
gw.lang.Gosu "C:\\Users\\user1\\AppData\\Local\\Temp\\6dace4b4\\Gosu Scratchpad.gsp"
sold = 190
string = 292
pending = 182
availableTINFOILLLLLLLLLLLLLLLLLL....LLLLLLLLLLL = 1
available = 292
soldTINFOILLLLLLLLLLLLLLLLLL....LLLLLLLLLLL = 1
---
- id: 7777778888889957853
category:
name: "string"
name: "doggie"
photoUrls:
- "string"
tags:
- name: "string"
status: "available"
- id: 7777778888889957854
category:
name: "string"
name: "doggie"
photoUrls:
- "string"
tags:
- name: "string"
status: "available"
- id: 7777778888889957865
category:
name: "string"
name: "doggie"
photoUrls:
- "string"
tags:
- name: "string"
status: "available"
- id: 213124125
category:
id: 12
name: "cats"
name: "Garfield"
photoUrls: []
status: "available"
- id: 7777778888889957875
category:
name: "string"
name: "doggie"
photoUrls:
- "string"
tags:
- name: "string"
status: "available"
- id: 1234
category:
name: "string"
name: "casper"
photoUrls:
- "string"
tags:
- name: "string"
status: "available"
....
Process finished with exit code 0
```

You are now ready to use the Guidewire REST API Client to make calls to other services. For a more detailed explanation of the API client, client library, and client plugin, read the full documentation.

[Access Documentation](https://docs.guidewire.com/is/restapiclient/guide/REST-API-Client/topics/c_overview-rest-client.html?_gl=1*1d1dabj*_gcl_au*MTUwMTA3Nzg0NC4xNzI1MDQ1MDUz*_ga*MTMxNjc5NjMxNi4xNzIyNjIxMTAz*_ga_LN5WM89V7V*MTczMDMwMTcyOS4xMy4xLjE3MzAzMTI0NTMuMjMuMC4w)

Blog

## Related Information

![](https://edge.sitecorecloud.io/guidewiresodb06-guidewire0f2e-productioncd91-5186/media/images/resources/developer/apis/generic-guidewire-blog--560w.jpg?h=320&iar=0&w=560)

[Guidewire's Best Training Courses for Developers](/de/resources/blog/developers/guidewires-best-training-courses-for-developers)

[See All Resources](/de/resources)

### Featured Content Section Link 1

[Gosu Programming Language](/de/developers/developer-tools-and-guides/gosu-programming-language)

Cross-Platform Tool

## Don&rsquo;t see what you are looking for?

[Contact Us](/de/about/get-in-touch/contact-us)
