Guidewire Cloud API Developer Guide
Guidewire Cloud API Developer Guide
Contents
Support.......................................................................................................................................................... 13
Part 1
Endpoint architecture........................................................................................................................... 15
Part 2
Adding properties to resources........................................................................................................31
7 Adding scalars.................................................................................................................................................. 33
The schema extension file................................................................................................................................ 33
The mapping extension file.............................................................................................................................. 36
The updater extension file............................................................................................................................... 37
8 Adding compound datatypes.......................................................................................................................... 39
The schema extension file................................................................................................................................ 39
The mapping extension file.............................................................................................................................. 40
The updater extension file............................................................................................................................... 41
9 Adding foreign keys......................................................................................................................................... 43
Tools for configuring foreign keys.....................................................................................................................43
The SimpleReference schema.................................................................................................................. 44
The ResourceReference mapper.............................................................................................................. 44
Value resolvers......................................................................................................................................... 44
The URI Mapping...................................................................................................................................... 46
Foreign keys in the schema configuration files................................................................................................ 46
The schema extension file........................................................................................................................ 46
The mapping extension file...................................................................................................................... 47
The updater extension file....................................................................................................................... 48
The shared apiconfig file.......................................................................................................................... 48
Updater case 1: Root and resolved value have no common ancestor............................................................. 49
Complete code sample for case 1............................................................................................................ 50
Updater case 2: Root and resolved value have a common ancestor................................................................51
Update case 3: Accessibility of resolved value is conditional...........................................................................52
Update case 4: Resolved value cannot be easily resolved by id alone............................................................. 53
10 Adding one-to-ones......................................................................................................................................... 57
Contents 3
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Example one-to-one......................................................................................................................................... 58
One-to-one relationships in the schema configuration files............................................................................ 59
The schema extension file........................................................................................................................ 59
The mapping extension file...................................................................................................................... 60
The updater extension file....................................................................................................................... 61
Reserving IDs and checksums...........................................................................................................................62
Configuring ID and checksum behaviors.................................................................................................. 63
One-to-ones in responses and requests...........................................................................................................64
Complete code sample for one-to-ones...........................................................................................................64
11 Tutorials: Adding Properties............................................................................................................................67
Tutorial: Schema configuration with scalars.....................................................................................................67
Tutorial: Schema configuration with compound datatypes............................................................................. 69
Part 3
Modifying endpoint behaviors.......................................................................................................... 73
12 Collection-level behaviors............................................................................................................................... 75
13 Making properties read only........................................................................................................................... 77
14 Making properties required by the database................................................................................................. 79
15 Making properties writeable at creation only................................................................................................ 81
16 Making properties sortable............................................................................................................................. 83
17 Making properties filterable........................................................................................................................... 87
18 Excluding properties from responses..............................................................................................................93
19 Adding additional metadata for properties.................................................................................................... 95
20 Obfuscating response data.............................................................................................................................. 97
Nullifying response data...................................................................................................................................97
Masking response data.................................................................................................................................... 98
Unmasking the base configuration taxID field................................................................................................. 99
Part 4
Localizing schemas............................................................................................................................. 101
Part 5
Generating extension endpoints.................................................................................................... 115
4 Contents
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Contents 5
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Part 6
Generating LOB-specific endpoints............................................................................................. 173
6 Contents
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Part 7
Configuration for other specific use cases............................................................................... 225
Part 8
Choosing an authentication flow................................................................................................... 233
Contents 7
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Part 9
Authentication flows in detail..........................................................................................................253
8 Contents
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Part 10
Implementing authentication........................................................................................................... 325
Contents 9
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Part 11
ContactManager authentication..................................................................................................... 373
10 Contents
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Contents 11
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
12 Contents
Support
Guidewire customers
[Link]
Guidewire partners
[Link]
part 1
Endpoint architecture
Cloud API provides CRUD (Create Read Update Delete) endpoints that allow integrating systems to interact with
PolicyCenter. In order to integrate effectively, it's helpful to understand the architecture of those endpoints. The topics
in this section explain the overall architecture behind accessing Cloud API endpoints and the various configuration
files that define the architecture.
• “CRUD endpoint architecture” on page 17
• “Reasons to modify configuration files” on page 19
• “Syntax for schema configuration files” on page 21
• “Swagger and apiconfig files” on page 25
Endpoint architecture 15
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
16 Endpoint architecture
chapter 1
CRUD endpoints is a term that refers to the endpoints that let you GET a collection of a given resource type and that let
you GET, POST, PATCH, or DELETE an element of that resource type. The term "CRUD" is an acronym for Create
Read Update Delete.
High-level architecture
The following diagram depicts the high-level architecture of a set of CRUD endpoints within Cloud API. These
endpoints are for a custom entity whose name is CustomEntity_Ext. (Most of the time, endpoints are generated for
custom entities. This is why the examples below feature CustomEntity_Ext. However, it is also possible to generate
endpoints for base configuration entities that do not yet have endpoints.)
There are five CRUD endpoints, but they do not all interact with the same type of resource.
• The first two CRUD endpoints are for GET (for a collection) and POST. These endpoints interact with a collection
resource whose name is customEntitiesExt. (Note that the resource name uses a plural term.)
• The final three CRUD endpoints are for GET (for a specific element), PATCH, and DELETE. These endpoints
interact with an element resource whose name is customEntityExt. (Note that the resource name uses a singular
term.
The components of the architecture map to each other in the following ways:
• The collection resource (customEntitiesExt) makes use of the element resource.
The swagger file defines the endpoints themselves (the paths, operations, and associated resources).
The schema file defines the schema used by the element and collection resources.
The mapping file defines how information is mapped from the data model entity to the element resource. This
information is used for GETs, and for the responses of POSTs and PATCHes.
The updater file defines how information is mapped from the element resource to the data model entity. This
information is used for POSTs and PATCHes.
The eti file defines the data model entity.
There are also a series of files that define logic for how the endpoints interact with the application.
• The apiconfig file is a "glue" file. One of its purposes is to map both the element resource and collection resource
to corresponding "Resource" Gosu files. For collection resources, this file can also specify a default sort order.
• There are two "impl" files that define implementation details.
◦ The <collection>[Link] file is a Gosu file that defines required behaviors for working with collections.
This includes behaviors such as how to retrieve the collection from the database.
◦ The <element>[Link] file is a Gosu file that defines required behaviors for working with elements. This
includes behaviors such as how to initialize a new element.
• There are two sets of "auth" files that define authorization.
◦ There are one or more [Link] files that define endpoint access for callers of the endpoints.
◦ There are a set of [Link] files that define resource access for callers of the endpoints.
There are several reasons you might need to modify configuration fields.
The approach for doing this follows the same process as extending a base configuration resource. There are only two
differences:
• There is no need to extend the data model as the field in question already exists.
Reasons to modify configuration files 19
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• Guidewire recommends appending "_Ext" to the schema property name to avoid potential conflicts in future
releases.
Integration graphs
Cloud API schemas are used to define the integration graphs used by Guidewire App Events . An integration graph is
a data model graph that defines a set of business information to be sent to an external application as part of outbound
integrations. For example, the Claim graph defines what information to send about a claim. Insurers may want to
extend Cloud API schemas to ensure that certain information is included in the integration graph.
For more information on integration graphs, see “Integration graphs” on page 159 and the App Events Guide.
This section describes the syntax for the different types of schema configuration files.
Extension files
Whenever you configure a schema, you modify an extension file. Within the context of Cloud API, an extension file is
a file that insurers can modify that adds or overrides the base configuration. All extension files have "ext" in their name
and are located in an ext subdirectory.
For schema configuration, Cloud API includes the following types of extension files:
• schema extension files, where insurers add new properties to a schema
• mapping extension files, where insurers define how data is mapped from the data model to the schema
• updater extension files, where insurers define how data is mapped from the schema to the data model (for properties
that are writeable)
Every API has its own set of extension files. The names of the files, and the nodes in Guidewire Studio that you can
use to access them, are:
• <API>_ext-[Link]
◦ integration > schemas > ext > <API>.v1
• <API>_ext-[Link]
◦ integration > mappers > ext > <API>.v1
• <API>_ext-[Link]
◦ integration > updaters > ext > <API>.v1
Extension files have the same syntax as base configuration files. But extension files often omit some information that is
not necessary for extending a schema. For example, when a resource is declared in a base configuration file, the
schema file defines the resource's title, description, and type. When that same resource is extended in an extension
file with additional properties, there is no need to repeat the title, description, or type. These values are inherited
from the base configuration file.
Every ext subdirectory has a sibling gw subdirectory. The gw subdirectory holds the base configuration files. Insurers
are not permitted to modify these files. However, you may find it helpful to review those files for example of how base
configuration resources are defined.
Swagger files and apiconfig files do not directly define schema behavior. But they do contain information related to
schemas. For the sake of completeness, they are defined here.
Swagger files
Within the context of Cloud API, a swagger file defines the endpoints and operations for a given API. Typically, there
is no need for an insurers to configure a Cloud API swagger file.
Swagger files are stored in the /apis subdirectory.
Swagger file syntax
A swagger file can contain a section that defines an API. For example, the following is a portion of the
common_pl-[Link] file, which defines the Common API.
swagger: "2.0"
info:
title: "Common API"
description: "APIs for common InsuranceSuite platform objects like activities and notes"
version: "1.4.0"
basePath: /common/v1
consumes:
- application/json
produces:
- application/json
A swagger file can also contain a paths section, which defines a set of endpoint paths and the associated operations
and resources for that path. For example, the following is a portion of the common_pl-[Link] file, which
defines the first path in the Common API, /activities.
paths:
/activities:
get:
summary: "Retrieve the `Activity` elements that are assigned to the caller"
description: "Retrieves the `Activity` elements that are assigned to the caller"
operationId: getActivities
x-gw-extensions:
childResourceType: Activity
operationType: get-collection
resourceType: Activities
x-gw-parameter-sets:
- get-collection
responses:
"200":
description: "The paginated list of `Activity` elements"
schema:
$ref: "#/definitions/ActivityList"
Apiconfig files
Within the context of Cloud API, an apiconfig file is a glue file that maps both resources to Gosu files. The apiconfig
file is also where default sort orders for collections are defined.
The only time you need to configure an apiconfig file to connect resources to Gosu files is when you are completing a
configuration for CRUD endpoints created by the REST endpoint generator. For more information, see “Configuring
glue and impl classes for generated endpoints” on page 143.
For more information on defining default sort orders, see “Making properties sortable” on page 83.
Integration graphs
An integration graph is a special base configuration schema and mapper that is used by certain base configuration
outbound integrations to send information about a parent object and its children objects. Integration graphs are not used
by Cloud API, but the files that define them are a part of Cloud API.
As of this release, Cloud API has the following integration graphs:
• The ClaimCenter claim_graph, whose parent is Claim
• The PolicyCenter policyperiod_graph, whose parent is PolicyPeriod
• The ContactManager contact_graph, whose parent is Contact
There are several outbound integrations that make use of integration graphs. Depending on the InsuranceSuite
application, this may include:
• Guidewire App Events
• Cloud Rules
• Analytics and Data Services (ADS)
Guidewire recommends against insurers configuring integration graphs directly. However, if you create an extension
entity that is a descendent of one of the parent entities listed above, you can add that entity to the appropriate
integration graph. This is done through the REST endpoint generator. For more information, see “Integration graphs”
on page 159.
WARNING: Guidewire recommends against insurers using the integration graph schema/mapping files for
custom outbound integration points. This is because, if not used properly, the integration point could attempt to
generate a payload so large that it compromises server performance or prevents the server from running.
Integration graphs 27
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
28 Integration graphs
chapter 6
Configuration troubleshooting
If you have an issue with your Cloud API configuration, your primary source of information for troubleshooting is the
log files.
Configuration troubleshooting 29
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
30 Configuration troubleshooting
part 2
You can add new properties to Cloud API resources. This can be a new property in a base configuration resource, or a
new property in a custom resource. The data mapping requirements for the new property depend on the value that the
property stores. The following table summarizes the different use cases.
For a detailed overview of schema architecture and extension file syntax in Cloud API, see “Syntax for schema
configuration files” on page 21
If you want to interact directly with the concepts in this topic, go to the following tutorial: “Tutorial: Schema
configuration with scalars” on page 67
Note: Guidewire does not recommend adding inline arrays to schemas. If a given resource has an array of
related resources and you want to expose those related resource in Cloud API, Guidewire recommends doing so
by creating a separate set of child endpoints for the related resources. For information on how to create
endpoints for a resource, see “The REST endpoint generator” on page 117.
Adding scalars
Extension files
Every API in Cloud API has a set of three extension files that are used to extend resources used by the endpoints in that
API. This includes:
• A schema extension file, where you can define new properties for a resource
• A mapper extension file, where you can define how data from the database is used to populate extension fields
• An updater extension file, where you can define how data from extension fields is written to the database
The names of the extension files are defined in the table below. Note that the file name always starts with the API
name. For example, the schema extension file for the Common API is common_ext-[Link].
Scalars
A scalar is a single simple value, such as a string, number, datetime, or Boolean.
To add a scalar property to a resource, you must modify the schema, mapping, and updater file for the API that
contains the endpoints that use the schema. For example, suppose you want to add an extension property for the User
schema. This schema is used by endpoints in the Common API. Therefore, you need to modify the following files:
• common_ext-[Link]
• common_ext-[Link]
• common_ext-[Link]
Note: See also “Tutorial: Schema configuration with scalars” on page 67
Adding scalars 33
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
You can add the name of one or more schemas to the definitions section. In each schema, you can define a
properties section, which lists one or more properties defined for the schema.
If the property is a base configuration property that is not exposed to Cloud API, Guidewire recommends naming the
schema property with an "_Ext" suffix. This is to prevent any possible future conflicts if Guidewire adds the property
to the base configuration in a later release.
For scalar values, each property must also have a type.
For example, in the base configuration data model, the User entity has a JobTitle field (this user's job title) and an
ExternalUser field (whether the user works for the insurer or not). The Admin API has /user endpoints, but
JobTitle and ExternalUser are not exposed in the Cloud API User resource. Suppose you want to expose them, and
you want JobTitle to be writeable and ExternalUser be read-only. You would add the following to the
admin_ext-[Link] extension file.
"definitions": {
"User": {
"properties": {
"jobTitle_Ext" : {
"title": "jobTitle_Ext",
"description": "The user's job title",
"type": "string",
},
"externalUser_Ext" : {
"title": "externalUser_Ext",
"description": "Whether the user is internal (is an employee of the insurer) or not",
"type": "boolean",
"readOnly": true
}
}
}
}
Data model column type Java object type Schema type Schema format
bit Boolean boolean
CurrencyAmount (see below)
dateonly Date string date (required)
datetime Date string date-time (required)
decimal BigDecimal string gw-bigdecimal (required)
integer Integer integer int32 (optional)
longint Long integer int64 (required)
longtext String string
mediumtext String string
MonetaryAmount (see below)
money BigDecimal string gw-bigdecimal (required)
percentage Integer integer int32 (optional)
shorttext String string
text String string
varchar String string
34 Adding scalars
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
information on how to configure schema fields that use these datatypes, see “Adding compound datatypes” on page
39.
Data model column type Java object type Schema type Schema format
n/a BigInteger string gw-biginteger (required)
n/a byte[] string byte (required; this will be treated as the Base64-encoded value)
n/a Double number You can optionally specify double (optional)
n/a Float number float (required)
n/a LocalDate string date (required)
n/a LocalTime string time (required)
For example, suppose the CustomEntity_Ext entity has an ExpirationDate field. The corresponding resource
property is read-only, nullable, and was added in version 1.1.0. The property declaration would be:
"definitions": {
"CustomEntityExt": {
"properties": {
"expirationDate": {
"type": "string",
"format": "date-time",
"readOnly": true,
"x-gw-nullable": true,
"x-gw-sinceVersion": "1.1.0"
},
...
Adding scalars 35
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
For example, suppose the CustomEntity_Ext entity has an SeverityType field, which is a typekey set to a value in
the SeverityType typelist. The corresponding resource property must be specified at create time, cannot be modified
after creation, and is both filterable and sortable. The property declaration would be:
"definitions": {
"CustomEntityExt": {
"properties": {
"severityType": {
"$ref": "#/definitions/TypeKeyReference",
"x-gw-extensions": {
"typelist": "SeverityType",
"createOnly": true,
"requiredForCreate": true,
"filterable": true,
"sortable": true
},
...
You can add the name of one or more schemas to the mappers section. In each schema, you can define a properties
section, which lists one or more properties defined in the schema.
For each property, you must identify how data is mapped from the Guidewire data model to the property. This is done
using a path attribute.
For example, in the base configuration data model, the User entity has a JobTitle field and an ExternalUser field.
The Admin API has /user endpoints, but JobTitle and ExternalUser are not exposed in the Cloud API User
resource. If you wanted to expose them, you would first add them to the schema. Then, you would add the following to
the admin_ext-[Link] extension file.
"mappers": {
"User": {
"properties": {
"jobTitle_Ext": {
"path": "[Link]"
},
"externalUser_Ext": {
"path": "[Link]"
}
}
}
}
"mappers": {
"CustomEntityExt": {
"properties": {
36 Adding scalars
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"id": {
"path": "CustomEntity_Ext.RestId"
},
"isActive": {
"path": "CustomEntity_Ext.IsActive"
},
"customDescription": {
"path": "CustomEntity_Ext.CustomDescription"
},
"expirationDescription": {
"path": "CustomEntity_Ext.ExpirationDate"
}
}
}
}
Note: Within the Guidewire data model, every entity has a virtual field named DisplayName. An entity name is
a Gosu expression that determines the value for an entity's DisplayName field. For example, the ABPerson
entity might have its entity name set to [Link] + ", " + [Link], which for a
given ABPerson would render as "Newton, Ray". If an entity has no defined entity name, the default behavior is
to return the concatenation of every field in the entity.
If you add a property to a schema that maps to an entity's display name, be sure that there is an entity name
defined for that entity. If there is not, then the application will return a concatenation of every field in the entity.
This could potentially make information available in Cloud API that you do not want exposed through Cloud
API.
For more information on entity names, see the Configuration Guide.
You can add the name of one or more schemas to the updaters section. In each schema, you can define a properties
section, which lists one or more properties defined in the schema.
For each writeable property, you must identify how data is mapped from the property to the Guidewire data model.
Similar to the mapping file, this is done using a path attribute. For scalars, it is not unusual for a given property to have
the same path value on both the mapping file and the updater file.
For example, in the base configuration data model, the User entity has a JobTitle field and an ExternalUser field.
The Admin API has /user endpoints, but JobTitle and ExternalUser are not exposed in the Cloud API User
resource. Suppose you want to expose these fields to Cloud API, and you want to make JobTitle writeable and
ExternalUser read-only. You would first add these properties to the schema and the mapping file. Then, you would
add the JobTitle property to the admin_ext-[Link] extension file. (ExternalUser is omitted from the
updater file because it is read-only.
"updaters": {
"User": {
"properties": {
"jobTitle_Ext": {
"path": "[Link]"
}
}
}
}
Adding scalars 37
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
38 Adding scalars
chapter 8
InsuranceSuite includes several datatypes where multiple values are stored as a unit. This includes the following:
• Typekey (containing a code and a name)
• MonetaryAmount and CurrencyAmount (containing a currency and an amount)
• SpatialPoint (containing a longitude coordinate and a latitude coordinate)
For example, an activity's assignmentStatus property is a typekey. Thus, the response payload for an activity's
assignment status has two sub-fields (code and name):
"assignmentStatus": {
"code": "assigned",
"name": "Assigned"
}
Use the schema, mapping, and updater extension files to add a compound datatype to a resource.
Note: See also “Tutorial: Schema configuration with compound datatypes” on page 69
If you are defining a typekey property, you must also define an x-gw-extensions property with a child typelist
property set to the name of the typelist. For example:
"properties": {
"assignmentStatus": {
...
"$ref": "#/definitions/TypeKeyReference",
"x-gw-extensions": {
"typelist": "AssignmentStatus"
}
}
}
For example, the mapping for the Activity data model entity's AssignmentStatus field looks like this:
"mappers": {
"Activity": {
"properties": {
"assignmentStatus": {
"path": "[Link]",
"mapper": "#/mappers/TypeKeyReference"
}
}
}
}
The following table lists the resolver names for the common compound datatypes.
For example, the updater for the Activity resource's assignmentStatus property looks like this:
"updaters": {
"Activity": {
"properties": {
"assignmentStatus": {
"path": "[Link]",
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
},
...
A foreign key property is a property that maps to another object. For example, every activity has an assigned user. In
the data model, the Activity entity has an AssignedUser field. This is a foreign key that associated each activity with
its assigned user. Similarly, in the Cloud API Activity resource, there is an assignedUser foreign key property.
Value resolvers
A value resolver is a class used in updaters to return the resource that a foreign key property points to. Within the
context of a foreign key property:
• The root (or the root resource) is the resource that has the foreign key property.
• The resolved value is the resource that the foreign key points to.
For example, suppose the Activity resource has a foreign key field named AssignedUser that points to a User
resource. In this case:
• The root is Activity.
• The resolved value is the User that [Link] points to.
The term resolving the reference refers to the act of determining the resource that the foreign key property points to.
When adding a foreign key property to an updater extension file, the property's updater references a value resolver.
Cloud API provides multiple value resolvers. Some of them are for a specific base configuration entity. Others provide
more generic functionality. Some of them are abstract, in which case you must extend the value resolver for a specific
type of entity. The following is a brief overview of each resolver. The following topics go into greater detail about
when and how to use each resolver.
For more information on the use cases for entity-specific value resolvers, see “Updater case 1: Root and resolved value
have no common ancestor” on page 49 and “Updater case 2: Root and resolved value have a common ancestor” on
page 51.
KeyableBeanJsonValueResolver
The KeyableBeanJsonValueResolver is a generic value resolver that can be used when either:
• There is no entity-specific value resolver for the entity the foreign key references.
• There is an entity-specific value resolver for the entity the foreign key references, but it has behaviors that are not
appropriate for the custom foreign key.
The KeyableBeanJsonValueResolver is declared in the [Link] package.
To use this resolver, the schema property for the foreign key must include a [Link] field
that identifies the type of resource the foreign key points to. For example, if you had a backupUser_Ext foreign key
property on Activity that points to User, then the schema property declaration would be as follows:
"Activity": {
"properties": {
"backupUser_Ext": {
...
"x-gw-extensions": {
"resourceType": "User"
}
}
}
AbstractKeyableBeanJsonValueResolver
The AbstractKeyableBeanJsonValueResolver is also a generic value resolver. It is abstract and therefore is never
used directly. But it can be extended, and the subclass resolver can apply to any entity.
Subclassing this resolver gives you the ability to specify "isEntityViewable logic". This logic can control access to an
object based on business-specific conditions of the object. For example, this logic could mandate that a foreign key
property to User can reference only users with the "Manager" role.
For more information on using the AbstractKeyableBeanJsonValueResolver, see “Update case 3: Accessibility of
resolved value is conditional” on page 52.
CollectionBasedJsonValueResolver
Note: This value resolver is theoretically applicable in all applications. However, the primary use case for this
value resolver occurs most often in PolicyCenter.
In some situations, the resolved value cannot be determined using id only. In these situations, the correct resolved value
can be selected only by selecting a KeyableBean from a collection contained on some ancestor entity. The most
common situation that this occurs is when resolving effdated entities.
For more information on using the CollectionBasedJsonValueResolver, see “Update case 4: Resolved value cannot
be easily resolved by id alone” on page 53.
• refid
• type
• uri
"definitions": {
"Activity": {
"properties": {
"backupUser_Ext": {
"title": "BackupUser_Ext",
"description": "The backup user for the activity",
"$ref": "#/definitions/SimpleReference",
"x-gw-extensions": {
"resourceType": "User"
}
}
}
}
}
}
<pathToForeignKeyField>.RestV1_AsReference
The mapper attribute is set to "#/mappers/ResourceReference". The ResourceReference mapper maps information
from an entity into the fields defined by the SimpleReference schema.
The syntax for setting these values is:
"<resourceName>": {
"properties": {
"<foreignKeyPropertyName>": {
"path": "<pathToForeignKeyField>.RestV1_AsReference",
"mapper": "#/mappers/ResourceReference"
}
}
}
For example, suppose you want to implement the mapping for the BackupUser_Ext extension added to the Activity
entity in the previous example. To do this, you would add the following to the common_ext-[Link] file:
"mappers": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext.RestV1_AsReference",
"mapper": "#/mappers/ResourceReference"
}
}
}
}
A value resolver is a class used in updaters to return the resource that a foreign key property points to. The resource
that the foreign key points to is sometimes referred to as the resolved value. The term resolving the reference refers to
the act of determining the resource that the foreign key property will point to.
Cloud API provides value resolvers for some base configuration entities. It also provides a set of more generic value
resolvers. The best value resolver to use depends on the type of relationship the root resource has with the foreign key
resource. There are several possible relationships:
• “Updater case 1: Root and resolved value have no common ancestor” on page 49
• “Updater case 2: Root and resolved value have a common ancestor” on page 51
• “Update case 3: Accessibility of resolved value is conditional” on page 52
• “Update case 4: Resolved value cannot be easily resolved by id alone” on page 53
entityURIMappings:
<resourceName>:
uri: "${parentUri}/<endpointPathEnd>/${<pathToRestId>}"
parent: "<pathFromRootResourceToParent>"
For example, suppose you had a custom entity that was not part of an integration graph. Its name is
CustomEntity_Ext, the end of its endpoint path is custom-entities-ext, and its parent is Activity. The URI
mapping would look like this:
entityURIMappings:
CustomEntity_Ext:
uri: "${parentUri}/custom-entities-ext/${CustomEntity_Ext.RestId}"
parent: "CustomEntity_Ext.Activity"
"updaters": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext",
"valueResolver": {
"typeName": "[Link]"
}
}
}
}
}
"setByRefid": false
For example, the following updater for backupUser_Ext disables reference by refid.
"updaters": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext",
"valueResolver": {
"typeName": "[Link]",
"setByRefid:" false
}
}
}
}
}
"updaters": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext",
"valueResolver": {
"typeName": "[Link]"
}
}
}
}
}
You can find a list of entity-specific value resolvers in Studio by executing a Navigate > File command (CTRL +
SHIFT + N) and entering "valueresolver". Be aware that the entity-specific value resolvers may have special behaviors
to enable common Cloud API use cases. These behaviors may not be appropriate for an updater to a custom foreign
key. Whenever you use a entity-specific value resolver, Guidewire recommends testing the associated PATCH and
POST behaviors thoroughly.
<extension
xmlns="[Link]
entityName="Activity">
...
<foreignkey
fkentity="User"
name="BackupUser_Ext"
nullok="true"/>
...
"definitions": {
"Activity": {
"properties": {
"backupUser_Ext": {
"title": "BackupUser_Ext",
"description": "The backup user who can complete the activity if the assigned user is on vacation",
"$ref": "#/definitions/SimpleReference",
"x-gw-extensions": {
"resourceType": "User"
}
},
...
"mappers": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext.RestV1_AsReference",
"mapper": "#/mappers/ResourceReference"
},
"updaters": {
"Activity": {
"properties": {
"backupUser_Ext": {
"path": "Activity.BackupUser_Ext",
"valueResolver": {
"typeName": "[Link]"
}
},
"updaters": {
"Activity": {
"properties": {
"documentToUpload_Ext": {
"path": "Activity.DocumentToUpload_Ext",
"valueResolver": {
"typeName": "[Link]"
"resolvedValueToAncestorPath": "[Link]",
"rootToAncestorPath": "[Link]"
}
}
}
}
}
If you specify resolvedValueToAncestorPath but do not specify rootToAncestorPath, then the root of the updater
will be used as the ancestor to match.
Cloud API also provides value resolvers for specific base configuration entities. These resolvers may automatically
implement common ancestor validation.
You can find a list of entity-specific value resolvers in Studio by executing a Navigate > File command (CTRL +
SHIFT + N) and entering "valueresolver". Be aware that the entity-specific value resolvers may have special behaviors
to enable common Cloud API use cases. These behaviors may not be appropriate for an updater to a custom foreign
key. Whenever you use a entity-specific value resolver, Guidewire recommends testing the associated PATCH and
POST behaviors thoroughly.
When you configure a foreign key in Cloud API, you can specify this type of conditional foreign key logic. This is
done in a layer of logic known as "isEntityViewable logic". This optional logic specifies that you can set a foreign
key property to an object only if the object meets certain conditions.
The KeyableBeanJsonValueResolver does not have any isEntityViewable logic. If you want to implement
isEntityViewable logic for a custom foreign key, you must use the AbstractKeyableBeanJsonValueResolver.
The AbstractKeyableBeanJsonValueResolver
The AbstractKeyableBeanJsonValueResolver is abstract and therefore is never used directly. If you want to specify
isEntityViewable logic, you must implement a concrete subclass of this resolver. The subclass has an
isEntityViewable method where you can specify your logic. You then reference this subclass in the appropriate
updater file.
▪ Returning false indicates the resolved value is not accessible, and the corresponding foreign key property
cannot be set to it.
For example, suppose that the Activity entity has an ApprovalManager_Ext field. This field identifies the manager of
the activity, who is responsible for addressing the situation when an activity is still open past its due date. The
ApprovalManager_Ext field is set to a User, but it can only be set to a user who has the "Manager" role. The value
resolver for this business requirement would be as follows.
package [Link]
uses [Link]
uses [Link]
@NotNull
protected override property get ResolvedValueType() : Class<User> {
return User
}
"updaters": {
"Activity": {
"properties": {
...
"activityManager_Ext": {
"path": "Activity.ActivityManager_Ext",
"valueResolver": {
"typeName": "[Link]"
}
}
• The entity might be effdated. It is difficult to load effdated entities using id alone.
• The id might be unique only within the context of its parent. For example, a coverage’s id is a coverage pattern, but
the same coverage (with the same id) can exist under multiple vehicles or buildings on the same policy. The id
alone does not uniquely identify the desired coverage.
• The id might be computed, which would make it possible but impractical to load the entity directly from the
database. For example, for account contacts, the id is the id of the linked Contact entity. Querying on the
AccountContact is possible, but it would require at least a join on the Contact table.
• The id might not related to an entity. For example, the Cloud API PolicyContact maps to a PolicyContactWrapper,
which is a POGO object and not a database entity.
For example, suppose you are using the Personal Auto line of business in the base configuration of PolicyCenter. In
this line, there is a PersonalVehicle entity which has an array of VehicleDrivers. You want to be able to identify
one of the drivers as the "primary driver" of the vehicle. To do this, you add a PrimaryDriver_Ext edge foreign key to
PersonalVehicle that points to the primary driver. However, VehicleDriver is an effdated entity, and therefore the
correct object to reference cannot be loaded from the bundle or database using only its id.
The KeyableBeanJsonValueResolver resolves foreign keys using only the target's id. This will not work for the
circumstances mentioned in the previous list. To load these types of entities, you must use the
CollectionBasedJsonValueResolver.
The CollectionBasedJsonValueResolver
The CollectionBasedJsonValueResolver can identify targets when the target cannot be easily identified by id alone,
and when necessary, it can ensure that the root object and target object share a common ancestor. It has two getters:
• get ResolvedValueType - Returns the type of the target object
• get AncestorType - Returns the type of the common ancestor
It also has two methods for identifying the target:
• getPossibleResolvedValues - Returns the collection that contains the target object
• idMatchExpression - Returns a predicate that, when run on the collection, will identify the target
The CollectionBasedJsonValueResolver is abstract and therefore is never used directly. If you want to use it, you
must implement a concrete subclass of this resolver. In the subclass, you must override the previously mentioned
getters and methods. You then reference this subclass in the appropriate updater file.
return [Link]
}
where:
• TargetEntityType is the target entity type (such as VehicleDriver)
• AncestorEntityType is the ancestor entity type (such as PersonalVehicle)
• ArrayContaininPotentialResolvedValue is the array that contains the target object (such as Drivers)
For example, suppose you are implementing the previously mentioned use case where you want to have a
PrimaryDriver_Ext field on PersonalVehicle that points to an instance of VehicleDriver. The value resolver for
this business requirement would be as follows.
package [Link]
uses [Link]
uses [Link]
"updaters": {
"PersonalVehicle": {
"properties": {
...
"primaryDriver_Ext": {
"path": "PersonalVehicle.PrimaryDriver_Ext",
"valueResolver": {
"typeName": "[Link]",
"resolvedValueToAncestorPath": "[Link]"
}
},
...
With effdated entities, the object that has the foreign key property (the root object) and the object that the foreign key
points to (the target object) must have a common ancestor.
• You will always need a resolvedValueToAncestorPath property, as shown above, to identify how to map from
the target object to the common ancestor.
• If the common ancestor is some object above the root object, then you also need a rootToAncestorPath value that
identifies how to navigate from the root to the common ancestor.
In this example, the root object (PersonalVehicle) is the common ancestor. Hence, the rootToAncestorPath is not
required.
Adding one-to-ones
A one-to-one relationship is a relationship that two entities have. One acts as the parent, and the other as the child. For
the parent, each instance may have an association with up to one instance of the child entity. For the child, each
instance must be associated with exactly one parent.
The Guidewire data model supports a <one-to-one> element. This element enforces the parent's "up-to-one"
cardinality and the child's "exactly-one" cardinality. Many one-to-one relationships are implemented using this
element. However, in some situations, the one-to-one relationship is built using only a <foreignKey> element.
Common use cases
A common use case for one-to-one relationships is to separate extension fields that apply to only a sufficiently small
subset of the entities. This is done to avoid database tables that are wide and sparsely populated.
For example, suppose an insurer has a regulatory requirement to have a set of activities periodically reviewed by the
insurer's legal team. There are several fields needed to track this legal review, but they are applicable to only about 5%
of all activities.
The insurer could add these fields directly to the Activity entity. But given that so few activities need these fields, this
would make the xc_activity table in the database wider and more sparsely populated.
To improve database performance, the insurer opts to create a second entity, ActivityLegalInfo_Ext, which has a
one-to-one relationship with Activity.
• The Activity entity is the parent. Each activity can be associated with up to one ActivityLegalInfo_Ext.
• ActivityLegalInfo_Ext is the child. Each instance must be associated with exactly one Activity.
Inline objects: Foreign key fields
In Cloud API, foreign key relationships follow a typical pattern:
• Typically, there are CRUD endpoints for both the parent and the child.
• The child appears in the parent schema using the SimpleReference schema. (This schema has a small set of fields
applicable to all entities, such as displayName, id, type, and uri.)
For example, the Activity entity has an assignedUser field, which is a foreign key that references User.
• There are CRUD endpoints for both Activity and User.
• In the Activity schema, there is an assignUser field which includes information about the associated User. It
uses the SimpleReference schema, as shown in the example below.
"attributes": {
"activityPattern": "contact_insured",
Adding one-to-ones 57
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"assignedUser": {
"displayName": "Andy Applegate",
"id": "demo_sample:1",
"type": "User",
"uri": "/admin/v1/users/demo_sample:1"
},
"id": "cc:SO8RJJZtEa-Tyqlrxw97y",
"subject": "Contact insured"
},
"attributes": {
"activityLegalInfo_Ext": {
"id": "cc:S2qhgxij6HvhXz6K3t39K",
"legalCaseNumber": "0003",
"legalReviewDate": "2022-05-05T07:00:00.000Z"
},
"activityPattern": "contact_insured",
"assignedUser": {
"displayName": "Andy Applegate",
"id": "demo_sample:1",
"type": "User",
"uri": "/admin/v1/users/demo_sample:1"
},
"id": "cc:SO8RJJZtEa-Tyqlrxw97y",
"subject": "Contact insured"
},
Example one-to-one
The rest of the topics in this section use the following business example.
Suppose the insurer had a regulatory requirement to have a set of activities periodically reviewed by the insurer's legal
team. There are several fields needed to track this legal review, but they are applicable to only about 5% of all
activities.
To improve database performance, the insurer opts to store this information in an ActivityLegalInfo_Ext entity and
define it as a one-to-one with Activity.
• The Activity entity is the parent. Each activity can be associated with up to one ActivityLegalInfo_Ext.
• ActivityLegalInfo_Ext is the child. Each instance must be associated with exactly one Activity.
To implement this, the following has been added to the data model:
• Activity entity
◦ ActivityLegalInfo_Ext
58 Adding one-to-ones
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
▪ one-to-one
▪ fkentity: ActivityLegalInfo_Ext
▪ nullok: true
• ActivityLegalInfo_Ext entity
◦ LegalCaseNumber
▪ varchar with size 30
◦ LegalReviewDate
▪ datetime
◦ Activity
▪ foreign key
▪ fkentity: Activity
▪ nullok: false
Note the following:
• On Activity, the ActivityLegalInfo_Ext field has nullok set to true. This is because some Activity instances
will have an associated ActivityLegalInfo_Ext, but most will not.
• On ActivityLegalInfo_Ext, the Activity field has nullok set to false. This is because every
ActivityLegalInfo_Ext must be associated to an Activity.
For a complete list of all code used to build this example, see “Complete code sample for one-to-ones” on page 64.
Adding one-to-ones 59
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"definitions": {
"Activity": {
"properties": {
...
"activityLegalInfo_Ext": {
"title": "ActivityLegalInfo_Ext",
"description": "One-to-one association to ActivityLegalInfo_Ext",
"$ref": "#/definitions/ActivityLegalInfo_Ext"
}
}
},
"definitions": {
...
"ActivityLegalInfo_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "Object ID",
"type": "string",
"readOnly": true
},
"legalCaseNumber": {
"title": "LegalCaseNumber",
"description": "Legal case number",
"type": "string"
},
"legalReviewDate": {
"title": "LegalReviewDate",
"description": "Legal review date",
"type": "string",
"format": "date-time"
}
}
}
The inline child properties are typically scalars, compound datatypes, or foreign keys. For more information on how to
configure schemas for these type of properties, see:
• “Adding scalars” on page 33
• “Adding compound datatypes” on page 39
• “Adding foreign keys” on page 43
60 Adding one-to-ones
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• The parent mapper must specify the path mapping for the one-to-one property that points to the child.
• You must also add a new mapper for the child that specifies the path mappings for the inline child properties.
"mappers": {
"Activity": {
"properties": {
...,
"activityLegalInfo_Ext": {
"path": "Activity.ActivityLegalInfo_Ext",
"mapper": "#/mappers/ActivityLegalInfo_Ext"
}
}
},
"mappers": {
...
"ActivityLegalInfo_Ext": {
"schemaDefinition": "ActivityLegalInfo_Ext",
"root": "entity.ActivityLegalInfo_Ext",
"properties": {
"id": {
"path": "ActivityLegalInfo_Ext.RestId"
},
"legalCaseNumber": {
"path": "ActivityLegalInfo_Ext.LegalCaseNumber"
},
"legalReviewDate": {
"path": "ActivityLegalInfo_Ext.LegalReviewDate"
}
}
}
}
The inline child properties are typically scalars, compound datatypes, or foreign keys. For more information on how to
configure mappers for these type of properties, see:
• “Adding scalars” on page 33
• “Adding compound datatypes” on page 39
• “Adding foreign keys” on page 43
Adding one-to-ones 61
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• The parent updater must specify the path mapping for the one-to-one property that points to the child.
• You must also add a new updater for the child that specifies the path mappings for the inline child properties.
"updaters": {
"Activity": {
"properties": {
...
"activityLegalInfo_Ext": {
"path": "Activity.ActivityLegalInfo_Ext",
"create": "new ActivityLegalInfo_Ext(Activity)",
"updaterRef": "#/updaters/ActivityLegalInfo_Ext"
}
}
},
...
"updaters": {
...,
"ActivityLegalInfo_Ext": {
"schemaDefinition": "ActivityLegalInfo_Ext",
"root": "entity.ActivityLegalInfo_Ext",
"properties": {
"legalCaseNumber": {
"path": "ActivityLegalInfo_Ext.LegalCaseNumber"
},
"legalReviewDate": {
"path": "ActivityLegalInfo_Ext.LegalReviewDate"
}
}
}
}
The inline child properties are typically scalars, compound datatypes, or foreign keys. For more information on how to
configure updaters for these type of properties, see:
• “Adding scalars” on page 33
• “Adding compound datatypes” on page 39
• “Adding foreign keys” on page 43
62 Adding one-to-ones
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
To extend checksums to include child fields, add the following getter override to the class. The <childResource>
reference must be changed to the name of the one-to-one child resource.
For example, the following code is the complete ActivityExtResource class with extensions for the
ActivityLegalInfo_Ext one-to-one child.
package [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
@Export
Adding one-to-ones 63
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
GET /common/v1/activities/xc:20201
{
"data": {
"attributes": {
"activityLegalInfo_Ext": {
"id": "cc:S2qhgxij6HvhXz6K3t39K",
"legalCaseNumber": "0003",
"legalReviewDate": "2022-05-05T07:00:00.000Z"
},
"activityPattern": "90_day_diary",
"activityType": {
"code": "general",
"name": "General"
},
Keep in mind that Cloud API does not include fields in responses when the values of those fields is NULL. Thus, in
order to test the behavior of one-to-one child fields, you must GET an object that already has a one-to-one child with at
least one non-NULL field.
Requests
In requests, inline child objects can be included along with fields declared directly on the primary data model entity.
For example, the following shows the request body for a PATCH /activities call. Note that the request includes an
activityLegalInfo_Ext object with its own fields as well as a field declared directly on Activity (priority).
PATCH /common/v1/activities/xc:20207
{
"data": {
"attributes": {
"priority": {
"code": "low"
},
"activityLegalInfo_Ext": {
"legalCaseNumber": "0004",
"legalReviewDate": "2022-05-07"
}
}
}
}
64 Adding one-to-ones
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
<extension
xmlns="[Link]
entityName="Activity">
...
<onetoone
fkentity="ActivityLegalInfo_Ext"
name="ActivityLegalInfo_Ext"
nullok="true"/>
...
<?xml version="1.0"?>
<entity
xmlns="[Link]
entity="ActivityLegalInfo_Ext"
table="activitylegalinfo_ext"
type="retireable">
<column
name="LegalCaseNumber"
nullok="true"
type="varchar">
<columnParam
name="size"
value="30"/>
</column>
<column
name="LegalReviewDate"
nullok="true"
type="datetime"/>
<foreignkey
fkentity="Activity"
name="Activity"
nullok="false"/>
<implementsEntity
name="Extractable"/>
</entity>
"definitions": {
"Activity": {
"properties": {
"activityLegalInfo_Ext": {
"title": "ActivityLegalInfo_Ext",
"description": "One-to-one association to ActivityLegalInfo_Ext",
"$ref": "#/definitions/ActivityLegalInfo_Ext"
}
}
},
"ActivityLegalInfo_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "Object ID",
"type": "string",
"readOnly": true
},
"legalCaseNumber": {
"title": "LegalCaseNumber",
"description": "Legal case number",
"type": "string"
},
"legalReviewDate": {
"title": "LegalReviewDate",
"description": "Legal review date",
"type": "string",
"format": "date-time"
}
}
}
}
...
Adding one-to-ones 65
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"mappers": {
"Activity": {
"properties": {
"activityLegalInfo_Ext": {
"path": "Activity.ActivityLegalInfo_Ext",
"mapper": "#/mappers/ActivityLegalInfo_Ext"
}
}
},
"ActivityLegalInfo_Ext": {
"schemaDefinition": "ActivityLegalInfo_Ext",
"root": "entity.ActivityLegalInfo_Ext",
"properties": {
"id": {
"path": "ActivityLegalInfo_Ext.RestId"
},
"legalCaseNumber": {
"path": "ActivityLegalInfo_Ext.LegalCaseNumber"
},
"legalReviewDate": {
"path": "ActivityLegalInfo_Ext.LegalReviewDate"
}
}
}
}
"updaters": {
"Activity": {
"properties": {
"activityLegalInfo_Ext": {
"path": "Activity.ActivityLegalInfo_Ext",
"create": "new ActivityLegalInfo_Ext(Activity)",
"updaterRef": "#/updaters/ActivityLegalInfo_Ext"
}
}
},
"ActivityLegalInfo_Ext": {
"schemaDefinition": "ActivityLegalInfo_Ext",
"root": "entity.ActivityLegalInfo_Ext",
"properties": {
"legalCaseNumber": {
"path": "ActivityLegalInfo_Ext.LegalCaseNumber"
},
"legalReviewDate": {
"path": "ActivityLegalInfo_Ext.LegalReviewDate"
}
}
}
}
package [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
@Export
class ActivityExtResource extends ActivityCoreResource {
66 Adding one-to-ones
chapter 11
Tutorial steps
1. In Studio, open the admin_ext-[Link] file.
2. The file contains the following line of code.
"definitions": { }
Replace that line with the following, which defines three new properties.
"definitions": {
"User": {
"properties": {
"createDate_Ext" : {
"title": "CreateDate",
"description": "The date on which this user was created",
"type": "string",
"format": "date-time",
"readOnly": true
},
"departmentName_Ext": {
"title": "DepartmentName",
"description": "The name of the department this user works in",
"type": "string"
}
}
}
}
There is an additional readOnly property specified for createDate. For more information, see “Making properties
required by the database” on page 79.
At this point, you have defined the structure of the new properties. But there is no information on how data flows into
and out of these properties.
3. In Studio, open the admin_ext-[Link] file.
4. The file contains the following line of code.
"mappers": { }
Replace that line with the following, which defines how data is mapped from the database to the createTime and
departmentName properties.
"mappers": {
"User": {
"properties": {
"createDate_Ext" : {
"path" : "[Link]"
},
"departmentName_Ext": {
"path": "[Link]"
}
}
}
}
You now have new properties with information on how data flows into each property. If these properties were needed
only for GETs (and not POSTs or PATCHes), you could restart PolicyCenter now and test your work. However, the
departmentName_Ext property needs to be writeable.
"updaters": { }
Replace that line with the following, which defines how data is mapped from the database to the departmentName
property.
"updaters": {
"User": {
"properties": {
"departmentName_Ext": {
"path": "[Link]"
}
}
}
}
The departmentName_Ext property can now be used for GETs, POSTs, and PATCHes. The createDate_Ext property
has been omitted from the updater file. Therefore, it is read-only and only appears in responses.
7. Start (or restart) PolicyCenter.
c. At the end of the row of radio buttons, change the drop-down list value from Text to JSON.
d. Paste the following into the text field underneath the radio buttons.
{
"data": {
"attributes": {
"username": "scalarTestUser",
"departmentName_Ext": "schema config tester"
}
}
}
e. Click Send.
Results
The response should be "201 Created". The response body should contain information about the new user, including
the create date and department. Note that:
• The structure of these fields (their names and types) comes from the schema file.
• The data in the POST response comes from the mapping file.
• The setting of the user's department was accomplished by the updater file.
Tutorial steps
1. In Studio, open the admin_ext-[Link] file.
2. The file contains the following line of code.
"definitions": { }
Replace that line with the following, which defines the new property. (If you have already done the tutorial for scalars,
then add the experienceLevel property to the existing extensions.)
"definitions": {
"User": {
"properties": {
"experienceLevel_Ext": {
"title": "ExperienceLevel_Ext",
"description": "The user's level of experience (high, mid, low)",
"$ref": "#/definitions/TypeKeyReference",
"x-gw-extensions": {
"typelist": "UserExperienceType"
}
}
}
}
}
At this point, you have defined the structure of the new property. But there is no information on how data flows into
and out of this property.
3. In Studio, open the admin_ext-[Link] file.
4. The file contains the following line of code.
"mappers": { }
Replace that line with the following, which defines how data is mapped from the database to the experienceLevel
property. (If you have already done the tutorial for scalars, then add the experienceLevel property to the existing
extensions.)
"mappers": {
"User": {
"properties": {
"experienceLevel_Ext": {
"path": "[Link]",
"mapper": "#/mappers/TypeKeyReference"
}
}
}
}
You now have a new property with information on how data flows into it. If this property were needed only for GETs
(and not POSTs or PATCHes), you could restart PolicyCenter now and test your work. However, the experienceLevel
property needs to be writeable.
5. In Studio, open the admin_ext-[Link] file.
6. The file contains the following line of code.
"updaters": { }
Replace that line with the following, which defines how data is mapped from the database to the experienceLevel
property. (If you have already done the tutorial for scalars, then add the experienceLevel property to the existing
extensions.)
"updaters": {
"User": {
"properties": {
"experienceLevel_Ext": {
"path": "[Link]",
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
}
}
}
}
This property can now be used for GETs, POSTs, and PATCHes.
7. Start (or restart) PolicyCenter.
}
}
e. Click Send.
Results
The response should be "201 Created". The response body should contain information about the new user, including
the experience level. Note that:
• The structure of the field (its name and type) comes from the schema file.
• The experience level in the POST response comes from the mapping file.
• The setting of the user's experience level was accomplished by the updater file.
You can configure schema properties with additional behaviors, such as:
• Setting the property to read-only
• Indicating the property as required by the database
• Making the property sortable or filterable by the corresponding collection
• Adding additional metadata, such as the first version of the API to include the property
These additional behaviors are typically defined using one or more property attributes.
Still other properties can only be modified through the use of resource files, such as some custom sorts and filters.
Collection-level behaviors
Collections have a unique set of behaviors. Commands on a collection can include sorting and filtering on specific
properties, and command responses can differ based on the caller’s access permissions to the resource. Each of these
behaviors can be impacted by the collection type.
There are three collection types: query-backed, stream-backed, and dual-backed. The type of collection determines how
you extend the collection resource through schema files and resource files, and can also determine which resources and
properties are returned when using additional accessible fields filters.
Collection types
Collections can be query-backed, stream-backed, or both (dual-backed).
Query-backed collections
A query-backed collection returns results from the database one page at a time. Depending on the size of the dataset,
you might not ever have all the results in memory at once. For performance reasons, this type of collection can be
useful when working with large datasets.
Stream-backed collections
A stream-backed collection reads in everything at once and stores it all in memory. This allows for in-memory
processing of complete datasets, which can enhance resource access capabilities. However, stream-backed collections
could have negative impacts on performance when working with large datasets.
Dual-backed collections
A dual-backed collection has the functionality to perform both stream-backed and query-backed operations.
IMPORTANT:
If your configuration defaults to stream-backed data retrieval for dual-backed collections, Guidewire highly
recommends overriding collections with large datasets to use query-backed.
Resource access
When additional accessible fields filters are in place, a sortable or filterable field may not always be available to the
caller. See “Sorting and filtering on accessible fields” in “Resource access files: additional accessible fields filters” for
more information.
76 Collection-level behaviors
chapter 13
A read-only property is a property whose value cannot be set or modified through Cloud API. This can occur for the
following reasons:
• The property is read-only in the base application.
• The property is settable in the base application, but there is a business requirement that it cannot be modified
through Cloud API.
To set a property as read-only:
1. In the schema file, set the readOnly property to true
2. In the mapping file, specify a mapper as normal.
3. Omit the property from the updater file.
For example, suppose the CustomEntity_Ext entity has an ExpirationDate field. The corresponding resource
property is read-only. The property declaration would be:
"definitions": {
"CustomEntityExt": {
...
"properties": {
...
},
"expirationDate": {
"type": "string",
"format": "date-time",
"readOnly": true
}
...
"mappers": {
"CustomEntityExt": {
"expirationDate": {
"path": "CustomEntity_Ext.ExprationDate"
}
In the data model, some entity fields are required. You cannot create an instance of the entity without specifying a
value for the field, and the value can never be null. For example, suppose that an insurer has a business rule stating
every activity must have an end date (the date by which it is expected to be completed). To enforce this, the Activity
entity's EndDate field is required. These fields are sometimes referred to as required by the database.
In a schema, you can configure a resource property to reflect that it is required by the database. To do this, you must set
the following properties:
• "requiredForCreate": true
◦ This x-gw-extensions attribute indicates the property must be included in POST payloads.
• "x-gw-nullable": false
◦ This attribute indicates that when the property is specified, its value cannot be set to null
The "requiredForCreate": true attribute, by itself, only mandates that the property must be specified in a POST.
There is nothing to prevent a caller from including the property but setting the property's value to null.
The "x-gw-nullable": false attribute, by itself, only mandates that if the property is specified, the property's value
cannot be set to null. There is nothing to prevent a caller from omitting the property.
By combining the two expressions, you are stating that the property must be specified in a POST and set to a non-null
value, and anytime thereafter that the property is specified, it must be set to a non-null value. This is the equivalence of
setting a data model entity field to required.
For example, suppose the CustomEntity_Ext entity has an CustomDescription field, which is a string. The field is
required. The property declaration would be:
"definitions": {
"CustomEntityExt": {
...
"properties": {
...
"customDescription": {
"type": "string",
"x-gw-nullable": false,
"x-gw-extensions": {
"requiredForCreate": true
}
}
...
Note: There is also a concept of requiredness at the schema level. You can specify a property is required at the
schema level by specifying "required": true. When a schema property is set to required, it must be provided
every time a payload is submitted. In most cases, this is not something you would want to specify in Cloud API
schemas, as it forces you to specify a value for PATCHes, even if the property in question is not being changed.
A "writeable only at creation" property is a property whose value can only be specified in a POST and not in any
PATCH. This is used for fields that, once set, cannot be modified.
To specify a property is writeable only at creation, set the x-gw-extensions object's create-only property to true:
"x-gw-extensions": {
"create-only": true
}
For example, suppose the CustomEntity_Ext entity has an ExpirationDate field. This field can be set on a POST, but
not in any PATCH. The property declaration would be:
"definitions": {
"CustomEntityExt": {
...
"properties": {
...
"expirationDate": {
"x-gw-extensions": {
"create-only": true
}
}
}
}
}
A sortable property is a property that can be used to sort the elements of a collection resource. You can use the
instructions in this topic to make properties sortable that are:
• Part of custom entities
• Custom properties that extend base configuration entities
• Base configuration properties that are not already sortable
Note that if a base configuration property is sortable, you can’t make it unsortable.
IMPORTANT: Adding new sortable columns can have performance implications, particularly if the collection to
be sorted tends to have a large number of elements. In these cases, you might need to add new database indexes
to maintain acceptable performance.
See Gosu Reference for more information on enhancements. See “Syntax for schema configuration files” on
page 21 for information on adding properties to mapping files.
For dual collections, perform the required actions for both query-backed and stream-backed. For example, if you create
a sort based on a property that requires a join between multiple data model entities, you need to update the resource file
(for query-backed) and create an enhancement and update the schema file (for stream-backed).
Making properties sortable 83
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"x-gw-extensions": {
"sortable": true
}
For example, suppose the CustomEntity_Ext entity has an ExpirationDate field. When retrieving a collection of
CustomEntity_Ext instances, the caller application can opt to sort the collection based on the expiration date using a
call such as:
GET /common/v1/customentity-exts?sort=expirationDate
"definitions": {
"CustomEntityExt": {
...
"properties": {
...
"expirationDate": {
"x-gw-extensions": {
"sortable": true
}
}
This example overrides getCustomSortColumnMap. Notice it returns a type of QuerySortColumn, as this is a query-
backed collection.
The first line is a call to the super method. You need to start your custom sorts with this call to avoid losing any sorts
already defined in the core resource class.
Next is a call to SimpleSortColumn. Use SimpleSortColumn for sorting simple properties that cannot be sorted by
adding them to the schema.
In this example, make the following replacements:
• sortProperty_Ext: Replace with the name of the property you’re sorting on, such as customProperty_Ext.
• Resource#Property: Replace with the name of the property and the resource where it can be found. For example,
CustomEntity#CustomProperty.
After adding this code to the JobActivitiesExtResource class (in the [Link] file), you can run the
following:
GET /job/v1/jobs/pc:101/activities?sort=activityPattern
Some properties are derived from other resources. The sort for these properties is a little more complex. Instead of
calling a simple sort on a single property, you need to join tables to retrieve the property you want to sort on. Here’s
what that might look like:
You need to replace the placeholders in the preceding example with the following:
• Resource1: The data model entity of the collection you’re sorting on.
• JoinProperty: The foreign key property used to join this data model entity to another entity.
• Resource2: The data model entity that contains the property on which you want to sort.
• SortProperty: The property on which you want to sort.
• sortProperty_Ext: The name you’ll use in your sort command on your endpoint to sort on the property.
Here’s a real-world example:
return customSort
}
In this example, you want to sort users based on their employee number, like this:
GET /admin/v1/users?sort=employeeNumber_Ext
However, you can’t use a simple sort because the EmployeeNumber property isn’t part of the User data model entity;
User retrieves that property from UserContact. So before you can sort, you need to join these two resources together.
You do that by creating an ArrayList that defines how the entities will be joined:
In this example the Contact property from the User data model entity will be used to join to the UserContact entity,
where the EmployeeNumber property is located.
You then pass this array to PathSortColumn to perform the sort.
new PathSortColumn(enSortColumnPath)
Notice that in the simple example we showed previously you used SimpleSortColumn, passing in the resource and
property, but here you need to use PathSortColumn so you can pass in an array of information about the resources
required to retrieve the information.
CustomEntitiesExt:
defaultSort:
- expirationDate
- customDescription
- "-<propertyName>"
For example, the following code specifies that, by default, CustomEntitiesExt collections are sorted by expirationDate
(descending). If any elements have the same value, they are sorted by customDescription (ascending).
CustomEntitiesExt:
defaultSort:
- "-expirationDate"
- customDescription
A filterable property is a property that can be used to narrow down the results returned from a request to retrieve a
resource collection. Many properties are filterable in the base configuration, but there might come a time when you
need to add a custom filter, either to extend the base configuration or when adding a custom entity. There are two ways
to add a custom filter, depending on the type of property.
• Schema files. For properties directly on a data model entity, you can make the property filterable by updating the
appropriate schema file.
• Resource files. Properties with values that are either generated at run-time or derived from multiple data model
entities can be made filterable by updating the resource file of the collection entity on which you’re filtering. (Note
that this applies only when you are filtering a query-backed collection.)
Keep in mind that if a base configuration property is filterable, you cannot make it unfilterable.
Performance considerations
Before getting into the details of how to add filters, it’s a good idea to think about the size of the collection you’re
filtering on. Filtering on very large collections can come with performance costs. Here are some suggestions for
minimizing or avoiding this issue.
Add database indexes. Filtering on a property that’s indexed in the database is much more efficient than filtering on a
property that is not indexed. If you’re adding a filter to a collection that is or could potentially be very large, the best
option for avoiding system problems is to index the property. See Configuration for more information on adding
indexes.
However, in some cases indexing alone doesn’t solve the problem. You must take additional steps to be certain that
your filter works in such as way that the index will be leveraged by the database.
Limit the operators that can be used with the filter. When you update the schema to specify a property as filterable,
the filter is automatically assigned all possible filter operators, such as starts with (sw) and greater than (gt). However,
these operators will likely not be able to leverage the index at the database level. Filtering on large collections aught to
be limited to allow only the equals (eq) operator. To enforce this limitation, you must create the filter using resource
files rather than the schema file. This will enable you to specify which operators are allowed on the property when you
filter.
Make the filter case sensitive. By default, filtering is not case sensitive. However, case-insensitive searches will likely
not be able to leverage the index at the database level. This means that even if you’ve indexed a property and limited
filter operators to only eq, your filter can still cause serious performance issues. You must take the additional step of
making the filter case-sensitive to ensure the index is used, thus avoiding most performance issues. As with limiting
operators, making filters case-sensitive requires you to use resource files rather than the schema to define your filter.
"definitions": {
"CustomEntityExt": {
...
"properties": {
...
"expirationDate": {
"x-gw-extensions": {
"filterable": true
}
}
Now when retrieving a collection of CustomEntity_Ext instances, the caller application can opt to filter the collection
based on the expiration date using a call such as this:
GET /common/v1/customentity-exts?filter=expirationDate:gt:2020-05-11T07::00::00.000Z
references through a foreign key to the UserContact#ID. So in order to create a filter, you need to do the same thing:
query for EmployeeNumber in UserContact by matching the User#Contact field to the UserContact#ID field.
Here’s an example of how to do that.
Create a new class
package [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
return {
[Link]
}
}
return employeeNumber
}
When you create the class, you need to decide in which package to store it. In this example, it’s stored in the same
place as the resource file that’s being extended:
package [Link]
Next you need to add references to the objects you’re going to use:
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
Within this new class, you override the createQueryFilter function, which is where you’ll define the query that
retrieves the employee number.
In this example the query is created as a StandardQueryFilter. In creating this filter you first give it a name (in this
case exmployeeNumber_Ext) and then a query. This query retrieves the UserContact information for each User,
matching the Contact property foreign key to the ID, then compares the UserContact EmployeeNumber to the filter
value (parseValue).
Notice in the query that UserContact#EmployeeNumber is being compared to the filter value with [Link]. This
means that any filter applied will look only for employee numbers that exactly match the filter value. To enforce this
restriction, you must also include getAllowedOperators and specify the equality operator:
return {
[Link]
}
}
By specifying only the eq operator as an allowed operator, any other operator used with this filter will produce an error.
See “Add filter operators” below for an example of how to allow multiple operators.
Next, you need to include the parseValue function. This function ensures that the filter value entered into the query
string is converted to the proper datatype. (For example, a value of 2023-06-13T20:07:44.243Z would need to be
parsed from a string to a Date object in order to filter on a Date field.) In this example, there is also a check for null to
ensure the string "null" is parsed to an actual null (or empty) value rather than interpreted as the literal string "null".
return employeeNumber
}
Be sure to call super first, to ensure you don’t overwrite any existing filters that could already be in place. Then add
your new filter, giving it a name (employeeNumber_Ext) and an instance of the new class you just made.
Grant access to the filter
API role files determine which endpoints and fields a caller can access. By default, a caller has no access to any
endpoints nor to any fields on resources returned by any endpoint. You must specifically grant access to each endpoint
and then to one or more fields in the resources returned by an endpoint.
In an API role file, the accessibleFields section identifies which fields are accessible. There are different ways that
you can grant access to fields:
• Listing each accessible field explicitly
• Using the "*" wildcard, which grants access to every field in the resource
When you add a custom filter through resource files, a caller will be able to access it if they have a role that grants view
access to all fields using the "*" wildcard, including customer filters. If they do not have view access to all fields, then
the filter must be added explicitly. If neither of these things are done, the filter will be inaccessible to the caller.
For example, to grant access to the employeeNumber filter, the relevant API role file needs to have either...
Users:
view:
- "*"
...or...
Users:
view:
- "employeeNumber"
...
For more information on how to grant access to fields in API role files, see “API role accessible fields” on page 335.
Using the filter
You can now filter on a specific employee number within the Users collection, like this:
GET /admin/v1/users?filter=employeeNumber_Ext:eq:1001
switch (queryFilterOp) {
case [Link]:
eFilter = new StandardQueryFilter("employeeNumber_Ext", \q -> {
var empQuery = [Link]([Link]).compare(UserContact#EmployeeNumber, [Link],
parseValue)
[Link](User#Contact, [Link], empQuery, UserContact#ID)
})
break
case [Link]:
eFilter = new StandardQueryFilter("employeeNumber_Ext", \q -> {
var empQuery = [Link]([Link]).startsWith(UserContact#EmployeeNumber,
[Link](parseValue), true)
[Link](User#Contact, [Link], empQuery, UserContact#ID)
})
break
}
return eFilter
}
return employeeNumber
}
When you allow multiple operators on a filter, you need to create a separate query for each filter. This example uses a
switch statement to return the query that matches the operator that is being used.
switch (queryFilterOp) {
Note: For a list of valid operators, see Cloud API Consumer Guide
The first case applies to the eq operator, and is identical to the employee number query shown previously.
case [Link]:
eFilter = new StandardQueryFilter("employeeNumber_Ext", \q -> {
var empQuery = [Link]([Link]).compare(UserContact#EmployeeNumber, [Link], parseValue)
[Link](User#Contact, [Link], empQuery, UserContact#ID)
})
break
The second case applies to the sw operator. This query is similar to the equality case, but instead of performing a query
using [Link], you need to use the startsWith method on the query.
case [Link]:
eFilter = new StandardQueryFilter("policyNumber_Ext", \q -> {
var empQuery = [Link]([Link]).startsWith(UserContact#EmployeeNumber,
[Link](parseValue), true)
[Link](User#Contact, [Link], empQuery, UserContact#ID)
})
break
Note that the last parameter in the call to startsWith is set to true. This parameter specifies whether the filter is case
insensitive. Set this value to false to make the filter case sensitive.
In addition to adding a new query in the createQueryFilter function, you also need to add the additional operator to
the list of AllowedOperators:
The rest of the code is created in the same way as in the earlier example.
Now you can use endpoints like either of the following to retrieve users based on their employee number:
GET /admin/v1/users?fields=lastName,employeeNumber&filter=employeeNumber_Ext:eq:US-10011
GET /admin/v1/users?fields=lastName,employeeNumber&filter=employeeNumber_Ext:sw:US
By default, properties are returned in endpoint responses for both collections (summary response) and single elements
(detail response). You can change this behavior with the defaultViews property.
For more information on default and summary responses, see “The fields query parameter”
IMPORTANT: The defaultViews property is for use only with custom properties. Guidewire does not
recommend using this property to modify the behavior of base configuration properties.
"x-gw-extensions": {
"defaultViews": [
"detail"
]
"x-gw-extensions": {
"defaultViews": [
"none"
]
When you do this, there are only two ways to include the property in the response:
• Specify the property explicitly with the fields query parameter.
• Specify *all in the fields query parameter. (Not recommended for production environments.)
There is also an x-gw-sinceVersion used by Guidewire to identify the first version of the API that included a base
configuration property.
Cloud API supports the ability to obfuscate data that is included in a response. Response data can be either nullified or
masked.
• When response data is nullified, its value is returned as null.
• When response data is masked, a portion of its value is returned with placeholder characters, such as a tax ID being
returned as "xxx-xx-1781".
The primary type of response data that is obfuscated is Personally Identifiable Information (PII). Insurers must comply
with any data protection and privacy regulations of the jurisdictions in which they operate. For example, companies
operating in the European Union must abide by the General Data Protection Regulation (GDPR) within that
jurisdiction. These regulations often specify that Personally Identifiable Information (PII) must be obfuscated.
"AccountContact": {
"type": "object",
"x-gw-extensions": {
"discriminatorProperty": "contactSubtype"
},
"properties": {
. . .
"taxId": {
"type": "string"
},
. . .
}
}
To nullify the value of the taxId property, you can modify that property in the AccountContact mapper as follows:
"AccountContact": {
"schemaDefinition": "AccountContact",
"root": "[Link]",
"properties": {
. . .
"taxId": {
"path": "null as String",
"predicate": "false"
},
. . .
}
}
Setting the [Link] property to "null as String" converts the expected value to a null string. Setting
[Link] to false prevents the original value, in this case the PII, from being evaluated.
"AccountContact": {
"type": "object",
"x-gw-extensions": {
"discriminatorProperty": "contactSubtype"
},
"properties": {
. . .
"taxId": {
"type": "string"
},
. . .
}
}
This property is mapped to the TaxID field of the [Link] entity. You must create a Gosu method
that masks the tax ID string. In this example, the method is named maskTaxId.
You then modify the taxId property in the AccountContact mapper as follows:
"Contact": {
"schemaDefinition": "Contact",
"root": "[Link]",
"properties": {
. . .
"taxId": {
"path": "[Link]([Link])"
},
. . .
}
}
Unmasking PII
Conversely, you can unmask PII that has been masked in the base configuration. This can be necessary when you need
to expose the PII to a specific internal role, such as administrator. In such circumstances, Guidewire recommends that
you create a new schema extension for the masked property. For example, if you wish to unmask the taxId property,
you would create a taxIdUnmasked_Ext schema property that is mapped directly to the TaxID entity field. In such a
case, Guidewire recommends that you also allowlist the extended property to make it visible only to authorized roles.
For details on creating resource extensions, see “Syntax for schema configuration files” on page 21. For details on
allowlisting fields, see “Endpoint access” on page 333.
IMPORTANT: Nothing in the Cloud API infrastructure prevents configuration that could expose PII in a
sensitive way. For example, if you specify taxId as a filterable parameter or sortable, it can be included as part
of the URL in a request and is more likely to appear in application logs.
{
"data": {
"attributes": {
"displayName": "Ray Newton",
"taxId": "***-**-6789"
}
}
}
For some callers, such as internal or external users, the masking of tax ID may be appropriate as it protects personally
identifiable information. For other callers, such as services, this masking may cause a problem as the callers may
reference contacts internally using the tax ID.
There are two ways that the taxId field can be unmasked:
• You can configure the field so that it is always unmasked, as described in the previous topic.
• You can grant the caller the restunmasktaxid system permission. Any caller who has a role with this permission
will get responses with unmasked tax IDs. For information on how to configure this, see “Endpoint access” on page
333.
Note that the restunmasktaxid system permission changes the behavior of the base configuration taxId field only. It
has no impact on any other masked data.
Localizing schemas
Schema definition files define the behavior of REST APIs and their endpoints. They also provide API definition
documentation. This is information in an API definition file to help users better understand API functionality.
For example, one of the schemas defined in the common_pl-[Link] file is the Activity schema. The
definition includes this description property:
API definition documentation is included in the responses when using the /[Link] and /[Link]
endpoints in Cloud API. Users can view this information directly, through API definition tools such as Swagger UI, or
in other contexts such as contextual help in a rules editor. Different users working with the same REST APIs could be
working in different languages. Therefore, the Guidewire REST API Framework (and Cloud API, which rests on top of
that framework) supports the ability to localize schema definition documentation. This capability is loosely referred to
as "schema localization".
This topic discusses how to add locale-specific text to schema definition documentation.
API definition documentation that has been localized is defined in a set of "[Link]" files.
Note that the base configuration does provide schema.display_LOCALE.properties files for several locales, but these
files may not be complete. Before using them in a production environment, Guidewire recommends reviewing the
contents to verify completeness and correctness of the translations.
[Link] keys
Every schema localization file contains a series of key/value pairs. For example:
[Link] =
The type of this activity, such as `general` or `approval`
The key is the text that comes before the "=". It defines a piece of localizeable text in a locale-generic way. Keys for
schema information are written in the following way:
• Keys for values defined in a [Link] file start with json.
Architecture of localized text 103
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
[Link] values
The value is the localized text to use for that key when the user is working in the given locale. For example, suppose
the key/value pair for the description of an Address is as follows:
If a key must be shown in multiple languages, then it is defined in each locale-specific file as needed. The key remains
constant across all files. Only the value varies.
For example, the following key/value pairs come from the default [Link] file:
The following key/value pairs come from the base configuration schema.display_fr.properties file:
When calling these endpoints, the request object can include a GW-Language header set to a given language, such as
"fr_FR". For more information on this header, see the Cloud API Consumer Guide.
When the GW-Language header is present, Cloud API attempts to return API definition documentation in the request
language. For each piece of documentation, a localized value is returned if all of the following are true:
• There is a [Link] file for that language.
• The [Link] file defines a value for the corresponding key.
In all other circumstances, a default value is used. The value defined in the default [Link] file is
used, if it exists. If it does not exist, the corresponding value from the schema definition file itself is used.
For example, suppose an InsuranceSuite application has an Address schema that includes properties for
addressLine1, arrondissement, and CEDEX. The following information exists in each of the following files:
"Address": {
...
"properties": {
"addressLine1": {
"description": "The first line of the address",
"type": "string",
},
"arrondissement_Ext": {
"description": "The administrative district of the address. Used in certain large
French cities, in particular Paris.",
"type": "string",
},
"CEDEX": {
"description": "The CEDEX bureau of the address. Only applicable in certain countries.",
"type": "string",
}
Now, suppose a caller requests schema information in French for the following keys:
• [Link]
• [Link]
• [Link].Arrondissement_Ext.description
Cloud API returns the following values:
• First key
◦ Return value: "Bureau CEDEX de l'adresse. Applicable uniquement dans certains pays."
◦ Reason: There is a schema,[Link] file for French and the file defines this key.
• Second key
◦ Return value: "The first line of the address, such as "123 Main Street"
◦ Reason: Even though there is a schema,[Link] file for French, the file does not define this key.
However, the key is defined in the default schema,[Link] file.
• Third key
◦ Return value: "The administrative district of the address. Used in certain large French cities, in particular Paris."
◦ Reason: The key is not defined in either the locale-specific schema,[Link] file or the default
schema,[Link] file. Therefore, the value of the description property in the schema definition is
returned.
Syntax
In the base configuration, the convention for the localization key prefix is to name it <APIname>.<majorVersion>. For
example: common.v1.
To add a localization key prefix to a [Link] file, use:
"x-gw-localizationKeyPrefix": "<localizationKeyPrefix>"
For example, in the base configuration, the common_pl-[Link] files includes the following:
"x-gw-localizationKeyPrefix": "common.v1"
x-gw-localizationKeyPrefix: <localizationKeyPrefix>
For example, in the base configuration, the common_pl-[Link] files includes the following:
x-gw-localizationKeyPrefix: common.v1
For example, the description property for the Composite API's Headers schema definition's additionalProperties
(declared in composite_pl-[Link]) maps to
[Link].
Schema description
json.<localizationPrefix>.description [Link]
tags.<name>. swagger.<localizationPrefix>.
externalDocs.description [Link].
externalDocs.description
parameterSets.<RefName>. swagger.<localizationPrefix>. "RefName" refers to the name of the parameter set, "in"
and "name" refer to the respective values of the
<in>.<name>.description [Link].
parameter within the set
standardParameters.
query.prettyPrint.description
operations.<operationId>. swagger.<localizationPrefix>.
summary swagger.claim.v1.operations.
[Link]
operations.<operationId>. swagger.<localizationPrefix>.
description swagger.claim.v1.operations.
getClaim.description
operations.<operationId>. swagger.<localizationPrefix>.
externalDocs.description swagger.claim.v1.operations.
getClaim.externalDocs.description
operations.<operationId>. swagger.<localizationPrefix>. Note that parameter names are not unique, only the
combination of "in" and "name" is unique, so the
parameters.<in>.<name>. swagger.claim.v1.operations.
property path for operation-level parameters must
description [Link]. include both pieces
customParam.description
operations.<operationId>. swagger.<localizationPrefix>.
responses.<Code>.description swagger.claim.v1.operations.
[Link].
200.description
paths.<Path>.parameters. swagger.<localizationPrefix>.
<in>.<name>.description [Link].
_claimId_.[Link].
claimId.description
You can add localized content to a new or existing API element, or add a new locale.
InsuranceSuite Cloud API provides endpoints for executing CRUD operations on base configuration entities. However,
the base configuration endpoints may not be sufficient for insurers. Insurers may need Cloud API endpoints for
extension entities. Insurers may also need endpoints for certain base configuration entities for which there are no base
configuration endpoints.
The REST endpoint generator is a tool that generates endpoints for extension entities and for most base configuration
entities that do not already have endpoints. The following topics discuss how to use the REST endpoint generator.
Note: The REST endpoint generator is not used to generate LOB-specific endpoints for a line of business. For
information on how to generate LOB-specific endpoints, see “Generating LOB-specific endpoints” on page
175.
The REST endpoint generator is a tool that insurers can use to create a set of generated endpoints for a data model
entity that does not have endpoints. This could be either a custom entity, or a base configuration entity for which there
are no endpoints. The tool generates a series of files that define the majority of the functionality for the endpoints.
However, the insurer must complete some additional configuration.
• This topic provides an overview of the REST endpoint generator.
• For more information on how to run the REST endpoint generator, see “Running the REST endpoint generator” on
page 121.
• For more information on configuring the resource definition files, see “Configuring the resource definition files” on
page 131.
• For more information on configuring the glue and impl classes, see “Configuring glue and impl classes for
generated endpoints” on page 143.
• For more information on configuring authorization, see “Configuring authorization for generated endpoints” on
page 151.
Note: Guidewire does not recommend adding inline arrays to schemas. If a given resource has an array of
related resources and you want to expose those related resource in Cloud API, Guidewire recommends using
the REST endpoint generator to create a separate set of child endpoints for the related resources.
The REST endpoint generator generates fields for scalars only. It does not generate fields for foreign keys or arrays.
• If the entity has one or more foreign keys, each foreign key must be added manually. For more information, see
“Adding foreign keys” on page 43.
• If the entity has an array to a custom entity, Guidewire recommends generating a separate set of endpoints for the
custom entity. (For example, if CustomParent_Ext has an array of CustomChild_Ext, after you generate endpoints
for CustomParent_Ext, generate endpoints for CustomChild_Ext as a child of CustomParent_Ext. The second set
of endpoints would have paths that included .../CustomParent_Ext/{customParentExtId}/
CustomChilds_Ext....
Note: Guidewire does not recommend adding inline arrays to schemas. If a given resource has an array of
related resources and you want to expose those related resource in Cloud API, Guidewire recommends using
the REST endpoint generator to create a separate set of child endpoints for the related resources.
What kind of endpoints are generated?
The REST endpoint generator generates CRUD endpoints only. It cannot be used to create business action POSTs, such
as an /assign or /submit endpoint.
When you generate endpoints for a custom entity, you can also add the custom entity's resource to an integration graph
if the resource has a parent resource and that parent resource belongs to the integration graph. For more information,
see “Additional considerations for generated endpoints” on page 159.
Subtyped entities
You can generate endpoints for a custom entity with subtypes. When you do, you can choose either "shared" or
"separate" endpoints.
• You can generate "shared" endpoints, which may be appropriate when the majority of the information is declared at
the supertype level. In this case, the resource has the supertype fields and the subtype fields from each subtype.
• You can generate "separate" endpoints, which may be appropriate when there is a sufficient amount of information
at each subtype level. In this case, the resource has only the supertype fields. Subtype fields are omitted. To access
information at the subtype level, you must re-run the REST endpoint generator for each subtype.
For information on generating endpoints for subtyped entities, see “Additional considerations for generated endpoints”
on page 159.
Root resources
In most cases, when you generate endpoints for a custom entity, the custom entity is child to some existing parent
entity. You access the associated REST resource through that parent resource.
For example, suppose you have a custom entity named CustomEntity_Ext. It is a child of the existing Activity
entity. Information about CustomEntity_Ext instances are accessed through the parent Activity. In this case, the
endpoints have this structure:
• GET /common/v1/activities/{activityId}/custom-entity-ext
• GET /common/v1/activities/{activityId}/custom-entity-ext/{CustomEntityExtID}
However, it is possible to generate endpoints for a custom entity as a root resource. In this case, you access the
associated REST resource directly.
For example, suppose you have a custom entity named CustomEntity_Ext. The endpoints are generated with the
associated resource being a root resource. In this case, the endpoints have this structure:
• GET /common/v1/custom-entity-ext
• GET /common/v1/custom-entity-ext/{CustomEntityExtID}
For more information on generating endpoints for root resources, see “Additional considerations for generated
endpoints” on page 159.
The REST endpoint generator is a tool that creates a set of generated endpoints for custom data model entities. The tool
generates a series of files that define the majority of the functionality for the endpoints. However, the insurer must
complete some additional configuration.
This topic discusses how to run the REST endpoint generator. It creates or modifies the files highlighted in the
following architecture diagram.
• For more information on configuring authorization, see “Configuring authorization for generated endpoints” on
page 151.
Any roles that are given GET access to endpoints in the Job API will also have access to the GET endpoints in the
Policy API.
Schemas, mappers, updaters, Swagger parameters, and Swagger request/response envelope definitions are added to the
policyperiod files, rather than job or policy files.
The Composite API, the System Tools API, and the Test Util API
You cannot add custom endpoints to these APIs.
API Add endpoints for effective-dated Add endpoints for non- effective-dated
entities? entities?
Account API No Yes
Admin API No Yes
Common API No Yes
Composite API No No
Job API Yes Not recommended
Populating collections
One of the GET endpoints retrieves a collection. This collection can be retrieved using either a stream or a Gosu query.
A stream loads the entire collection into memory before manipulating it. Streams have the advantage of being objects
that developers may be more familiar with. Filtering and sorting may be easier with stream-backed resources as the
whole collection is loaded into memory. However, streams may degrade performance if the size of the collection is too
large.
Gosu queries are expressions that are converted into SQL queries. Queries have a maximum number of elements that
are loaded into memory at one time. Queries have the advantage of preserving performance if the size of the entire
collection is large, as the collection is loaded in portions. However, if you are not familiar with Gosu, you may find it
harder to write complex query logic.
Guidewire has the following recommendations:
• If the collection is likely to be large, use a Gosu query.
• Otherwise, use a stream.
With streams, you will need to write code to populate the stream. This is easy to do when the parent entity has an array
of custom entities, as the array can be converted into a stream. Therefore, if you decide to use streams, you may want
to add an array of custom entities to the parent, even if the application does not otherwise require an array.
External callers (such as insureds or producers) may not have access to third-party data on claims (such as contact and
vehicle information related to a vehicle that the insured damaged). For these types of callers, access to specific fields
may be restricted by additional accessible fields filters. For fields restricted by additional accessible fields filters, the
behavior of sorts and filters changes based on whether the collection is populated by a stream or query. For more
information, see “Sorting and filtering on accessible fields”.
Additional considerations
You must identify the API roles that will have GET, POST, PATCH, and DELETE access to the custom endpoints.
You can add the custom resource to an integration graph. For more information, see “Integration graphs” on page 159.
If the custom entity has subtypes, you can generate either a single set of shared endpoints to work with supertype and
subtype behavior simultaneously, or you generate separate sets of shared endpoint that work with each supertype or
subtype independently. For more information, see “Supertype entities” on page 163.
• If the entity name contains multiple capital letters in a row (such as BOPLine_Ext), the REST endpoint generator
guesses at the correct way to apply hyphenation (such as /bop-line-ext). If the guess is incorrect (such as being
given USBOPLine_Ext and guessing /usbop-line-ext instead of /us-bop-line), you can modify the default.
Effective-dated entities
Guidewire recommends added only effective-dated entities to the Job API. Effective-dated entities use the
PolicyCenter-specific EffDatedRestElementResource and EffDatedRestListCollectionResource classes.
When you generate endpoints for an effective-dated entity, the following prompts are suppressed:
• The prompt asking if the resource is a root resource or a child resource.
◦ Effective-dated entities must be child to an existing parent resource.
• The prompt asking if the collection resource is backed by a stream or a query.
◦ Effective-dated entities are always assumed to be stream-backed resources.
• The prompt asking if the resource is to be added to an integration graph.
◦ Effective-dated entities are always added to the policyperiod graph.
System tables
If an entity is a system table, the REST endpoints generator automatically creates a single GET collection endpoint.
The endpoint is a root resource endpoint in the Product Definition API, and its path starts with /reference-data.
When you generate endpoints for system tables, the following prompts are suppressed:
• The prompt asking which API to create the endpoint in.
◦ System table endpoints are always created in the Product Definition API.
• The prompt asking if the resource is a root resource or a child resource.
◦ System table endpoints are always root resource endpoints.
• The prompt asking if the collection resource is backed by a stream or a query.
◦ System table endpoints are always query-backed resources.
• The prompt asking if the resource is to be added to an integration graph.
◦ System table resources cannot be added to any graph.
a. Name: RESTEndpointGenerator
b. JDK/JRE field: (use the default value)
c. VM options:
-server
-ea
-Xdebug
-[Link]=true
-[Link]=8180
-Xmx4g
-[Link]=dev
-Dgwdebug=true
-[Link]=idea/webapp
-[Link]=true
-[Link]=idea-gclasses
-[Link]=true
Results
The REST endpoint generator loads and then displays the first prompt in the console window at the bottom of the
Studio interface. You can enter responses in this window. For a list of the prompts, see “The REST endpoint generator
prompts”.
Be aware that the REST endpoint generator loads the entire type system. Therefore, there may be several minutes
between starting the generator and the appearance of the first prompt.
gwb restEndpointGenerator
The REST endpoint generator loads and then displays the first prompt. For a list of the prompts, see “The REST
endpoint generator prompts” on page 126.
Be aware that the REST endpoint generator loads the entire type system. Therefore, there may be several minutes
between executing the command and the appearance of the first prompt.
Which entity?
Which data model entity would you like to generate endpoints for?
You must acknowledge this by entering "y". If you do not enter "y", the generator throws an illegal state exception and
stops running.
The default element resource name
The default element resource name for this entity is '<defaultElementResourceName>'. If you
want to use a different name, specify it and press Enter. To accept the default, just
press Enter.
The REST endpoint generator identifies the default name it will use for the element resource. You can specify a
different name is desired.
The default collection resource name
The default plural for this entity is <defaultCollectionResourceName>. If you want to use a different plural,
specify it and press Enter. To accept the default, just press Enter.
Specify a custom name for the collection resource, or press Enter to accept the default name.
Requiring the Ext suffix (for the collection resource)
If the specified collection resource has a name that does not start end with "Ext", then the following prompt appears. It
identifies that "Ext" will be added to the resource name.
You must acknowledge this by entering "y". If you do not enter "y", the generator throws an illegal state exception and
stops running.
Default hyphenation
The url string for <entityName> will use the following hyphenation: <defaultValue>.
If you would like to use a different hyphenation, please enter it here (leave blank to use
the default, all capitalized letters will be converted to lowercase):
If the name of the entity has multiple capital letters and/or numbers in a row, then the REST endpoint generator shows
the default hyphenation for the endpoint paths (such as /bop-line-ext for an entity named BOPLine_Ext). You can
specify a custom hyphenation approach (such as /bopline-ext) or press Enter to accept the default.
Which API?
Specify the API name. The technical name is specified in lower case, such as "common" for the Common API or
"admin" for the Admin API.
Each API has restrictions and recommendations around what can be added to it:
Is the <entityName> endpoint the (r)oot of the endpoint path (e.g. GET /activities)
or the (c)hild of another resource (e.g. GET /activities/{activityId}/notes)? r/c
Enter "c" to make the custom resource a child of some existing parent resource. (This prompt is not presented for
effective-dated entities. Effective-dated entities cannot be root resources.)
For more information, see “The parent of the custom resource” on page 123.
Select whether your collection is loaded using a stream or a Gosu query. (This prompt is not presented for effective-
dated entities. Effective-dated entities are always backed by streams.) For more information, see “Populating
collections” on page 123.
Endpoint access
Which roles can access the GET collection and GET element endpoint?
Here are the options [<list-of-roles>]
Enter the values separated by comma. If you do not want to specify roles, just press Enter.
The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have GET access.
Any roles that are given GET access to endpoints in the Job API will also have access to the GET endpoints in the
Policy API.
Note that you do not need to answer any of the authorization prompts. You can press Enter for each prompt. However,
this only bypasses the coding done by the REST endpoint generator. This does not bypass the need to configure
authorization for the endpoints.
The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have POST
access. Note that GET access is required for POST access. Thus, any role which was not given GET access cannot be
given POST access.
The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have PATCH
access. Note that GET access is required for PATCH access. Thus, any role which was not given GET access cannot be
given PATCH access.
The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have DELETE
access. Note that GET access is required for DELETE access. Thus, any role which was not given GET access cannot
be given DELETE access.
Integration graph
Enter "y" or "n". For more information on adding custom resources to integration graphs, see “Additional
considerations for generated endpoints” on page 159.
• For more information on configuring the resource definition files, see “Configuring the resource definition files”.
• For more information on configuring the glue and impl files, see “Configuring glue and impl files”.
• For more information on configuring authorization, see “Configuring authorization for generated endpoints” on
page 151.
The REST endpoint generator is a tool that creates a set of generated endpoints for custom data model entities. Most of
the files generated by the REST Endpoint Generator are incomplete and require further configuration.
This topic discusses how to configure the resource definition files. They are the files highlighted in the following
architecture diagram.
Configuration of the other files are discussed in other parts of the documentation.
• For an overview of the REST endpoint generator, see “The REST endpoint generator” on page 117.
• For more information on how to run the REST endpoint generator, see “Running the REST endpoint generator” on
page 121.
• For more information on configuring the glue and impl classes, see “Configuring glue and impl classes for
generated endpoints” on page 143.
• For more information on configuring authorization, see “Configuring authorization for generated endpoints” on
page 151.
TODO RestEndpointGenerator
You can search for these "TODO RestEndpointGenerator" comments in Studio to complete the configuration.
• To change the API documentation text, such as the title and description of the endpoints
• To remove an operation, such as DELETE
The following sections provide an overview of configuring schema files for generated endpoints. For a complete
description of how to configure schema files, see “Endpoint architecture” on page 15.
"Activity": {
"title": "Activity",
"description": "An `Activity` is an assignable item that represents a task to be done, a decision to be made, or
information to be aware of",
"type": "object",
"properties": {
"activityPattern": {
"title": "Activity pattern",
"description": "The code of the `ActivityPattern` used to create this activity and set its initial values",
"type": "string"
...
}
},
<API>_ext-[Link], where <API> is the internal name of the API. For example, the
common_ext-[Link] file is used to define schema information for custom resources in the Common API.
You can access extension schema files in Studio through the integration -> schemas -> ext -> <API>.v1 node.
(There is an exception to the previous statement. When you add endpoints to the Job API, schema modifications are
not made to a job_ext-[Link] file, but rather to the policyperiod_ext-[Link] file.)
Resource-level information
The REST endpoint generator adds the following resource-level information to the schema:
"<resourceName>": {
"title": "<custom entity name>",
"description": "<custom entity name>",
"type": "object",
"properties": {
...
}
}
}
The id field
The REST endpoint generator adds an id field to the properties section of the schema.
"properties": {
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
...
}
"properties": {
"activeCount": {
"title": "Active count",
"properties": {
"nullOkFalse": {
"title": "Null ok false",
"description": "Null ok false",
"type": "boolean",
"x-gw-extensions": {
"requiredForCreate": true
}
},
"setterHidden": {
"title": "Setter hidden",
"description": "Setter hidden",
"type": "boolean",
"readOnly": true
},
...
}
}
For more information on how to configure scalar and compound datatype properties in a schema, see “Adding scalars”
on page 33 and “Adding compound datatypes” on page 39.
The following sections provide an overview of configuring mapping files for generated endpoints. For a complete
description of how to configure mapping files, see “Endpoint architecture” on page 15.
"Activity": {
"schemaDefinition": "Activity",
"root": "[Link]",
"properties": {
"closeDate": {
"path": "[Link]"
},
"description": {
"path": "[Link]"
},
"mandatory": {
"path": "[Link]"
},
...
Resource-level information
The REST endpoint generator adds the following resource-level information to the mapping file:
"<resourceName>": {
"schemaDefinition": "<schemaNameForResource>",
"root": "entity.<customEntity>",
"properties": {
...
}
}
}
"properties": {
// TODO RestEndpointGenerator : Add mapper properties here
"activeCount": {
"path": "CustomEntity_Ext.ActiveCount"
},
"activeDate": {
"path": "CustomEntity_Ext.ActiveDate"
},
"description": {
"path": "CustomEntity_Ext.Description"
},
"id": {
"path": "CustomEntity_Ext.RestId"
},
"isActive": {
"path": "CustomEntity_Ext.IsActive"
}
...
}
}
• Removing any mappers that were created by the REST endpoint generator but which correspond to fields that are
not to be exposed to Cloud API
• Adding mappers for any fields that must be exposed to Cloud API but that were not created by the REST endpoint
generator
For more information on how to configure scalar and compound datatype properties in a mapping file, see “Adding
scalars” on page 33 and “Adding compound datatypes” on page 39.
The following sections provide an overview of configuring updater files for generated endpoints. For a complete
description of how to configure mapping files, see “Endpoint architecture” on page 15.
"Activity": {
"schemaDefinition": "Activity",
"root": "[Link]",
"properties": {
"description": {
"path": "[Link]"
},
"mandatory": {
"path": "[Link]"
},
...
• This resource is defined in the schema who name is Activity (This schema is defined in some other [Link]
file.)
• The root for the resource mapping is [Link].
• For each instance of the resource:
◦ The value of the description property is written to the Activity entity's Description field.
◦ The value of the mandatory property is written to the Activity entity's Mandatory field.
Note that there may be properties that appear in the mapping file but not the updater file. This typically occurs with
properties that are read-only. For example, the Activity entity has a closeDate property, which the application sets
when the activity is closed. This property appears in the mapping file, as it can be read. But it does not appear it the
updater file because it cannot be written to.
Resource-level information
The REST endpoint generator adds the following resource-level information to the updater file:
"<resourceName>": {
"schemaDefinition": "<schemaNameForResource>",
"root": "entity.<customEntity>",
// TODO RestEndpointGenerator : Add updater properties here
...
}
"properties": {
"activeCount": {
"path": "CustomEntity_Ext.ActiveCount"
},
"activeDate": {
"path": "CustomEntity_Ext.ActiveDate"
},
"description": {
"path": "CustomEntity_Ext.Description"
},
"isActive": {
"path": "CustomEntity_Ext.IsActive"
},
...
}
The following sections provide an overview of configuring swagger files for generated endpoints. For a complete
description of how to configure swagger files, see “Swagger and apiconfig files” on page 25.
(There is an exception to the previous statement. When you add endpoints to the Job API, swagger modifications are
not made to a job_ext-[Link] file, but rather to the policyperiod_ext-[Link] file.)
When you generate endpoints for a custom entity, the REST endpoint generator adds code to the corresponding
swagger extension file.
For example, suppose you generate endpoints for a CustomEntity_Ext custom entity. The parent of this entity is
Account, and the endpoints are placed in the Account API. The REST endpoint generator add the following code to the
account_ext-[Link] file:
paths:
"/account/{accountId}/custom-entities-ext":
parameters:
- $ref: "#/parameters/accountId"
get:
summary: "Retrieve a collection of custom entities ext"
description: "Retrieve a collection of custom entities ext"
operationId: getCustomEntitiesExt
x-gw-extensions:
childResourceType: CustomEntityExt
operationType: get-collection
resourceType: CustomEntitiesExt
x-gw-parameter-sets: get-collection
responses:
"200":
description: "Successful response"
schema:
$ref: "#/definitions/CustomEntityExtList"
post:
summary: "Create a new custom entity ext"
description: "Create a new custom entity ext"
operationId: createCustomEntityExt
x-gw-extensions:
childResourceType: CustomEntityExt
operationType: post-collection
resourceType: CustomEntitiesExt
parameters:
- name: body
in: body
required: true
schema:
$ref: "#/definitions/CustomEntityExtRequest"
x-gw-parameter-sets: post-collection
responses:
"201":
description: "The details of the newly-created CustomEntityExt"
schema:
$ref: "#/definitions/CustomEntityExtResponse"
"/accounts/{accountId}/custom-entities-ext/{customEntityExtId}":
parameters:
- $ref: "#/parameters/accountId"
- $ref: "#/parameters/customEntityExtId"
get:
summary: "Retrieve details of a custom entity ext"
description: "Retrieve details of a custom entity ext"
operationId: getCustomEntityExt
x-gw-extensions:
operationType: get-element
resourceType: CustomEntityExt
x-gw-parameter-sets: get-element
responses:
"200":
description: "Successful response"
schema:
$ref: "#/definitions/CustomEntityExtResponse"
patch:
summary: "Update a custom entity ext"
description: "Update a custom entity ext"
operationId: updateCustomEntityExt
x-gw-extensions:
operationType: patch-element
resourceType: CustomEntityExt
parameters:
- name: body
in: body
required: true
schema:
$ref: "#/definitions/CustomEntityExtRequest"
x-gw-parameter-sets: patch-element
responses:
"200":
description: "Successful response"
schema:
$ref: "#/definitions/CustomEntityExtResponse"
delete:
summary: "Delete a custom entity ext"
description: "Delete a custom entity ext"
operationId: deleteCustomEntityExt
x-gw-extensions:
operationType: delete-element
resourceType: CustomEntityExt
x-gw-parameter-sets: delete-element
responses:
"204":
description: "Successful deletion"
Note that this text is functionally complete and there are no "TODO RestEndpointGenerator" comments in the file.
However, a developer may wish to optionally modify the file.
Removing operations
The REST endpoint generator always generates a collection endpoint with a GET and POST operation, and an element
endpoint with a GET, PATCH, and DELETE operation. If you do not want any of these operations, you can remove
them from the swagger file.
For example, suppose an insurer wants endpoints to support CustomEntity_Ext, but they do not want to expose the
ability to delete CustomEntity_Ext instances. In this case, the developer could remove the "delete" declaration from
the swagger file.
The REST endpoint generator is a tool that creates a set of generated endpoints for custom data model entities. Most of
the files generated by the REST Endpoint Generator are incomplete and require further configuration.
This topic discusses how to configure the glue and impl class files. They are the files highlighted in the following
architecture diagram.
Configuration of the other files are discussed in other parts of the documentation.
• For an overview of the REST endpoint generator, see “The REST endpoint generator” on page 117.
• For more information on how to run the REST endpoint generator, see “Running the REST endpoint generator” on
page 121.
• For more information on configuring the resource definition files, see “Configuring the resource definition files” on
page 131.
• For more information on configuring authorization, see “Configuring authorization for generated endpoints” on
page 151.
You can search for these "TODO comments" in Studio and complete the configuration. The remainder of this topic
explains the configuration needed in every glue and impl file.
CustomEntitiesExt:
resource: [Link]
CustomEntityExt:
resource: [Link]
You can add default sort orders to each resource declaration. These are declared using a defaultSort: property under
the resource: property.
"customDescription": {
...
"sortable": true
},
"customDueDate": {
...
}
},
Note that the customDescription field includes the "sortable": true expression, but the customDueDate field
does not. This means that you can sort on customDescription, but not customDueDate.
Ascending order
To define ascending sort order, add - <attributeName> to the defaultSort: property.
For example, the following defines a default ascending sort order based on customDescription:
CustomEntitiesExt:
resource: [Link]
defaultSort:
- customDescription
Descending order
To define descending sort order, add – "-<attributeName>" to the defaultSort: property.
For example, the following defines a default descending sort order based on customDescription:
CustomEntitiesExt:
resource: [Link]
defaultSort:
- "-customDescription"
CustomEntitiesExt:
resource: [Link]
defaultSort:
- entryType
- "-typeField"
You must modify the following getters and methods in the class in the following ways.
If the endpoint is a root resource endpoint, the REST endpoint generator does not generate an init method. For more
information, see “Configuring root resource endpoints” on page 170.
In most cases, you do not need constraints on editing the resource based on its business state, and the getter always
returns null. For example:
Note: The purpose of this getter is to allow or prevent edits based solely on the business state of the resource. It
is not intended to control authorization. For more information on controlling authorization, see “Configuring
authorization for generated endpoints”.
For example, suppose the resource has an ExpirationDate field and can be deleted only before the expiration date.
• If today's date is on or before the ExpirationDate, the getter returns null.
• If today's date is after the ExpirationDate, the getter returns a
[Link].
In most cases, you do not need constraints on viewing the resource based on its business state, and the getter always
returns null. For example:
Note: The purpose of this getter is to allow or prevent edits based solely on the business state of the resource. It
is not intended to control authorization. For more information, see “Configuring authorization for generated
endpoints”.
In most cases, you do not need constraints on viewing the resource based on its business state, and the getter always
returns null. For example:
Note:
The purpose of this getter is to allow or prevent views based solely on the business state of the resource. It is
not intended to control authorization. For more information, see “Configuring authorization for generated
endpoints” on page 151.
If the parent does not have an array of the custom entity, then you must write Gosu code to construct an array or list
manually and then convert it into a stream.
In most cases, you do not need constraints on viewing the resource based on its business state. In this case, the getter
always returns null. For example:
If the endpoint is a root resource endpoint, the REST endpoint generator does not generate a canViewException getter.
For more information, see “Configuring root resource endpoints” on page 170.
If the endpoint is a root resource endpoint, the REST endpoint generator does not generate a canCreateException
getter. For more information, see “Configuring root resource endpoints” on page 170.
The REST endpoint generator is a tool that creates a set of generated endpoints for custom data model entities. Most of
the files generated by the REST Endpoint Generator are incomplete and require further configuration.
This topic discusses how to configure the authorization files. They are the files highlighted in the following
architecture diagram.
Configuration of the other files are discussed in other parts of the documentation.
• For an overview of the REST endpoint generator, see “The REST endpoint generator” on page 117.
• For more information on how to run the Rest endpoint generator, see “Running the REST endpoint generator” on
page 121.
• For more information on configuring the resource definition files, see “Configuring the resource definition files” on
page 131.
• For more information on configuring the glue and impl classes, see “Configuring glue and impl classes for
generated endpoints” on page 143.
You can search for these "TODO RestEndpointGenerator" comments in Studio to complete the configuration.
- endpoint: /<path>/<customEndpointCollection>
# TODO RestEndpointGenerator : Adjust the permissions appropriately
methods:
- GET
- POST
- endpoint: "<path>/<customEndpointCollection>/*"
# TODO RestEndpointGenerator : Adjust the permissions appropriately
methods:
- GET
- DELETE
- PATCH
The first block grants the ability to retrieve a collection and the ability to create a resource.
The second block grants the ability to retrieve an element, to modify an element, and to delete an element. (A single *
wildcard indicates access is provided for anything one level below the current endpoint level.)
For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added GET, POST,
PATCH, and DELETE access to these endpoints to the Manager role. The REST endpoint generator would add the
following lines to the [Link] file:
- endpoint: /account/v1/accounts/custom-entities-ext
# TODO RestEndpointGenerator : Adjust the permissions appropriately
methods:
- GET
- POST
- endpoint: "/account/v1/accounts/custom-entities-ext/*"
The first block grants the ability to retrieve a collection of CustomEntities_Ext and the ability to create a
CustomEntity_Ext.
The second block grants the ability to retrieve a specific CustomEntity_Ext, to modify a CustomEntity_Ext, and to
delete a CustomEntity_Ext.
TODO RestEndpointGenerator
You can search for these "TODO RestEndpointGenerator" comments in Studio to complete the configuration.
WARNING: Do not modify any core access files. Modifying these files can result in certain sets of callers being
unable to execute API calls.
An extension access file is an access file that provides a location for extensions to base configuration resource access
strategy behavior. Extension access files either have ext in the name, or are located in a package with ext in the path.
Code generated by the REST endpoint generator is placed in extension access files. The specific code added to each
file depends on the associated type of caller.
Stream-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a stream, the following is added
to the internal user resource access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: __inherit
create: __inherit
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: __inherit
edit: __inherit
delete: __inherit
Query-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a query, the following is added to
the internal user resource access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: __inherit
create: __inherit
filter: __noFilter
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: __inherit
edit: __inherit
delete: __inherit
Note that, for query-backed collections, there is an additional filter: __noFilter line of code in the collections
section. This line is needed to determine appropriate view permissions for query-backed collections.
• This line of code does not exist for stream-backed collections because stream-backed collections load the entire
collection contents into memory at one time. Cloud API can simply iterate over the entire collection using the
specified view permission to determine which items in the stream can be viewed.
• This line of code does exist for query-backed collections because query-backed collections do not load the entire
collection into memory at one time. Instead, the collection is loaded one page at a time. Additional logic is required
to identify the items in the collection that can be viewed. This is specified by the additional filter.
In most business circumstances, the filter can be set to __noFilter, which specifies no additional filter logic is needed.
This is acceptable because, in most cases, a child object can be viewed if the parent object can be viewed.
Stream-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a stream, the following is added
to the external user resource access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "__inherit"
create: "__inherit"
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "__inherit"
edit: "__inherit"
delete: "__inherit"
Query-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a query, the following is added to
the internal user resource access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "__inherit"
create: "__inherit"
filter: "__inherit"
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "__inherit"
edit: "__inherit"
delete: "__inherit"
Note that, for query-backed collections, there is an additional filter: __inherit line of code in the collections
section. This line is needed to determine appropriate view permissions for query-backed collections.
• This line of code does not exist for stream-backed collections because stream-backed collections load the entire
collection contents into memory at one time. Cloud API can simply iterate over the entire collection using the
specified view permission to determine which items in the stream can be viewed.
• This line of code does exist for query-backed collections because query-backed collections do not load the entire
collection into memory at one time. Instead, the collection is loaded one page at a time. Additional logic is required
to identify the items in the collection that can be viewed. This is specified by the additional filter.
Stream-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a stream, the following is added
to the service resource access extension file:
resources:
CustomEntitiesExt:
Query-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a query, the following is added to
the internal user resource access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: true
create: true
filter: __noFilter
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: true
edit: true
delete: true
Note that, for query-backed collections, there is an additional filter: __noFilter line of code in the collections
section. This line is needed to determine appropriate view permissions for query-backed collections.
• This line of code does not exist for stream-backed collections because stream-backed collections load the entire
collection contents into memory at one time. Cloud API can simply iterate over the entire collection using the
specified view permission to determine which items in the stream can be viewed.
• This line of code does exist for query-backed collections because query-backed collections do not load the entire
collection into memory at one time. Instead, the collection is loaded one page at a time. Additional logic is required
to identify the items in the collection that can be viewed. This is specified by the additional filter.
If services are not restricted by resource access, then no additional filter logic is needed. The filter: __noFilter
line of code specifies this.
• Default resource access is used for callers who have been authenticated but specify no resource access strategy with
the call. This access is defined in default_ext-[Link].
The REST endpoint generator assumes that no resource access is provided to unauthenticated or default users.
Therefore, the filters for all operations are set to false.
Stream-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a stream, the following is added
to the unauthorized access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "false"
create: "false"
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "false"
edit: "false"
delete: "false"
Query-based collections
If you generate endpoints for a CustomEntity_Ext entity, and the entity is backed by a query, the following is added to
the unauthorized access extension file:
resources:
CustomEntitiesExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "false"
create: "false"
filter: __noFilter
CustomEntityExt:
# TODO RestEndpointGenerator : Update the default generated access here
permissions:
view: "false"
edit: "false"
delete: "false"
Note that, as is the case for the other caller types, query-backed collections have an additional "filter:" line of code
in the collections section.
This topic covers special use cases of the REST endpoint generator and consideration for those use cases.
Integration graphs
An integration graph is a special base configuration schema and mapper that is used by certain base configuration
outbound integrations to send information about a parent object and its children objects. Integration graphs are not used
by Cloud API, but the files that define them are a part of Cloud API.
As of this release, Cloud API has the following integration graphs:
• The ClaimCenter claim_graph, whose parent is Claim
• The PolicyCenter policyperiod_graph, whose parent is PolicyPeriod
• The ContactManager contact_graph, whose parent is Contact
There are several outbound integrations that make use of integration graphs. Depending on the InsuranceSuite
application, this may include:
• Guidewire App Events
• Cloud Rules
• Analytics and Data Services (ADS)
Guidewire recommends against insurers configuring integration graphs directly. However, when you generate
endpoints for a custom entity, you can also add the custom resource to an integration graph if the resource has a parent
resource and that parent resource belongs to the integration graph. To add the custom resource to the graph, answer the
final prompt ("Should <CustomEntity> be added to an integration graph?") with "y". There may be an additional
prompt asking for the name of the graph.
• If the entity is effective-dated, the information is added to the policy period graph.
• If the entity is not effective-dated, an additional prompt asks for the name of the graph to add the entity to.
When a custom entity is added to an integration graph, the REST endpoint generator modifies the following files:
• The <graphName>_graph_ext-[Link] file
• The <graphName>_graph_ext-[Link] file
Additional considerations for generated endpoints 159
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added the
corresponding resource to the PolicyPeriod graph. The policyperiod_graph_ext-[Link] file has the
following code added (shown in bold):
{
"$schema": "[Link]
"x-gw-combine": [
"[Link].v1.account_ext-1.0",
"[Link].v1.common_ext-1.0",
"[Link].v1.policyperiod_ext-1.0",
"[Link].v1.policyperiod_graph_content-1.0"
],
"definitions": {
"PolicyPeriod": {
"properties": {
"customEntitiesExt": {
"title": "Custom entities ext",
"description": "The collection of custom entities ext on this policy period",
"type": "array",
"items": {
"$ref": "#/definitions/CustomEntityExt"
}
}
}
}
}
}
For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added the
corresponding resource to the PolicyPeriod graph. The policyperiod_graph_ext-[Link] file has the
following code added (shown in bold):
{
"schemaName": "[Link].v1.policyperiod_graph_ext-1.0",
"combine": [
"[Link].v1.account_ext-1.0",
"[Link].v1.policyperiod_ext-1.0",
"[Link].v1.policyperiod_graph_content-1.0"
],
"mappers": {
"PolicyPeriod": {
"schemaDefinition": "PolicyPeriod",
"root": "[Link]",
"properties": {
"customEntitiesExt": {
"path": "TODO RestEndpointGenerator provide a collection
of CustomEntities_Ext",
"mapper": "#/mappers/CustomEntityExt"
}
}
}
}
}
You must configure the file by specifying the path for custom entity collection properties. This is typically set to the
corresponding array on the parent data model entity.
Following on from the previous example, the path attribute in policyperiod_graph_ext-[Link] file
would need to be set as follows:
{
"schemaName": "[Link].v1.policyperiod_graph_ext-1.0",
"combine": [
"[Link].v1.account_ext-1.0",
"[Link].v1.policyperiod_ext-1.0",
"[Link].v1.policyperiod_graph_content-1.0"
],
"mappers": {
"PolicyPeriod": {
"schemaDefinition": "PolicyPeriod",
"root": "[Link]",
"properties": {
"customEntitiesExt": {
"path": "PolicyPeriod.CustomEntities_Ext",
"mapper": "#/mappers/CustomEntityExt"
}
}
}
}
}
entityURIMappings:
CustomEntity_Ext:
uri: "${parentUri}/custom-entities-ext/${CustomEntity_Ext.RestId}"
parent: "TODO RestEndpointGenerator link to the parent of CustomEntity_Ext"
You must configure the file by specifying the parent for custom entities. This is typically set to the corresponding
foreign key on the custom data model entity.
Following on from the previous example, the path attribute in the shared_ext-[Link] file would need
to be set as follows:
entityURIMappings:
CustomEntity_Ext:
uri: "${parentUri}/custom-entities-ext/${CustomEntity_Ext.RestId}"
parent: "CustomEntity_Ext.PolicyPeriod"
What if some future release adds endpoints for the base configuration entity?
Suppose you generate endpoints for a base configuration entity that has no endpoints, such as the theoretical
TextMessage entity. Then, you upgrade to a release in which Guidewire does provide endpoints for that entity. In this
case, there would be two resources for the TextMessage entity:
• A TextMessageExt resource created by the REST endpoint generator that is used by the generated endpoints.
• A TextMessage resource created by Guidewire that is used by the base configuration endpoints.
There would also be two sets of endpoints:
• The paths for the generated set would use an "-ext"/"Ext" suffix, such as:
◦ GET /text-messages-ext
◦ POST /text-messages-ext
◦ GET /text-messages-ext/{textMessageExtId}
◦ PATCH /text-messages-ext/{textMessageExtId}
◦ DELETE /text-messages-ext/{textMessageExtId}
• The paths for the Guidewire set would not use an "-ext"/"Ext" suffix, such as:
◦ GET /text-messages
◦ POST /text-messages
◦ GET /text-messages/{textMessageId}
◦ PATCH /text-messages/{textMessageId}
◦ DELETE /text-messages/{textMessageId}
Thus, in this future release, you would be able to continue using the endpoints you generated with the functionality you
configured. You could also use the endpoints that Guidewire generated.
Prohibited entities
You cannot generate endpoints for base configuration entities that already have endpoints. This is true for both entities
with endpoints created by Guidewire and entities with endpoints generated by you.
Some InsuranceSuite applications also have base configuration entities that do not have endpoints and that you cannot
generate endpoints for. If you name one of these entities at the first prompt, the REST endpoint generator responds
with an error message similar to the following:
You cannot generate endpoints for the '<namedEntity>' entity. The REST endpoint generator
does not allow endpoint generation for the following entities and their subtypes
[<list_of_prohibited_entitied>]
Supertype entities
A supertype entity is a data model entity which has one or more other entities that act as subtypes. In a supertype/
subtype entity structure:
• The top-level entity is referred to as the parent entity or the supertype entity.
• Each lower-level entity is referred to as a child entity or a subtype entity.
For example, suppose there is an Interaction_Ext entity that captures information about an interaction (a phone call,
email, or in-person conversation) that the insurer has with someone else. The Interaction_Ext entity has two
subtypes: InteractionWithInsured_Ext and InteractionWithVendor_Ext.
• The Interaction_Ext supertype has an InteractionDate datetime field.
• InteractionWithInsured_Ext has an isComplaint Boolean field.
• InteractionWithVendor_Ext has an isBillable Boolean field.
When you use the REST endpoint generator to generate endpoints for a supertype entity, the following additional
prompt is asked:
The entity '<CustomEntity>' is a concrete type that has subtypes. Do you wish for subtypes
to (sh)are this endpoint or have their own (se)parate endpoints? sh/se
You can choose either shared handling or separate handling. With shared handling, the REST endpoint generator
CRUD endpoints that are intended to work with information at both the supertype and subtype level simultaneously.
When you choose separate handling, it creates CRUD endpoints that are intended to work with information at the
supertype level only, and if you want to work with information at the subtype level, you must generate an additional set
of endpoints for each subtype.
Shared handling
Shared handling is designed for situations where the bulk of the information is at the supertype level and you want to
manage the information with a single set of endpoints.
In this approach, the tool generates a single element resource and a single set of CRUD endpoints. After configuration,
the element resource would typically include fields declared at the supertype level and at each subtype level. A single
GET can potentially return objects of different subtypes.
"definitions": {
"<supertype>": {
"properties": {
"<subtypeFieldName>": {
"x-gw-nullable": true,
"x-gw-extensions": {
"entitySubtype": "<subtypeThatOwnsThisField>"
}
},
In the mapping file, the mapper for a subtype field must cast the supertype entity as the specific subtype entity. It must
also include a predicate attribute that specifies the correct subtype.
The syntax for specifying these behaviors is as follows:
"mappers": {
"<supertype>": {
"properties": {
"<subtypeFieldName>": {
"path": "(<Supertype> as <Subtype>).<subtypeFieldName>",
"predicate": "<Supertype> typeis <Subtype>"
},
In the updater file, the updater for a subtype field must cast the supertype entity as the specific subtype entity.
The syntax for specifying these behaviors is as follows:
"updaters": {
"<supertype>": {
"properties": {
"<subtypeFieldName>": {
"path": "(<Supertype> as <Subtype>).<subtypeFieldName>"
},
• GET /interaction-ext
• POST /interaction-ext
• GET /interaction-ext/{interactionExtId}
• PATCH /interaction-ext/{interactionExtId}
• DELETE /interaction-ext/{interactionExtId}
After configuration, the schema definition for Interaction_Ext would include the following:
"definitions": {
"Interaction_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"subtype": {
"title": "Subtype",
"description": "The specific type of...",
"type": "string",
"x-gw-type": "typekey.Interaction_Ext",
"x-gw-extensions": {
"createOnly": true,
"filterable": true,
"requiredForCreate": true,
"sortable": true
}
},
"interactionDate": {
"type": "string",
"format": "date-time"
},
"isComplaint": {
"type": "boolean",
"x-gw-nullable": true,
"x-gw-extensions": {
"entitySubtype": "InteractionWithInsured_Ext"
}
},
"isBillable": {
"type": "boolean",
"x-gw-nullable": true,
"x-gw-extensions": {
"entitySubtype": "InteractionWithVendor_Ext"
}
},
...
After configuration, the mapping definition for Interaction_Ext would include the following:
"mappers": {
"Interaction_Ext": {
"properties": {
"id": {
"path": "Interaction_Ext.RestId"
},
"subtype": {
"path": "Interaction_Ext.Subtype"
},
"interactionDate": {
"path": "Interaction_Ext.InteractionDate"
},
"isComplaint": {
"path": "(Interaction_Ext as InteractionWithInsured_Ext).IsComplaint",
"predicate": "Interaction_Ext typeis InteractionWithInsured_Ext"
}
},
"isBillable": {
"path": "(Interaction_Ext as InteractionWithVendor_Ext).IsBillable",
"predicate": "Interaction_Ext typeis InteractionWithVendor_Ext"
}
},
...
After configuration, the updater definition for Interaction_Ext would include the following:
"updaters": {
"Interaction_Ext": {
"properties": {
"subtype": {
"path": "Interaction_Ext.Subtype"
},
"interactionDate": {
"path": "Interaction_Ext.InteractionDate"
},
"isComplaint": {
"path": "(Interaction_Ext as InteractionWithInsured_Ext).IsComplaint"
}
},
"isBillable": {
"path": "(Interaction_Ext as InteractionWithVendor_Ext).IsBillable"
}
},
...
Separate handling
Separate handling is designed for situations where there is so much information at the subtype level that you want to
manage each subtype as a distinct entity.
In this approach, you must run the REST endpoint generator for the supertype and each subtype. This means that you
will have a resource and set of CRUD endpoints for the supertype and an additional resource and set of CRUD
endpoints for each subtype. It also means that the supertype endpoints can be used to interact with objects declared at
the supertype level, and only objects declared at the supertype level. The supertype endpoints will not interact with
objects declared at the subtype level.
When you run the REST endpoint generator for the supertype and choose separate handling, there is no subtype field
automatically added to the resource.
◦ DELETE /interaction-ext/{interactionExtId}
• Endpoints for working with InteractionWithInsured_Ext entities
◦ GET /interaction-with-insured-ext
◦ POST /interaction-with-insured-ext
◦ GET /interaction-with-insured-ext/{interactionWithInsuredExtId}
◦ PATCH /interaction-with-insured-ext/{interactionWithInsuredExtId}
◦ DELETE /interaction-with-insured-ext/{interactionWithInsuredExtId}
• Endpoints for working with InteractionWithVendor_Ext entities
◦ GET /interaction-with-vendor-ext
◦ POST /interaction-with-vendor-ext
◦ GET /interaction-with-vendor-ext/{interactionWithVendorExtId}
◦ PATCH /interaction-with-vendor-ext/{interactionWithVendorExtId}
◦ DELETE /interaction-with-vendor-ext/{interactionWithVendorExtId}
Schema definitions
After configuration, the schema definition for Interaction_Ext would include the following:
"definitions": {
"Interaction_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"interactionDate": {
"type": "string",
"format": "date-time"
},
...
"definitions": {
"InteractionWithInsured_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"interactionDate": {
"type": "string",
"format": "date-time"
},
"isComplaint": {
"type": "boolean",
},
...
"definitions": {
"InteractionWithVendor_Ext": {
"properties": {
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"interactionDate": {
"type": "string",
"format": "date-time"
},
"isBillable": {
"type": "boolean",
},
...
Mapping definitions
After configuration, the mapping definition for Interaction_Ext would include the following:
"mappers": {
"Interaction_Ext": {
"properties": {
"id": {
"path": "Interaction_Ext.RestId",
},
"interactionDate": {
"path": "Interaction_Ext.InteractionDate",
},
...
"mappers": {
"InteractionWithInsured_Ext": {
"properties": {
"id": {
"path": "InteractionWithInsured_Ext.RestId"
},
"interactionDate": {
"path": "InteractionWithInsured_Ext.InteractionDate"
},
"isComplaint": {
"path": "InteractionWithInsured_Ext.IsComplaint"
}
},
...
"mappers": {
"InteractionWithVendor_Ext": {
"properties": {
"id": {
"path": "InteractionWithVendor_Ext.RestId"
},
"interactionDate": {
"path": "InteractionWithVendor_Ext.InteractionDate",
},
"isBillable": {
"path": "InteractionWithVendor_Ext.IsBillable"
}
},
...
Updater definitions
After configuration, the updater definition for Interaction_Ext would include the following:
"updaters": {
"Interaction_Ext": {
"properties": {
"interactionDate": {
"path": "Interaction_Ext.InteractionDate",
},
...
"updaters": {
"InteractionWithInsured_Ext": {
"properties": {
"interactionDate": {
"path": "InteractionWithInsured_Ext.InteractionDate"
},
"isComplaint": {
"path": "InteractionWithInsured_Ext.IsComplaint"
}
},
...
"updaters": {
"InteractionWithVendor_Ext": {
"properties": {
"interactionDate": {
"path": "InteractionWithVendor_Ext.InteractionDate",
},
"isBillable": {
"path": "InteractionWithVendor_Ext.IsBillable"
}
},
...
• GET /account/v1/accounts/{accountId}/security-issues
• GET /account/v1/accounts/{accountId}/security-issues/{security-issue-id}
However, there may be cases where you want to generate endpoints for a custom entity and you want the custom
resource to be a root resource. The REST Endpoint Generator supports this use case. If you were to generate endpoints
for the SecurityIssue custom entity as a root resource, the GET endpoints would look like this:
• GET /account/v1/security-issues
• GET /account/v1/security-issues/{security-issue-id}
For root resource endpoints for custom entities, there are no foreign key requirements. A custom entity can have root
resource endpoints, regardless of the presence or absence of foreign keys in the corresponding data model entity.
For example, suppose you had two custom entities: CustomEntity1 has a foreign key to Activity, CustomEntity2
has no foreign keys to any other entities.
• For CustomEntity1, you could generate either child endpoints (with Activity as the parent) or root resource
endpoints.
• For CustomEntity2, you could generate root resource endpoints. But you cannot generate child endpoints.
To make root resource endpoints for a custom entity, answer this question with y.
For any set of custom endpoints, you have the ability to have the collection backed by a Java stream or a Gosu query.
This is determined by the answer to the following question.
Guidewire does not recommend using Java streams with root resource endpoints. Java streams load the entire
collection into memory, and root resource endpoints do not limit the collection to those objects associated with a single
parent. Therefore, root resource endpoints backed by Java streams may lead to compromised performance.
The buildBaseQuery method creates a Gosu query that returns the collection resource related to the parent resource.
Root resource entities have no parents. Therefore, in most cases, the query must return all instances of the
corresponding data model entity.
The sample code for root resources does this. In most cases, all you will need to do is uncomment the query. For
example:
protected override function buildBaseQuery() : IQueryBeanResult<CustomEntity_Ext> {
return [Link](entity.CustomEntity_Ext).select()
CustomEntitiesExt:
view: "TODO RestEndpointGenerator"
create: "TODO RestEndpointGenerator"
filter: "TODO RestEndpointGenerator"
CustomEntityExt:
permissions:
view: __inherit
edit: "TODO RestEndpointGenerator"
delete: __inherit
accountholder_ext-[Link]
CustomEntitiesExt:
permissions:
view: "TODO RestEndpointGenerator"
create: "TODO RestEndpointGenerator"
filter: "TODO RestEndpointGenerator"
CustomEntityExt:
permissions:
view: "TODO RestEndpointGenerator"
edit: "TODO RestEndpointGenerator"
delete: "TODO RestEndpointGenerator"
unauthenticatedUser_ext-[Link]
CustomEntitiesExt:
permissions:
view: false
create: false
CustomEntityExt:
permissions:
view: false
edit: false
delete: false
The following topics discuss configuration for additional specific uses cases. This includes:
• Generating LOB-specific endpoints
Cloud API has endpoints that caller applications can use to interact with contents of a policy. In this context, the term
"policy" refers to bound policies, unbound policies associated with jobs such as policy changes, and future policies
associated with submissions. The Cloud API endpoints can retrieve information about the contents of these policies.
Within the context of a job, they can also create and modify the contents of a policy.
The contents of a policy can be divided into two categories:
• LOB-generic
◦ These contents have a structure that remains the same, regardless of the policy's line(s) of business.
◦ Examples: policy contacts, policy locations
• LOB-specific
◦ These contents have a structure that varies for each line of business.
◦ Examples: coverables, coverages, modifiers
The base configuration contains endpoints for LOB-generic policy contents. But, it does not initially contain endpoints
for LOB-specific policy contents. This is because each insurer structures each product to suit the needs of the business.
There is no way for PolicyCenter to anticipate in advance how the LOB-specific endpoints need to be structured.
Therefore, in order to work with LOB-specific contents through Cloud API, you must first generate LOB-specific
endpoints for each line. This topic describes how to do this.
Note: PolicyCenter provides a mechanism for generating endpoints that let you work with the LOB-specific
aspects of policies and jobs. However, this mechanism does not generate or modify the endpoints in the Product
Definition API.
Most products have a single LOB. They are referred to as mono-line products. These are depicted in the first row of the
diagram. For example, the Personal Auto, Commercial Property, and Inland Marine products all contain a single LOB.
For these types of products, the product itself and the underlying LOB are often discussed interchangeably.
Some products have multiple lines of business. They are referred to as multi-line products or package products. This is
depicted in the second row of the diagram. For example, an insurer could offer a Commercial Package product that
consists of three lines of business, the "Commercial Property Line", the "General Liability Line", and the "Inland
Marine" line.
Furthermore, an LOB is not limited to being used by one product.
• An LOB could be used by only a single product. For example, a Personal Auto Line LOB is typically used by only
one product, the Personal Auto product.
• An LOB could be used by multiple products. For example, a Commercial Property LOB could be used by a
Commercial Property product (a mono-line product) and a Commercial Package product (a multi-line product).
The endpoints that you generate act upon aspects of the LOB, not the product. If two products make use of the same
LOB, and both products are exposed to Cloud API, then the endpoints for that LOB ought to behave the same in each
product. Thus, the endpoints are referred to as LOB-specific endpoints, not product-specific endpoints.
Product sources
A PolicyCenter product can be created from any of the following sources:
• Advanced Product Designer (APD) App - APD App is a business tool that helps you design, simulate, and deploy
an insurance product. Guidewire recommends creating all new products through APD App.
• Standards Based Template (SBT) - An SBT is a set of files you can add to an instance of PolicyCenter to
implement a product that is based on content licensed from a standards bureau such as ISO or NCCI.
• Product Designer - Product Designer is a web-based tool for examining and editing products in the PolicyCenter
product model. Product Designer was one of the first tools Guidewire offered for product design. Guidewire no
longer recommends creating products with Product Designer. But, insurers may have existing products that were
created with Product Designer before other tools were available.
• Base configuration products - This is a product that is provided with the base configuration of PolicyCenter.
◦ The base configuration products are not installed in the base configuration itself. To implement them, you must
download and install the appropriate extension pack business template. For more information, see the
Application Guide.
LOB artifacts
Within the context of product development, an LOB artifact is a PolicyCenter resource that is used to manage and
present the LOB-specific portions of a policy. LOB artifacts include the following:
• Database tables that store LOB-specific information
◦ These are required for all products.
• LOB-specific reference tables
◦ Some LOBs require one or more reference tables. For example, a Workers' Compensation LOB usually requires
a reference table for storing class codes.
• LOB-specific PCFs (Page Configuration Files)
◦ These files define the user interface used when one logs on to PolicyCenter. They are required when the product
is available to the PolicyCenter user interface.
• LOB-specific endpoints
◦ These are required when the policy is exposed through Cloud API.
When LOB-specific endpoints are generated for a product, they are added to two APIs in Cloud API.
• In the Job API, PolicyCenter generates several sets of GET, POST, PATCH, and DELETE endpoints. There is one
set for each type of policy object, such as coverables, coverages, and exposures. These endpoints can be used to
work with policies attached to a job.
• In the Policy API, PolicyCenter generates several GET endpoints. There is one for each type of policy object, such
as coverables, coverages, and exposures. These can be used to retrieve information about bound policies.
The general pattern is that for any given LOB-specific object type (such as a Personal Auto product's Vehicle), there is
a full set of CRUD endpoints in the Job API and element and collection GETs in the Policy API.
For more information on how to set the toggle, see “Toggling between visualized and installed endpoints” on page
187.
1. From the Externally Managed tab, extract a product template from the installed product.
2. From the APD Managed tab, import the product template. This creates a visualized version of the product. It also
creates a set of LOB endpoints you can use to interact with the visualized product.
3. From the APD Managed tab, validate the visualized product. This potentially generates a list of errors.
4. If there are any validation errors, you must fix them before you can generate endpoints.
• When fixing errors, Guidewire recommends that you modify the visualized product directly and then export a
new version of the product template from the visualized product. This ensures your product template file
matches the visualized product.
5. From Studio, create or modify the codegen config file, if necessary.
a. Identify mismatches between type and field names in the APD representation and the corresponding names
in the installed product.
b. Identify other constraints that you want to declare or override.
6. From the APD Managed tab, generate endpoints for the installed product.
a. This creates the product access file.
b. This also creates a set of LOB-specific endpoint files for the installed product. These files reflect any
overrides specified in the codegen config file.
7. Check the generated endpoint files for compile errors and correct them.
• This typically involves updating the product template and/or the codegen config file and then regenerating the
endpoints.
8. From the APD Managed tab, toggle the endpoints so that the installed product's endpoints are active.
9. Restart the server.
For a more detailed description of the process, see “Generate LOB-specific endpoints for non-APD-products” on page
181.
WARNING: You can extract a product template from one instance of PolicyCenter and then use that template to
generate endpoints on a different instance of PolicyCenter. However, do not generate LOB-specific endpoints
for a product that is not installed on that instance of PolicyCenter. PolicyCenter will generate the endpoints.
But, because the product itself is not installed, the endpoints will reference other LOB artifacts that do not exist
on that instance of PolicyCenter. This will cause compile errors that prevent PolicyCenter from starting. (For
information on how to remove the installed product endpoints, see “Removing an installed product's endpoints”
on page 190.)
Procedure
1. Generate a product template for the existing installed product.
a. Navigate to the Product Management screen.
b. Click the Externally Managed tab.
c. In the list of Installed Products, click the desired product.
d. Click Extract APD Representation. This generates the XML template and stores it in your Downloads
directory.
Note: Export Product creates and exports a JSON representation of the product. However, only customers
who have signed up for our Early Access (EA) program can use this functionality.
2. Import the product template.
a. On the Product Management screen, click the APD Managed tab.
b. Click Import From Template.
c. Click Browse, then navigate to the template's location and select the template.
d. Click Update. It may take a few seconds for the template to load. Once it has been loaded, the product is
listed on the APD Managed tab.
3. Validate the installed product.
a. On the APD Managed tab, select the product.
b. On the Details tab below the list, select Validation Status. The <ProductName> screen appears.
c. If the product has any errors, the screen title also says "See Errors Highlighted".
4. Fix all validation errors on the <Product Name> screen, and optionally fix any warnings.
a. Errors appear with an "!" in a red triangle. Warnings appear with an "!" in a yellow triangle.
b. For more information on the most common types of errors and how to fix them, see “Fixing product
validation errors” on page 182.
c. Guidewire recommends making any required changes to the visualized product through the Product
Management screen and then extracting an updated version of the product template from the Product
Management screen. To do this, on the APD Managed tab, select the product from the product list and then
click Extract Template.
5. Modify the codegen config file, if necessary.
a. In Studio, navigate to modules > configuration > config > integration > apis > installedlobs.
b. Open the file whose name starts with <productCode>_codegen. If there is no codegen config file for your
LOB and you need one, you must create one. Then, edit the codegen config file as needed.
c. For more information on working with codegen config files, see “Codegen config files” on page 205.
6. Generate endpoints for the installed product.
• On the APD Managed tab, select the product.
a. On the Details tab below the list, select Generate Product Code -> System APIs -> System APIs - Code.
The Review Product Elements screen appears.
b. Click Complete Generation. In the confirmation dialog box, click OK.
7. Identify and correct all compile errors in the generated endpoint files.
• For more information on how to identify and correct compile errors, see “Correcting compile errors” on page
185.
8. Toggle the installed product endpoints to make them active.
a. By default, the visualized product endpoints are active. If you wish to continue working with the installed
product, no additional action is needed.
b. To make the installed product endpoints active, go to the APD Managed tab and select the product. In the
Enabled for REST API field, select Disabled.
9. Restart PolicyCenter.
SThe short name "<value>" has a naming conflict with an existing field in PolicyCenter.
Choose an alternative short name.
2. In the codegen config file, add a nameOverride to map the new, non-conflicting name in the APD representation
to the original name in the installed product. For more information on working with codegen config files, see
“Codegen config files” on page 205.
Guidewire recommends that you re-extract the product template whenever you modify the visualized version of the
product. To do this, on the APD Managed tab, select the product from the product list and then click Extract Template.
File locations
The codegen output files and LOB extension files are placed in the following directories in the modules
\configuration directory:
• config\integration\apis\ext\job\v1
• config\integration\apis\ext\policy\v1
• config\integration\apis\ext\policyperiod\v1
• config\integration\mappings\ext\policyperiod\v1
• config\integration\schemas\ext\policyperiod\v1
• config\integration\updaters\ext\policyperiod\v1
• gsrc\gw\rest\ext\pc\policyperiod\<productCode>\v1
PolicyCenter also creates a product access file that exposes the installed product to Cloud API. This file is named
<productCode>_ext-[Link]. It is placed in the modules\configuration\config\integration\apis
\installedlobs directory along with the codegen config files.
• In the mapping file, there is an error stating Cannot resolve symbol: WCRetroRatingLetterOfCre.
• If you attempt to use the endpoints, you will see errors such as: No property descriptor found for property,
RetrospectiveRatingPlan, on class, [Link].
For more information on working with codegen config files, see “Codegen config files” on page 205.
Finally, you must regenerate the endpoints. This recreates the LOB-specific endpoints files with the correct type and
field names. For more information, see “Regenerating LOB-specific endpoints” on page 186.
Procedure
1. Navigate to the Product Management screen.
2. Click the APD Managed tab.
3. In the list of products, click the desired product. Then click Remove Product. The product is removed from the
APD Managed tab.
4. Reimport the template.
a. Click Import Template.
b. Click Browse, then navigate to the template's location and select the template.
c. Click Update. It may take a few seconds for the template to load. Once it has been loaded, the product
reappears on the APD Managed tab.
5. Regenerate the endpoints.
a. Select Generate Product Code > System APIs > System APIs - Code. APD App shows the Review Product
Elements screen.
b. Click Complete Generation.
• config\integration\mappings\ext\policyperiod\v1
• config\integration\schemas\ext\policyperiod\v1
• config\integration\updaters\ext\policyperiod\v1
Also, remove the following directory and its contents:
• gsrc\gw\rest\ext\pc\policyperiod\<productCode>\v1
Once this is done, you can restart PolicyCenter and then regenerate the LOB-specific endpoints.
error. For more information on disabling products, see “Disable a visualized product's endpoints” on page 190 and
“Disable an installed product's endpoints” on page 190.)
If a given product exists as both a visualized product and an installed product, and both versions have endpoints, then
Cloud API checks the product's Enabled for REST API flag.
• If the flag is set to Enabled, the visualized product is used.
• If the flag is set to Disabled (and there is a product access file for the product in the /installedlobs directory), the
installed product is used.
PolicyCenter also supports the following actions related to visualized and installed products.
Procedure
1. On the Product Management screen's APD Managed tab, select the product.
2. Click Edit Product.
3. In the Enabled for REST API field, select the appropriate option:
a. Enabled toggles on the visualized product's endpoints.
b. Disabled toggles on the installed product's endpoints.
4. Click Save. The change becomes effective immediately. You do not need to restart PolicyCenter.
Results
For more information on toggling a product's endpoints through Cloud API, see “Toggle a product's endpoints” on page
222.
Response body
{
"data": {
"attributes": {
"abbreviation": "WC",
"description": "Workers' Compensation",
"id": "WorkersComp",
"name": "Workers' Compensation",
"productType": {
"code": "Commercial",
"name": "Commercial"
},
"visualized": false
},
The visualized field is set to false. Therefore, the installed product's endpoints are active.
Procedure
1. Navigate to the Administration tab's Product Management screen.
2. Click the Externally Managed tab.
3. In the list of Installed Products, click the desired product.
4. Click Extract APD Representation.
Results
PolicyCenter generates the template and stores it in your Downloads directory.
Procedure
1. Navigate to the Administration tab's Product Management screen.
2. Click the APD Managed tab.
3. In the list of products, click the desired product.
4. Click Export Template.
Results
PolicyCenter generates the template and stores it in your Downloads directory.
Results
The change becomes effective immediately. You do not need to restart PolicyCenter.
If there is an installed version of the product with installed endpoints, the installed endpoints are used for incoming
Cloud API calls for the product. If there is not an installed version of the product with installed endpoints, incoming
Cloud API calls for the product will throw an error.
Procedure
1. Navigate to the Administration tab's Product Management screen.
2. Click the APD Managed tab.
3. In the list of products, click the existing visualized product.
4. Click Remove Product.
Results
The product is removed from the list of visualized products.
Procedure
1. In the file system, navigate to the integration/apis/installedlob directory.
2. Either delete or rename the product access file.
• This file is named <productCode>_ext-[Link].
3. Restart PolicyCenter.
• <productCode>_gen
• <productCode>_ext
These files are place in the following directories in the modules\configuration directory:
• config\integration\apis\ext\job\v1
• config\integration\apis\ext\policy\v1
• config\integration\apis\ext\policyperiod\v1
• config\integration\mappings\ext\policyperiod\v1
• config\integration\schemas\ext\policyperiod\v1
• config\integration\updaters\ext\policyperiod\v1
Also, remove the following directory and its contents:
• gsrc\gw\rest\ext\pc\policyperiod\<productCode>\v1
WARNING: Before you change the RestAPIsGeneratingByPolicyLine parameter's value from false to true,
Guidewire strongly recommends that you ensure that for every mono-line products whose product abbreviation
is different than the line prefix, you have updated the product as specified in “Products whose line prefix is not
identical to the product prefix” on page 192. If you do not, then any future regeneration of the LOB-specific
endpoints will create a new set of endpoints, as opposed to replacing the existing endpoints. This is likely to
lead to unexpected behaviors.
If the development of the product started on a Garmisch (or later) instance of PolicyCenter using a Garmisch (or later)
instance of the SBT, then there is an implementation of the ComplexSchedulePlugin plugin included with the base
configuration. No additional work is required.
Updating both a pre-Garmisch PolicyCenter and pre-Garmisch SBT to Garmisch (or later)
If the development of the product started on a pre-Garmisch instance of PolicyCenter using a pre-Garmisch instance of
the SBT, and both PolicyCenter and the SBT are updated to Garmisch (or later), then no additional work is required.
An implementation of the ComplexSchedulePlugin plugin will be added to PolicyCenter during the update process.
Updating a pre-Garmisch PolicyCenter to Garmisch (or later) while using a pre-Garmisch SBT
If the development of the product started on a pre-Garmisch instance of PolicyCenter using a pre-Garmisch instance of
the SBT, and only PolicyCenter is updated to Garmisch (or later), then some additional work is required to make the
pre-Garmisch SBT compatible with Garmisch PolicyCenter. This additional work consists of the following:
1. Download a Garmisch (or later) version of the SBT.
2. Copy the following files from the Garmisch (or later) version of the SBT to the existing pre-Garmisch SBT
3. In the Garmisch (or later) SBT, find the file from the list below that matches the SBT you are implementing. Replace
the pre-Garmisch version of this file in your SBT with the Garmisch (or later) version from the downloaded SBT.
Note: The structure of SBTs has changed significantly over time. If you are working with an SBT that was
released in 2015 or earlier, Guidewire recommends contacting your Guidewire representative to discuss the best
way to implement your SBT on a Garmisch or later release.
Differences between "product designer" scheduled items and SBT scheduled items
Once there is a suitable plugin implementation, the endpoints for SBT scheduled items work almost entirely the same
as scheduled items in Product Designer/Advanced Product Designer products. There are two differences with endpoints
for scheduled items in SBT products.
• They have two new scheduled item property types: additionalInsured and option. These properties have
corresponding value properties on the ScheduledItemProperty schema definition.
• They can have a set of child /coverage endpoints. This is because scheduled items in an SBT product can have
coverages attached to them. When the ComplexSchedulePlugin plugin identifies that a given coverable has at least
one coverage that has scheduled items with child coverages, it generates the child /coverage endpoints. For
example, for an SBT product, there could be an endpoint such as .../buildings/{buildingId}/coverages/
{coverageId}/scheduled-items/{scheduledItemId}/coverages/{scheduledItemCoverageId}.
LOB-endpoint generation is initiated at the product level, but it is executed at the line level
When you generate LOB-specific endpoints, you initiate the generation at the product level.
However, by default, PolicyCenter generates LOB-specific endpoints at the line level. When the endpoints are
generated, the endpoints are prefixed using the line code. If you generate LOB-specific endpoints for a multi-line
product, the endpoints for each line will have their own prefix.
Note: Guidewire recommends that all insurers who entered production on or after the Hakuba release
(2023.06.0) generate endpoints at the line level. Insurers who entered production prior to the Hakuba release
may want to consider generating endpoints at the product level. For more information, see “Products whose line
prefix is not identical to the product prefix” on page 192..
Cloud API does not require a mono-line product for every LOB
Cloud API supports the ability to generate LOB-specific endpoints for a line of business, even when that line is used
only by multi-line products. For example, suppose you have a Commercial Property Line that is used only by a multi-
line Commercial Package product. When you generate LOB-specific endpoints for the Commercial Package product,
Cloud API generates endpoints for the Commercial Property Line, even though this line is used only by multi-line
products.
Other services or environments may require that you create a mono-line product for every line. For example,
Guidewire APD Service may require you to create a mono-line Commercial Property package for the Commercial
Property Line before you can add that line to a multi-line Commercial Package product. But this requirement is not
enforced by Cloud API. Cloud API can generate endpoints for the Commercial Property Line using only the
Commercial Property package.
The following topic describes how to generate LOB-specific endpoints for the Personal Auto product found in the base
configuration. It also describes how to test the generated endpoints.
For information on how to generate LOB-specific endpoints for products in general, see “Generating LOB-specific
endpoints” on page 175.
The initial version of this class is empty. Guidewire recommends replacing the class with the code provided below for
the following reasons.
• The override of the finishCreate function ensures that the vehicle driver is linked to the parent PALine object.
This is necessary for certain behaviors, such as some of the base configuration Personal Auto screens in the user
interface.
• The override of the applyPatchForCreate function is not required, but it is recommended to ensure there are no
duplicate driver values.
package [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]#DATA_ATTRIBUTES
uses [Link]#POLICY_DRIVER
@Export
class VehicleDriverExtResource extends VehicleDriverGenResource {
override function finishCreate(data : DataEnvelope, batchUpdateMap : BatchUpdateMap) {
[Link](data, batchUpdateMap)
• goodDriverDiscount
• licenseNumbr
• licenseState
• numberOfAccidents
• numberOfViolations
• policyNumberOfAccidents
• policyNumberOfViolations
• trainingClassType
• yearLicensed
Therefore, when modifying a base configuration Personal Auto submission, you need to use a mix of LOB-specific
endpoints and generic endpoints.
{
"requests": [
{
"method": "post",
"uri": "/account/v1/accounts",
"body": {
"data": {
"attributes": {
"initialAccountHolder": {
"contactSubtype": "Person",
"firstName": "Tamsin",
"lastName": "Tester",
"primaryAddress": {
"addressLine1": "2850 S. Delaware St.",
"city": "San Mateo",
"postalCode": "94403",
"state": {
"code": "CA"
}
}
},
"initialPrimaryLocation": {
"addressLine1": "2850 S. Delaware St.",
"city": "San Mateo",
"postalCode": "94403",
"state": {
"code": "CA"
}
},
"producerCodes": [
{
"id": "pc:16"
}
],
"organizationType": {
"code": "other"
}
}
}
},
"vars": [
{
"name": "accountId",
"path": "$.[Link]"
},
{
"name": "driverId",
"path": "$.[Link]"
}
]
},
{
"method": "post",
"uri": "/job/v1/submissions",
"body": {
"data": {
"attributes": {
"account": {
"id": "${accountId}"
},
"baseState": {
"code": "CA"
},
"jobEffectiveDate": "2022-08-01",
"producerCode": {
"id": "pc:16"
},
"product": {
"id": "PersonalAuto"
}
}
}
},
"vars": [
{
"name": "jobId",
"path": "$.[Link]"
}
]
},
{
"method": "patch",
"uri": "/job/v1/jobs/${jobId}/questions",
"body": {
"data": {
"attributes": {
"answers": {
"PACurrentlyInsured": {
"choiceValue": {
"code": "newdriver"
}
}
}
}
}
}
},
{
"method": "post",
"uri": "/job/v1/jobs/${jobId}/lines/PersonalAutoLine/coverages",
"body": {
"data": {
"attributes": {
"pattern": {
"id": "PALossOfUseCov"
}
}
}
}
},
{
"method": "post",
"uri": "/job/v1/jobs/${jobId}/lines/PersonalAutoLine/vehicles",
"body": {
"data": {
"attributes": {
"make": "Toyota",
"model": "Camry",
"modelYear": 2010,
"costNew": {
"amount": "33000",
"currency": "usd"
},
"licenseState": {
"code": "CA"
},
"vin": "14HEW8RLGMDSP03AA"
}
}
},
"vars": [
{
"name": "vehicleId",
"path": "$.[Link]"
}
]
},
{
"method": "post",
"uri": "/job/v1/jobs/${jobId}/lines/PersonalAutoLine/vehicles/${vehicleId}/coverages",
"body": {
"data": {
"attributes": {
"pattern": {
"id": "PARentalCov"
},
"terms": {
"PARental": {
"choiceValue": {
"code": "60/20"
}
}
}
}
}
}
},
{
"method": "patch",
"uri": "/job/v1/jobs/${jobId}/contacts/${driverId}",
"body": {
"data": {
"attributes": {
"dateOfBirth": "1980-10-10",
"licenseNumber": "CA7732839",
"licenseState": {
"code": "CA"
},
"numberOfAccidents": {
"code": "0"
},
"numberOfViolations": {
"code": "0"
},
"policyNumberOfAccidents": {
"code": "0"
},
"policyNumberOfViolations": {
"code": "0"
}
}
}
}
},
{
"method": "post",
"uri": "/job/v1/jobs/${jobId}/lines/PersonalAutoLine/vehicles/${vehicleId}/drivers",
"body": {
"data": {
"attributes": {
"percentageDriven": 100,
"policyDriver": {
"id": "${driverId}"
}
}
}
}
},
{
"method": "patch",
"uri": "/job/v1/jobs/${jobId}/lines/PersonalAutoLine/vehicles/${vehicleId}/modifiers/PAAntiLockBrakes",
"body": {
"data": {
"attributes": {
"booleanModifier": true
}
}
}
},
{
"method": "post",
"uri": "/job/v1/jobs/${jobId}/quote"
}
]
}
Cloud API has endpoints that third-party applications can use to interact with policies. This includes retrieving
information about policies, creating policies, and modifying policies.
The base configuration contains endpoints for LOB-generic policy contents, such as policy contacts and policy
locations. But, it does not initially contain endpoints for LOB-specific policy contents, such as coverables and
coverages. In order to work with LOB-specific contents through Cloud API, you must first generate LOB-specific
endpoints for each line.
A codegen config file is a file that provides PolicyCenter with information about how to generate LOB-specific
endpoints for a given non-APD-native product. Codegen config files can provide the following types of information:
• Mapping for fields whose names in the visualized product are different than the names in the installed product
• Overrides for certain behaviors that exist in the product but are not reflected in the template or the visualized
product
This topic describes how to use a codegen config file to influence LOB-specific endpoint generation.
File names
Codegen config files are named using the following convention:
<productSuffix>_codegen_config_ext-[Link]
For example, suppose you have a Personal Auto product whose product suffix is "pa". The codegen config file for this
product is pa_codegen_config_ext-[Link].
<productSuffix>_codegen_config_ext-[Link]
For example, suppose you created a Crime product using Product Designer. The product's suffix is "cr". You want to
generate endpoints for this product and you need to specify codegen config information. The file for this product would
be: cr_codegen_config_ext-[Link].
For each type, and for fields in the type, you can specify one or more overrides.
autonumber
For collection types, this specifies the field to use when sorting members of the collection. This overrides the
collection's default sorting, if any.
Syntax
autonumber: <fieldName>
types:
PAVehicle:
autonumber: VehicleNumber
The following properties disable the DELETE method, the PATCH method, the POST method, and/or the POST /
split business action endpoint for this type. You can specify any or all of these in any combination.
Syntax
canDelete: false
canPatch: false
canPost: false
canSplit: false
types:
WCEmployee:
canSplit: false
WCJurisdiction:
canDelete: false
canPatch: false
canPost: false
identifier
In most cases, a type's id field maps to the data model entity's PublicID field. In the base configuration, the values of
these take the form of "pc:<alphanumeric-string>", such as "pc:Sp2FxL1061-Q_W8Bvtkj5".
For some types, the id value comes from a field other than PublicID. For example, in Commercial Auto, IDs for the
CABAJurisdiction type come from the State field. Instances of this type do not have ID values that are PublicID
values, such as "pc:Sp2FxL1061-Q_W8Bvtkj5". Rather, their ID values are codes from the State typelist, such as "CA",
"NY", or "WY".
In a codegen config file, you can use the identifier property to specify a data model entity field other than PublicID
that the id property must map to.
Syntax
identifier: <fieldName>
types:
CABAJurisdiction:
identifier: State
nameOverride
By default, the name of a type is mapped to the same name in the installed product. The nameOverride property
specifies a different name in the installed product to map the visualized product's type to. The primary use cases for
nameOverride are the following:
• PolicyLine entities that do not follow the <LinePrefix>Line naming convention expected by APD.
• Coverable or exposure entities that don’t start with the exact line prefix. For example, the PersonalVehicle entity in
the base configuration PersonalAuto product does not start with PA (see example below).
• Coverable or exposure entities that have names that aren’t legal in APD. The most common reason for this is names
that are too long.
Syntax
nameOverride: <installedProductTypeName>
For example, in the base configuration, the APD type PALine corresponds to the installed product's
PersonalAutoLine. To resolve this mismatch, the codegen config file contains the following:
types:
PALine:
nameOverride: PersonalAutoLine
You can also specify name overrides at the field level. For more information, see “Overrides at the fields level” on page
209.
oneToOne
A one-to-one relationship is a relationship that two data model entities have. One acts as the parent, and the other as the
child. For the parent, each instance may have an association with up to one instance of the child entity. For the child,
each instance must be associated with exactly one parent.
Every APD type maps to a data model entity. In some cases, an APD type maps to an entity that is the child in a one-to-
one relationship. In the codegen config file, you can specify that an APD type is a one-to-one child by using the
oneToOne property. This must be set to the name of the property on the parent data model entity that points to the data
model child.
Syntax
oneToOne: <propertyOnDataModelParentThatPointsToDataModelChild>
Note that the codegen config process considers the "parent data model entity" to be the data model entity that is
referenced by the parent APD type of the given APD type. For example, the IMSignPart APD type has a parent named
IMLine. The IMLine APD type maps to the InlandMarineLine data model entity. Therefore, if you specify a
oneToOne property on the IMSignPart APD type, the codegen config process looks for the property referenced by the
oneToOne on the InlandMarineLine data model entity.
To define this relationship for the purposes of codegen config, you can add the oneToOne property to the child APD
type (IMSignPart). It must identify the name of the property on the parent data model entity (InlandMarineLine) that
points to the data model child. In this case, the name of the property is also IMSignPart. The codegen config file looks
like this:
type:
IMSignPart:
oneToOne: IMSignPart
toCreateAndAdd
By default, whenever an instance of a type is added to a line, PolicyCenter simply creates a new instance of the type
and adds it to the line. No additional properties are set on the instance and no additional actions are taken. However, for
some types, additional actions may be required. Typically, these actions are executed by a method declared in the
<LineName>Enhancement Gosu enhancement.
For example, when a vehicle is added to a Personal Auto line, the following additional actions are needed:
• The vehicle's type must default to Passenger/Light Truck.
• The garage location must default to the first available PolicyLocation.
• Coverages, conditions, and exclusions for the vehicle must be created.
• The vehicle must be given a vehicle number based on the number of other vehicles on the line.
These actions are executed by a createAndAddVehicle method on the PersonalAutoLineEnhancement Gosu
enhancement.
When the codegen config process generates LOB-specific endpoints, the default behavior for each type is to simply
create a new instance of the type and add it to the line. If there is a special enhancement method that you want to use
instead, you can specify this method using the toCreateAndAdd property in the codegen config file.
Syntax
toCreateAndAdd: <MethodNameFromTheGosuLineEnhancement>
types:
PAVehicle:
toCreateAndAdd: createAndAddVehicle
toRemove
By default, whenever an instance of a type is removed from a line, PolicyCenter simply removes the instance from the
line. No additional actions are taken. However, for some types, additional actions may be required. Typically, these
actions are executed by a method declared on the <LineName>Enhancement Gosu enhancement.
For example, when a vehicle is removed from a Personal Auto line, the following additional actions are needed:
• The remaining vehicles must be renumbered to prevent any gaps in vehicle numbering.
These actions are executed by a removeVehicle method on the PersonalAutoLineEnhancement Gosu enhancement.
When the codegen config process generates LOB-specific endpoints, the default behavior for each type is to simply
remove the instance. If there is a special enhancement method that you want to use instead, you can specify this
method using the toRemove property in the codegen config file.
Syntax
toRemove: <MethodNameFromTheGosuLineEnhancement>
types:
PAVehicle:
toRemove: removeVehicle
resourceName
This overrides the default resource name. Use this override when the resource name differs from the nameOverride
name.
Syntax
resourceName: <resourceName>
types:
WCEmployee:
nameOverride: WCCoveredEmployeeBase
resourceName: WCCoveredEmployee
createOnly
By default, the value for a field can be specified in both POSTs and PATCHes. To restrict a field to being specified in
POSTs only, you can set the field's createOnly property to true.
Syntax
createOnly: true
types:
WCEmployee:
fields:
Location:
createOnly: true
SpecialCov:
createOnly: true
getterProperty
Defines the getter method in the mapper if it is different from the default property getter for the field.
Syntax
getterProperty: <getterProperty>
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
customType: Resource
mapperHandling:
getterProperty: RestV1_RiskClassResourceField
ignored
This prevents the field from being exposed to Cloud API.
Syntax
ignored: true
types:
WCWaiverOfSubro:
fields:
IfAnyExposure:
ignored: true
NumEmployees:
ignored: true
mapperHandling
Provides parent level settings for mapper handling.
Example from a test codegen config file
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
customType: Resource
mapperHandling:
getterProperty: RestV1_RiskClassResourceField
nameOverride
Use nameOverride when the name in the APD model doesn’t match the name in the entity. This can happen when the
entity’s field name isn’t allowed in APD so it had to be changed in the APD model. Field names that aren't allowed in
APD include names that are too long, start with a lowercase letter, or are reserved words in APD such as “Type” or
“Use.” Another common use case is to map an APD model field name that was changed or truncated back to the field
name on the installed product
Syntax
nameOverride: <installedProductFieldName>
types:
PAVehicle:
fields:
Year:
nameOverride: ModelYear
You can use nameOverride to resolve naming conflicts. For example, if an LOB has a field and an exposure with the
same name, this can cause unexpected results. Use nameOverride to override the schema field name to resolve these
types of conflicts.
You can also specify name overrides at the type level. For more information, see “Overrides at the type level” on page
206.
The nameOverride property should be used only for Cloud Retrofit. For APD Adoption, use schemaPropertyName.
nullable
This prevents the caller from specifying a null value for the field in a request object.
Syntax
nullable: false
types:
WCEmployee:
fields:
IfAnyExposure:
nullable: false
readOnly
By default, the value for a field can be specified in POSTs and PATCHes. To prevent a field from being specified in
either case, you can set the field's readOnly property to true.
Syntax
readOnly: true
types:
SampleTestCoverable:
fields:
LineField:
# do not generate property in updater
readOnly: true
requiredForCreate
This overrides the default requiredForCreate value.
• Setting this to true prevents the caller from omitting the value in a POST request.
• Setting this to false allows the caller to omit the value in a POST request.
Syntax
requiredForCreate: <Boolean>
types:
PAVehicle:
fields:
GarageLocation:
requiredForCreate: false
schemaHandling
This property provides a parent level for settings related to schema handling.
Example from a test codegen config file
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
schemaHandling:
schemaPropertyName: anotherRiskClassResourceField
schemaPropertyName
Use schemaPropertyName in the following cases:
• The field name conflicts with a graph property name generated for an array of child coverables and exposures. You
need to rename the property to ensure the names are unique.
• The field name conflicts with some other built-in property, such as the address properties automatically added to
any location-based coverable.
• You don’t like the name in the APD model and would prefer a different name in the schema (for example, because
the APD name has constraints that schema names don’t, so maybe you want a longer name).
Syntax
schemaPropertyName: <propertyname>
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
schemaHandling:
schemaPropertyName: anotherRiskClassResourceField
setterProperty
Use this property for the setter method in the updater when it is different from the default property setter for the field.
Syntax
setterProperty: <propertyID>
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
updaterHandling:
setterProperty: RestV1_RiskClassResourceField
updaterHandling
The parent level settings for updater handling.
Example from a test codegen config file
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
updaterHandling:
setterProperty: RestV1_RiskClassResourceField
IMPORTANT: This functionality is available only to customers who have signed up for our Early Access (EA)
program. Talk to your Guidewire representative to learn more about our eligibility criteria for EA programs.
Note that EA capabilities may or may not become part of our future offerings.
The following properties can be listed after the fields property for a given type. The properties in this section are for
use only with the APD "Other" field type.
create
A create expression for the updater.
Syntax
create: <create-expression>
types:
SampleTestCoverable:
fields:
RiskClassRefField:
updaterHandling:
create: SampleTestCoverable.RestV1_DefaultRiskClass()
customType
As of this release, possible values are Resource and ClassCode.
When Resource is specified, the following default behavior occurs:
• The schema will use only resourceType configs
• The mapper will have a ResourceReference and try to evaluate the property as
xxx.RestV1_AsEffDatedReference (if the other field is an EffDated entity), or xxx.RestV1_AsReference (if the
other field is not an EffDated entity but it is a KeyableBean entity)
When ClassCode is specified, the following default behavior occurs (where XXX is the product line prefix, such as PA
or WC):
• An empty XXXClassCodeReference schema, mapper, and updater are created for the field.
• A default XXXClassCodeJsonValueResolver is created in the updater. The resolver will attempt to resolve the
class code by ID.
• The default path for the resolver is [Link]. You
can override this path using the valueTypeResolver property described below.
Syntax
customType: <customType>
types:
SampleTestCoverable:
fields:
ClassCodeField:
customType: ClassCode
LineField:
customType: Resource
extensions
Additional settings defined for the x-gw-extensions schema property, such as filterable and sortable properties.
Example from a test codegen config file
types:
SampleTestCoverable:
fields:
RiskClassStringField:
schemaHandling:
extensions:
filterable: false
sortable: false
format
This defines the format settings for the field. This field needs to be overridden only in cases where the format is not
supported in APD and you want to make the field a scalar type in the schema.
Syntax
format: "string"
types:
SampleTestCoverable:
fields:
LineField:
format: date-time
mapperRef
Use this override when the mapper reference is different from the schemaDefinition.
Syntax
mapperRef: <mapperRef>
IndustryCodeField:
schemaDefinition: ReferenceTableEntry
mapperHandling:
mapperRef: IndustryCode
resourceType
Defines the resourceType settings for the field. This is applied when customType is set as Resource. If the
customType is Resource and this field is not defined, the system will try to use the actual entity type as the
resourceType.
Syntax
resourceType: <resourceType>
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
customType: Resource
schemaHandling:
resourceType: RiskClass
schemaDefinition
For use when the field is a reference property. If the referenced schema is found in the core schema, no additional
schema is created. If it's not found in the core schema, an empty schema will be generated so it can be extended with an
extension file.
Syntax
schemaDefinition: <schemaDefinition>
types:
SampleTestCoverable:
fields:
IndustryCodeField:
schemaDefinition: ReferenceTableEntry
type
The type settings for the field. This needs to be overridden only in cases where the field is not an APD supported
format but you want to make it a scalar type in the schema.
Syntax
type: <datatype>
types:
SampleTestCoverable:
fields:
RiskClassStringField:
schemaHandling:
type: string
updaterRef
Use this override when the updater reference is different from the schemaDefinition.
Syntax
updaterRef: <updater-reference>
types:
SampleTestCoverable:
fields:
RiskClassRefField:
schemaDefinition: RiskClassReference
updaterHandling:
# using different updater from schemaDefinition
updaterRef: RiskClassReferenceForUpdater
valueTypeResolver
The full path of the JSON value resolver for the field if it is referencing another entity.
Syntax
valueTypeResolver: <full-path-to-resolver>
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
updaterHandling:
valueTypeResolver: [Link]
valueTypeResolverConfigs:
setById: true
valueTypeResolverConfigs
Available to provide additional optional configs for the JSON value resolver.
Example from a test codegen config file
types:
SampleTestCoverable:
fields:
RiskClassResourceField:
updaterHandling:
valueTypeResolver: [Link]
valueTypeResolverConfigs:
setById: true
types:
PADriver:
nameOverride: VehicleDriver
fields:
PolicyDriver:
createOnly: true
PALine:
nameOverride: PersonalAutoLine
PAPolicyDriverMVR:
nameOverride: PolicyDriverMVR
# PolicyDriverMVRs are managed implicitly via requests to retrieve
# an MVR on individual drivers and are read-only
canDelete: false
canPatch: false
canPost: false
PAVehicle:
nameOverride: PersonalVehicle
fields:
GarageLocation:
requiredForCreate: false
Year:
nameOverride: ModelYear
autonumber: VehicleNumber
toCreateAndAdd: createAndAddVehicle
toRemove: removeVehicle
wizardStepIds: false
The Product Definition API contains endpoints that can be used to act on product templates and products. For example,
you can do the following through these endpoints:
• Import a product template
• Generate LOB-specific endpoints for an installed product based on the current visualized product
• Toggle which set of endpoints (visualized or installed) are active
These endpoints may simplify the work to develop and test products. But, these endpoints are not intended to execute
product development on their own. For initial product development, Guidewire recommends using APD App directly.
Product templates
Within the context of product development, a product can be in one of two states:
• Visualized - The product exists in Advanced Product Designer in a "draft" state.
◦ Some product-specific artifacts (such as the product-specific coverages database table) have not yet been
created.
• Installed - The product exists in a "finalized" state.
◦ All product-specific artifacts (including the product-specific coverages database table) have been created.
Several Product Definition API templates use the producttemplate resource. In this context, a product template is a
JSON representation of a visualized product. This could be a product that is APD-native or one that was created by
importing a template that was extracted from an installed product.
Command
GET /productdefinition/v1/product-templates/WorkersComp
Response payload
{
"data": {
"attributes": {
"abbreviation": "WC",
"codeIdentifier": "WorkersComp",
"description": "Workers' Compensation",
"enabled": true,
"id": "WorkersComp",
"name": "Workers' Compensation",
"productAccountType": {
"code": "Any",
"name": "Any"
}
},
...
Importing products
Cloud API has endpoints that let you import a product. The source of the product can be either an XML template or a
mind map.
Use the following endpoint to import a product:
• POST /productdefinition/v1/import-template
• POST /productdefinition/v1/import-xmind
For most Cloud API endpoints, the request has a body with a single string of JSON text. However, the import
endpoints expect the request body to be a FormData object, as opposed to a JSON string. The request header must have
a content key whose value is the template or mind map to import. The response contains a body with a single id
attribute that identifies the id of the imported product.
Example of importing an XML template
For example, suppose you had an XML template for a PersonalAuto product. The template is named
[Link]. The following request imports the template.
Command
POST /productdefinition/v1/import-template
Request header
content/[Link]
Request body
{
"data": {
"attributes": {
"id": "PersonalAuto"
}
}
}
POST /productdefinition/v1/import-xmind
Request header
content/[Link]
Request body
{
"data": {
"attributes": {
"id": "MarineCargo"
}
}
}
Procedure
1. In Postman, start a new request by clicking the + to the right of the Launchpad tab.
2. Under the Untitled Request label, select POST.
3. In the Enter request URL field, enter the URL for the server and the endpoint. For example:
a. To POST an XML template to an instance of PolicyCenter on your machine, enter: [Link]
8180/pc/rest/productdefinition/v1/import-template
b. To POST a mind map to an instance of PolicyCenter on your machine, enter: [Link]
8180/pc/rest/productdefinition/v1/import-xmind
4. On the Authorization tab, specify authorization information as appropriate.
5. Specify the request payload.
a. In the first row of tabs (the one that starts with Params), click Body.
b. In the row of radio buttons, select form-data.
c. On the first line, for KEY, enter: content
d. Click outside of the content cell. Then, mouse over the right side of the cell. A drop-down list appears.
Change the value from Text to File.
e. For VALUE, click the Select Files button and navigate to XML product file or mind map file.
6. Click Send. The response payload appears below the request payload.
For more information on the scope of the product base code or additional registered extensions, see Integrating
Products with PolicyCenter.
For example, the following request generates only the LOB-specific endpoints for a Crime product whose ID is
"Crime".
Command
POST /productdefinition/v1/product-templates/{productId}/codegen
Request body
{
"data": {
"attributes": {
"productId": "Crime"
"generationMode": "API_CODE"
}
}
}
/productdefinition/v1/product-templates/WorkersComp/disable
Request body
<none>
Response body
{
"data": {
"attributes": {
"abbreviation": "WC",
"codeIdentifier": "WorkersComp",
"description": "Workers' Compensation",
"enabled": false,
...
},
For each product, it's possible to have both a visualized and an installed version of the product. However, the REST
APIs can be enabled for only one of those versions.
In this example, there are two products listed. One is the visualized version of product TST Product, the other is the
installed version of the same product. In this example, the REST APIs for the installed version of the product are
enabled.
Command
GET /productdefinition/v1/products
Response
{
"count": 2,
"data": [
{
"attributes": {
…
"description": "TST Product",
"descriptionKey": "Product_TST.Description",
"id": "TST",
"name": "TST Product",
"nameKey": "Product_TST.Name",
…
"restAPIsEnabledAndActive": false,
"visualized": true
},
…
},
{
"attributes": {
…
"description": "TST Product",
"descriptionKey": "Product_TST.Description",
"id": "TST",
"name": "TST Product",
"nameKey": "Product_TST.Name",
…
"restAPIsEnabledAndActive": true,
"visualized": false
},
…
]
{
"data": {
"attributes": {
"lineId": "Crime-2"
}
}
}
See Cloud API Consumer Guide for additional information on product editions.
DELETE /productdefinition/v1/product-templates/WorkersComp
Request body
<no body>
The following topics discuss configuration for additional specific uses cases. This includes:
• Configuring custom batch processes
• Configuring address locales
Cloud API supports the ability to start batch processes. For information on how to use the /systemtools/v1/batch-
processes/{batchProcessType}/start endpoint, see “Batch processes”.
Some batch processes let you specify arguments when you run the batch process. These arguments perform the
function of input parameters, and they can change the way the batch process runs.
You can create custom batch processes which take arguments. If you want to be able to submit arguments to the /
start endpoint, then some configuration of Cloud API is required. This topic describes this configuration.
For example, suppose you created a custom batch process named GroupMetrics_Ext that calculates performance
metrics for every group based on work assigned to users in the group. It takes an optional argument of a single group
name, specified as a string. To implement this argument, the systemtools_ext-[Link] schema file would
include the following:
"definitions": {
"BatchProcessArguments": {
"properties": {
"groupmetrics_ext": {
"title": "GroupMetrics_Ext",
"description": "Arguments for the GroupMetrics_Ext batch process",
"$ref": "#/definitions/GroupMetrics_ExtArguments"
}
}
},
"GroupMetrics_ExtArguments": {
"title": "GroupMetrics_ExtArguments",
"description": "Arguments for the GroupMetrics_Ext batch process",
"type": "object",
"properties": {
"groupName": {
"title": "GroupName",
"description": "The name of the group to process",
"type": "string"
}
}
}
The fields in an address that are either valid or required can vary based on the country or region that the address
belongs to. For example, when designating a specific region in a country:
• A US address uses state
• A Canadian address uses province
• A Japanese address uses prefecture
The base configuration of Cloud API comes with locale settings for a wide range of countries. you may need to
configure the base configuration locales, and you may need to add new locales.
"Address": {
"title": "Address",
"description": "An `Address` represents a postal address. The fields available on an `Address`
will depend upon the `country` value for the `Address`.",
"type": "object",
"x-gw-extensions": {
"discriminatorProperty": "country"
},
"properties": {
"addressLine1": {
"title": "Address line 1",
"description": "The first line of the address",
"type": "string",
"x-gw-nullable": true
},
...
"province": {
"title": "Province",
"description": "The province of the address. Only applicable in certain countries.",
"$ref": "#/definitions/TypeKeyReference",
"x-gw-nullable": true,
"x-gw-extensions": {
"countryRestricted": true,
"typelist": "State"
}
},
"Address": {
"schemaDefinition": "Address",
"root": "[Link]",
"properties": {
"addressLine1": {
"path": "Address.AddressLine1"
},
"province": {
"path": "[Link]",
"mapper": "#/mappers/TypeKeyReference",
"predicate": "Address.RestV1_isFieldAvailable('province')"
},
"Address": {
"schemaDefinition": "Address",
"root": "[Link]",
...
},
"properties": {
"addressLine1": {
"path": "Address.AddressLine1"
},
"province": {
"path": "[Link]",
"allowed": "Address.RestV1_validateInputField('province', srcJson)",
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
},
countries:
CA:
name: Canada
addressFields: addressLine1, addressLine2, addressLine3, city, county, province, postalCode
addressRequire: addressLine1, city, province, postalCode
JP:
name: Japan
addressFields: addressLine1, addressLine1Kanji, addressLine2, addressLine2Kanji, addressLine3, city, cityKanji,
prefecture, postalCode
addressRequire: addressLine1, city, prefecture, postalCode
US:
name: United States
addressFields: addressLine1, addressLine2, addressLine3, city, county, state, postalCode
addressRequire: addressLine1, city, state, postalCode
Configuration tasks
Schema extensions for the Address schema must be declared in the following files:
• The Common API schema extension file: common_ext-[Link]
• The Common API mapping extension file: common_ext-[Link]
• The Common API updater extension file: common_ext-[Link]
For detailed information on how to configure schemas, see “Endpoint architecture” on page 15.
4. In the Common API updater file, add updater information for the property.
• Add an allowed attribute set to Address.RestV1_validateInputField('<propertyName>', srcJson)
5. Add the field to the addressFields section of the appropriate country entries in the [Link] file.
Endpoints within Cloud API must control access to the data and actions within PolicyCenter. When a caller tries to
access data or execute an action, the caller must be authenticated and authorized. Authentication is the process of
verifying that the caller is who they claim to be. Authorization is the process of determining what operations and data
the caller is allowed to access. These two process are often referred to collectively as "auth".
The following topics provide an overview of the different aspects an insurer must consider when planning an
authentication approach. This includes:
• The different types of callers that Cloud API supports
• The different applications involved with Cloud API authentication
• The types of access enforced by Cloud API
• The supported authentication methods
This concludes with a topic that can help insurers determine which authentication flows are most appropriate for a
given caller application.
Overview of authentication
Cloud API must control access to the data and actions within PolicyCenter. When a caller tries to access data or
execute an action, the caller must be authenticated and authorized. Authentication is the process of verifying that the
caller is who they claim to be. Authorization is the process of determining what operations and data the caller is
allowed to access. These two process are often referred to collectively as "auth".
This topic provides an overview of how authentication and authorization are managed by Cloud API.
Types of callers
Within the context of Cloud API authentication, a caller is a user or service who triggers a Cloud API call from a caller
application.
There are several different types of callers. This documentation uses the following terms to identify them:
• Internal user - This is a person who is listed as a user in the PolicyCenter operational database. For example, Alice
Applegate, a PolicyCenter underwriter, is an internal user.
◦ Note that internal users can use caller applications and trigger Cloud API calls from those applications. For
example, suppose there is a location photography portal that contains pictures of covered buildings taken by a
third-party field agent. An underwriter reviews and selects pictures to be saved to PolicyCenter. This action
triggers a Cloud API call by an internal user from a caller application.
• External user - This is a person who is known to the insurer but who is not listed as a user in the PolicyCenter
operational database. For PolicyCenter, there is one typical type of external user:
◦ Account holders - Users who want to interact with information about their accounts and policies. For example,
Ray Newton, who is a policyholder and wants to verify what coverages he has.
• Anonymous user - This is a person who is not yet known to the insurer but who may establish a business
relationship with the insurer. Typically, an anonymous user can only create an account (and its associated objects),
quote a submission, and bind a submission. Once an anonymous user binds a submission, they logically move from
being an anonymous user to an external user.
• Service - This is a service, also referred to as a service-to-service application. For example, a billing service that
processes premium payments and periodically reports to PolicyCenter when a policy is delinquent. There are
several ways in which a service can make a call:
◦ As a standalone service, in which the service executes the call as itself. It does not execute the call on behalf of
a specific person or through a PolicyCenter user account.
◦ As a service with user context, in which the service presents information about itself and about a specific user.
The call is able to do only the things that both the service by itself could do and the user by itself could do.
Overview of authentication 235
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
◦ As a service with service account mapping, in which the service is mapped to an account in the PolicyCenter
database and has access as determined by that account.
• Unauthenticated caller - This is a user or service who provides no authentication information. Unauthenticated
callers can access only metadata endpoints. Unauthenticated callers are typically callers who need information
about Cloud API endpoints.
Within the context of authentication and authorization, this documentation uses the following terms in the following
way:
• User is used exclusively for callers that are people.
• Service is used exclusively for callers that are not people and that take action without direct action from a person.
• Service account is used to refer to an account in the PolicyCenter database that is used exclusively by a service and
that defines access for that service.
• Caller is used to collectively refer to users and services.
Authentication architecture
The authentication architecture for Cloud API consists of:
• The InsuranceSuite application (such as PolicyCenter)
• Guidewire Identity Federation Hub
• The insurer's identity provider (IdP)
• Any additional authorization application that stores caller-specific authorization information
• A set of one or more caller applications
Note that some parts of the architecture are relevant for all Cloud API calls, regardless of the type of caller. Other parts
of the architecture are relevant only for certain types of callers.
Guidewire Hub
Guidewire Identity Federation Hub (Guidewire Hub) is the trusted auth server for all Guidewire cloud applications,
including caller applications that insurers create to access Guidewire cloud resources. Guidewire Hub uses OAuth 2.0
and SAML for identity management services.
The primary responsibilities of Guidewire Hub are:
• For internal users and external users:
◦ To receive authentication requests from InsuranceSuite applications and caller applications
◦ To federate those authentication requests to the correct IdP
◦ To construct JWTs that verify users and provide information about their authorization
• For services:
◦ To authenticate services
◦ To construct JWTs that verify services and provide information about their authorization
◦ To authenticate users and provide information about their authorization when a request is received from
Guidewire Hub
The IdP does not play a role in service authentication or authorization.
Cloud API
From an authentication perspective, the primary responsibilities of the Cloud API are:
• For authenticated callers:
◦ Verify that each call includes valid authentication
Types of access
Authorization is the process of determining what operations and data the caller is allowed to access. Cloud API
enforces authorization using the following types of access:
• Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
◦ What endpoints are available to the caller?
◦ What operations can a caller call on the available endpoint?
◦ What fields can the caller specify in a request payload or get in a response payload?
• Resource access defines, for a given type of resource, which instances of that resource type the caller can access.
For example, for a given caller, endpoint access might grant access to a GET /policies endpoint. But this does not
necessarily mean the caller can access every policy in the system. Resource access can limit which specific policies
that caller can view.
• A proxy user is an internal user that is assigned to an external user or service when an external user or service
triggers an API call. Whenever PolicyCenter logic must verify that the caller has a given domain-level system
permission (such as permission to own an activity) or authority limit, the proxy user is checked. This is referred to
as proxy user access.
Each type of access does not necessarily apply to every type of caller.
• All types of users are restricted by endpoint access.
• In the base configuration, only users are restricted by resource access. Services are not.
• Only external users and services are restricted by proxy user access. Internal users are not.
Authentication methods
Cloud API supports two authentication methods. The methods differ based on how authentication information is sent
from the caller application to PolicyCenter.
Basic authentication
Basic authentication is an authentication method in which only the user's user name and password are provided, and
they are provided in the request header.
• Internal users (and only internal users) can use basic authentication.
• With basic authentication, the authentication and authorization information is retrieved from the operational
database using information in the request header.
Guidewire recommends using basic authentication only over HTTPS (SSL).
Note: Basic authentication is not supported in production environments. It can only be used in development
environments. For more information, see“Basic authentication” on page 255.
Constructing JWTs
Overview of JWTs
In bearer token authentication, the caller presents a JSON Web Token (JWT). The JWT contains a set of claims. Each
claim is a key/value pair that represents information that "the bearer of the token claims to be true". For example, a
JWT could contain the following claim, which asserts the identity of the bearer of the token (in the sub claim, which
identifies the "subject"):
[
"sub": "rnewton@[Link]",
...
]
Cloud API uses information in the JWT to determine the authorization to grant to the caller. This typically involves two
types of information:
• Some information in the JWT identifies the API roles to assign to the caller. This determines the level of endpoint
access the caller has.
• Some information in the JWT identifies the caller's resource access IDs. This determines the level of resource
access the caller has. (In other words, this determines which specific resources that caller can access.)
For example, suppose Ray Newton is an insured making a request to PolicyCenter. The JWT includes the following.
[
"sub": "rnewton@[Link]",
"groups": [
"[Link].Account_Holder"
],
"pc_accountNumbers": [
"C000143542"
],
...
]
This provides the caller with endpoint access as defined in the Account_Holder API role, and resource access to
resources associated with any account whose account number is C000143542.
This provides the caller with endpoint access as defined in the acme_fnolreporter API role. Because the caller is a
service, it is not bound by resource access.
For example, suppose an insurer wants to provide access to insureds, but they do not want to store API role information
for insureds in the IdP. This insurer could configure the IExpandTokenPlugin plugin to do the following:
• Extract the value of the sub (subject) claim from the token map.
• Send the value to the appropriate external system, which responds with a list of API roles that define endpoint
access for the insured
• Add the API roles to the token map's groups claim.
The JWT received from Guidewire Hub would look like this:
...
"sub": "rnewton@[Link]",
"groups": [
],
...
After the IExpandTokenPlugin plugin makes it call, the token map would look like this:
...
"sub": "rnewton@[Link]",
"groups": [
"[Link].Account_Holder"
],
...
As another example, suppose an insurer wants to provide access for producers. Resource access for producers is
determined by producer codes. Each producer can have up to several hundred producer codes, and the amount of data
may exceed what can be stored in a JWT. This insurer could configure the IExpandTokenPlugin plugin to do the
following:
• Extract the value of the sub (subject) claim.
• Send this value to the appropriate external system, which responds with a list of producer codes that define resource
access for the producer
• Add the producer codes to the token map's cc_producerCodes claim.
The JWT received from Guidewire Hub would look like this:
...
"sub": "kegerston@[Link]",
"producerCodes": [
],
...
After the IExpandTokenPlugin plugin makes its call, the token map would look like this:
...
"sub": "kegerston@[Link]",
"producerCodes": [
"100-002541",
"100-002542",
"100-002543",
...
],
...
Note: The IExpandTokenPlugin plugin does not modify the JWT itself. It modifies only the map that contains
information extracted from the JWT. If the JWT is passed on to some other system after the
IExpandTokenPlugin plugin has been called, the JWT will be in its original form. It will not contain
information retrieved by the plugin.
For more information on configuring the IExpandTokenPlugin, see “Configuring the IExpandTokenPlugin plugin” on
page 355.
1. The caller application (which could be a browser-based application supporting users or a service) requests a JWT
from Guidewire Hub. If the caller application is a service, this request includes the service's API roles.
2. For user callers, Guidewire Hub requests authentication from the IdP. (For services, authentication is performed
by Guidewire Hub.)
3. For user callers, the IdP authenticates the user.
4. For user callers, the IdP provides a SAML response. This response must include verification that the user has
been authenticated. It must also include information about the user's API roles and resource access IDs, or any
lookup values needed by the IExpandTokenPlugin plugin to retrieve API roles and resource IDs.
5. Guidewire Hub constructs the JWT.
6. Guidewire Hub returns the JWT to the caller application.
7. The caller application submits the API request to the InsuranceSuite application. The JWT is included in the
request header.
8. Cloud API extracts information from the JWT and puts it into a token map. If necessary, the IExpandTokenPlugin
plugin calls an external auth provider to retrieve any additional auth information and add it to the token map.
9. The caller's authorization is determined using the token map, which contains information from the original JWT
and optionally information added by the IExpandTokenPlugin plugin.
10. The InsuranceSuite application processes the request and sends the response to the caller application.
For more information on registering the caller application with Guidewire Hub, see “Registering the caller application
with Guidewire Hub” on page 332.
For information on configuring the IExpandTokenPlugin plugin, see “Configuring the IExpandTokenPlugin plugin” on
page 355.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path /activities/xc:20"
{
"count": 2
"data": [
{
"attributes": {
"id": "xc:10",
... },
...
},
{
"attributes": {
"id": "xc:30",
... },
...
}
"links": { ... }
}
Configuring authentication
During implementation, for a given type of caller, an insurer may need to:
• Enable asymmetric encryption
• Provide deployment information
• Register the caller application with Guidewire Hub
Within the context of Cloud API, an auth flow is a flow of authentication and authorization information for a particular
type of caller. Cloud API supports multiple auth flows. This topic identifies the issues to consider when choosing an
auth flow for a particular caller application.
The most important issues to consider are as follows:
• What OAuth flow must the caller application use?
• Which user is attached to the session?
• Where are authorization values stored?
• Who enforces resource access?
• What values are used as resource access IDs?
This topic assumes you are familiar with the Cloud API authentication architecture and the meaning of the terms
endpoint access, resource access, and proxy user access. For more information, see “Overview of authentication” on
page 235.
Cloud API also supports auth flows that do not make use of bearer token authentication. For more information, see
“Additional auth flows” on page 251.
Selecting an authentication flow 245
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Summary of behaviors
The following table summarizes these behaviors.
Internal User External User Standalone Service with Service with Service with
service Internal User External User Service Account
Context Context Mapping
OAuth Authorization code Authorization code Client credential Client credential Client credential Client credential
flow flow flow flow flow flow flow
For a summary of all the issues to consider in a single table, see “Summary of the issues to consider” on page 251.
• If the call also triggers a domain-level permissions check, the user's permissions are checked.
Summary of behaviors
The following table summarizes these behaviors.
Internal External User Standalone service Service with Service with External Service with
User Internal User Context Service
User Account
Context Mapping
Can each call Yes No No Yes No Yes
have its own
(a single "external (a single "service proxy (a single "service proxy
user attached to
proxy user" is used user" is used for all user" is used for all
the session?
for all relevant calls) relevant calls) relevant calls)
For a summary of all the issues to consider in a single table, see “Summary of the issues to consider” on page 251.
The IdP
For some auth flows, the IdP must either store the authorization values or provide some sort of lookup value that can be
used to retrieve the authorization values from an additional authorization system. The authorization values (or the
lookup value) must be included in the IdP's SAML response. The following Cloud API auth flows support this:
• Internal user
• External user
• Standalone service
• Service with internal user context
• Service with external user context
Summary of behaviors
The following table summarizes these behaviors.
Internal External Standalone service Service with Service with Service with
User User Internal User External User Service Account
Context Context Mapping
Where do The IdP The IdP The service itself The service The service The Guidewire
authorization values (endpoint access values itself itself configuration
(or an appropriate only; resource access IDs
lookup value) come are not applicable)
from?
For a summary of all the issues to consider in a single table, see “Summary of the issues to consider” on page 251.
Summary of behaviors
The following table summarizes these behaviors.
Internal External Standalone service Service with Service with Service with
User User Internal User External User Service Account
Context Context Mapping
Does Cloud API Yes Yes No (The service is Yes Yes Yes
enforce resource expected to enforce it.)
access?
For a summary of all the issues to consider in a single table, see “Summary of the issues to consider” on page 251.
Business IDs
For other auth flows, resource access IDs are business IDs. These IDs represent either:
• Something the caller owns, such as account numbers (for PolicyCenter account holders)
• Who the caller is, such as contact IDs (for ClaimCenter claimants), producer codes (for ClaimCenter producers), or
address book unique identifiers (for vendors providing services for ClaimCenter claims)
For these auth flows, every call must present one or more business IDs, or a lookup value that can be used to retrieve
the business IDs from an additional authorization application. Resource access is then based on which resources the
caller owns. The following Cloud API auth flows support this:
• External user
• Service with external user context
No resource IDs
There are two auth flows that do not use resource IDs.
For standalone services, resource access is enforced by the service itself, and not by Cloud API. Therefore, there is no
need to provide resource access IDs.
For services with service account mapping, the service is mapped to a service account. Information in the service
account is used to determine resource access, but there are no resource IDs passed within the auth flow.
Summary of behaviors
The following table summarizes these behaviors.
Internal External User Standalone Service with Service with External Service with
User service Internal User User Context Service Account
Context Mapping
What are the user names IDs for business data not applicable user names IDs for business data not applicable
resource (such as contact IDs (such as contact IDs and
access IDs? and account account numbers)
numbers)
For a summary of all the issues to consider in a single table, see “Summary of the issues to consider” on page 251.
Internal User External User Standalone Service with Service with Service with
service Internal User External User Service
Context Context Account
Mapping
OAuth flow Authorization Authorization code Client credential Client Client credential Client credential
code flow flow flow credential flow flow flow
Can each call have Yes No (a single No (a single Yes No (a single Yes
its own user "external proxy "service proxy "service proxy
attached to the user" is used for all user" is used for all user" is used for
session? relevant calls) relevant calls) all relevant calls)
Where do The IdP The IdP The service itself The service The service itself The Guidewire
authorization (endpoint access itself configuration
values (or an values only;
appropriate resource access IDs
lookup value) are not applicable)
come from?
Does Cloud API Yes Yes No Yes Yes Yes
enforce resource
(The service is
access?
expected to
enforce it.)
What are the user names IDs for business not applicable user names IDs for business not applicable
resource access data (such as data (such asc
IDs? contact IDs and ontact IDs and
account numbers) account
numbers)
For more “OAuth2 “OAuth2 “OAuth2 client “OAuth2 “OAuth2 client “OAuth2 client
information on authorization authorization credential flow: client credential flow: credential
this auth flow code flow: code flow: Standalone credential Services with flow: Services
Internal users” External users” on services” on page flow: user context” with service
on page 261 page 267 285 Services with on page 293 account
user context” mapping” on
on page 293 page 309
The following table summarizes the issues to consider. It identifies the options for each issue, and which auth flow
supports each option. The final row of the table provides a link which you can follow to get more detailed information
about that auth flow.
Cloud API supports several different authentication flows. Each flow supports one of the following types of callers:
• Internal users using basic auth
• Internal users using bearer token auth
• External users
• Anonymous users
• Standalone services
• Services with user context
• Services with service account mapping
• Unauthenticated callers
This section describes each of these flows in detail.
Basic authentication
Within the context of Cloud API authentication, an internal user is a person who is listed as a user in the PolicyCenter
database. For example, Alice Applegate, a PolicyCenter underwriter, is an internal user. Internal users can use caller
applications and trigger Cloud API calls from that application. For example, suppose there is a location photography
portal that contains pictures of covered buildings taken by a third-party field agent. An underwriter reviews and selects
pictures to be saved to PolicyCenter. This action triggers a Cloud API call by an internal user from a caller application.
Internal users can be authenticated using either basic authentication or bearer token authentication. Basic
authentication is an authentication method in which only the user's user name and password are provided, and they are
provided in the request header.
• Internal users (and only internal users) can use basic authentication.
• With basic authentication, the authentication information is retrieved from the operational database using
information in the request header
Basic authentication is not supported in production environments.
Basic authentication can be useful in development when you want to test aspects of endpoint behavior that are not
related to authentication. Basic authentication does not require any interaction with Guidewire Hub to generate JWTs.
You can authenticate a Cloud API call using only the caller application and PolicyCenter.
This topic describes how to implement basic authentication for internal users. (For information on how to implement
bearer token authentication for internal users, see “OAuth2 authorization code flow: Internal users” on page 261.)
Credentials
With basic authentication, every internal user's credential information is stored in the PolicyCenter database.
The user name and password is provided by each caller in the request object's header.
Authorization
Endpoint access with basic authentication
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
Basic authentication 255
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Strategy name Persona using this The resource access ID is assumed Grants access to...
strategy to be...
pc_username Internal users A PolicyCenter user name Any information this internal user could see in
PolicyCenter based on their associated Access
Control Lists (ACLs).
When an internal user makes a Cloud API call, the user name is used as the resource access ID. The pc_username
strategy is used automatically. This strategy consists of Cloud API logic that matches, as closely as possible, the user's
access as defined in the base configuration's Access Control Lists (ACLs).
For more information on how resource access behaves, see “Resource access” on page 345.
Request headers
For basic authentication, authorization information is sent to PolicyCenter with the request's authorization header. The
header must use this format:
1. When Alice triggers an API call, the caller application sends the API request to PolicyCenter. The request header
includes a base64-encoded version of the user's user name (aapplegate@[Link]) and password (aPassword).
2. The IExpandTokenPlugin plugin is not relevant for basic authentication.
3. PolicyCenter authenticates the user and determines the endpoint access.
a. Using the user name in the request header (aapplegate@[Link]), PolicyCenter queries the user table.
b. PolicyCenter authenticates the user by verifying that the user name and password match.
c. PolicyCenter responds with the user roles that this user has. One role is returned: Underwriter.
4. Based on the returned role, the [Link] API role file is used to define the endpoint access.
5. Next, PolicyCenter determines the resource access strategy. Because the call is using basic authentication,
PolicyCenter grants resource access as defined in the internal [Link] files. (* PolicyCenter starts with
internal_ext-[Link], but this file references additional [Link] files whose name starts with
"internal".)
6. Proxy user access is not relevant for basic authentication.
7. PolicyCenter processes the request.
a. The session user is the internal user: aapplegate@[Link].
b. The endpoint access is defined by [Link].
c. The resource access is defined by internal [Link] using the resource access ID of
aapplegate@[Link].
8. PolicyCenter provides the response to the initial call.
Procedure
1. Navigate to the plugin registry entry for the RestAuthenticationSourceCreatorPlugin plugin.
• For more information on the plugin registry, see Plugins, Prebuilt Integrations, and SOAP APIs.
2. Set the basicAuth parameter to allOff.
3. Restart the server.
To make a Cloud API call for basic authentication, the caller application must:
1. Send the API call using basic authentication.
For more information, see “Sending authenticated calls with basic authentication” on page 260.
In the base configuration, when PolicyCenter receives a call with basic auth information in the header, it queries the
database to verify that the user is a known internal user and that the password matches the user name. If these two
things are true, the internal user is authenticated.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
Procedure
1. Open Postman.
2. Start a new request by clicking the + to the right of the Launchpad tab.
3. Specify an operation and URL as appropriate.
4. To provide authorization using basic authorization:
a) Click the Authorization tab.
b) For the Type drop-down list, select Basic Auth.
c) In the Username field, enter the user name (such as aapplegate).
d) In the Password field, enter the password (such as gw).
5. Click the Send button to the right of the request field.
Results
Every Postman tab has its own authentication information. When you modify the request on an existing tab by
changing the URL or choosing a new operation, you do not need to re-enter the authentication information. But when
you open a new tab, you do need to provide authentication information. If you encounter a NotFoundException, such
as in the following example, this could be caused by not providing correct authentication information.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path /common/v1/activities/cc:20"
Within the context of Cloud API authentication, an internal user is a person who is listed as a user in the PolicyCenter
database. For example, Alice Applegate, a PolicyCenter underwriter, is an internal user. Internal users can use caller
applications and trigger Cloud API calls from that application. For example, suppose there is a location photography
portal that contains pictures of covered buildings taken by a third-party field agent. An underwriter reviews and selects
pictures to be saved to PolicyCenter. This action triggers a Cloud API call by an internal user from a caller application.
This topic describes how to implement Cloud API authentication for internal users using bearer token authentication.
(For information on how to implement authentication for internal users using basic authentication, see “Basic
authentication” on page 255.)
Credentials
An internal user's credentials consist of a user name and password. This information is stored in the IdP.
Before an internal user can make an API call, the caller application sends a request to the appropriate IdP to
authenticate the user. This typically consists of confirming that the provided username and password are correct.
For more information on how to configure the IdP, see “Configuring the IdP” on page 330.
Authorization
Endpoint access for internal users
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
OAuth2 authorization code flow: Internal users 261
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
When an internal user makes a Cloud API call (using either basic authentication or bearer token authentication),
PolicyCenter queries the operational database for this internal user's user roles. The user is given endpoint access to all
API roles whose names corresponds to the names of the user's user roles.
For example, suppose that Alice Applegate is an internal user with two user roles: Underwriter and Reinsurance
Manager. Alice Applegate triggers a system API call. When the API call is received, PolicyCenter queries the database
for Alice's user roles. Two user roles are returned: Underwriter and Reinsurance Manager. PolicyCenter then grants
Alice the endpoint access defined in the API roles named "Underwriter" and "Reinsurance Manager".
For more information on how API roles are configured, see “Endpoint access” on page 333.
Strategy name Persona using this The resource access ID is assumed Grants access to...
strategy to be...
pc_username Internal users A PolicyCenter user name Any information this internal user could see in
PolicyCenter based on their associated Access
Control Lists (ACLs).
When an internal user makes a Cloud API call, the user's user name is included in the JWT. The user name is used as
the resource access ID. The pc_username strategy is used automatically. This strategy consists of Cloud API logic that
matches, as closely as possible, the user's access as defined in the base configuration's Access Control Lists (ACLs).
For more information on how resource access behaves, see “Resource access” on page 345.
For example, the following JWT is for an internal user whose user name is aapplegate. (Information that is not
relevant to Cloud API authorization has been omitted.)
{
"scp": [
"pc_username"
],
"pc_username": "aapplegate"
}
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user The user name of the internal user
1. When Alice triggers an API call, the caller application must first request a JWT from Guidewire Hub. To initiate
the process of getting the JWT, the caller application submits its client ID (00ubx7m33sHP1tsew7b4), the ID of
the IdP (acmeIdP_ID), the application's resource access strategy ([Link]), and additional deployment
information ([Link], [Link], planet_class.prod).
2. Guidewire Hub sends a request to the appropriate IdP to authenticate the user. The IdP authenticates the user and
provides a SAML response with information about the user, such as the user's name (aapplegate@[Link]).
3. Guidewire Hub sends a code to the caller application. The caller application uses this code to request a JWT.
4. Guidewire Hub generates a JWT and sends it to the caller application. This JWT includes the client ID (cid), a
scp token claim which names the resource access strategy (pc_username) and additional deployment
information. The JWT also contains any relevant information Guidewire Hub received in the SAML response,
such as a pc_username token which names the user's resource access ID (aapplegate@[Link]).
5. The caller application sends the API request to PolicyCenter along with the JWT.
6. PolicyCenter extracts the information in the JWT into a token map. Then, the IExpandTokenPlugin plugin calls
any relevant authorization applications to retrieve any relevant additional auth values that must be added to or
modified in the token map. (For internal users, the only use case would be if the user's username was not stored in
the IdP, and therefore not included in the JWT. The plugin could retrieve the user's username from the appropriate
system of record.)
7. PolicyCenter determines the endpoint access.
a. Using the user name in the token map (aapplegate@[Link]), PolicyCenter queries for the user roles that
this user has. One role is returned: Underwriter.
b. Based on the returned role, the [Link] API role file is used to define the endpoint access.
8. Next, PolicyCenter determines the resource access strategy. Based on the resource access strategy value in the
token map (pc_username), it grants resource access as defined in the internal [Link] files. (*
PolicyCenter starts with internal_ext-[Link], but this file references additional [Link] files
whose name starts with "internal".)
9. Proxy user access is not relevant for internal users.
10. PolicyCenter processes the request.
a. The session user is the internal user: aapplegate@[Link].
b. The endpoint access is defined by [Link].
c. The resource access is defined by internal [Link] using the resource access ID of
aapplegate@[Link].
11. PolicyCenter provides the response to the initial call.
To make a Cloud API call for internal users (using bearer token authentication), the caller application must:
1. Request a code from Guidewire Hub
2. Use the code to request a JWT from Guidewire Hub
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
Within the context of system API authentication, an external user is a person who is known to the insurer but who is
not listed as a user in the PolicyCenter database. For PolicyCenter, these are the types of external users:
• Account holders - Insureds who want to interact with information about their accounts and policies. For example,
Ray Newton, who is a policyholder and wants to verify what coverage he has.
This topic describes how to implement Cloud API authentication for external users.
Credentials
An external user's credentials consist of a user name and password. This information is stored in the IdP.
Before an external user can make an API call, the caller application sends a request to the appropriate IdP to
authenticate the user. This typically consists of confirming that the provided username and password are correct.
For more information on how to configure the IdP, see “Configuring the IdP” on page 330.
Authorization
Endpoint access for external users
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
OAuth2 authorization code flow: External users 267
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
When an external user makes a Cloud API call, the call has an associated token map. This consists of information
stored in the JWT that came with the call, as well as any information added to the map by the IExpandTokenPlugin
plugin. The token map includes a list of one or more API roles. The user is given endpoint access to all API roles
whose names correspond the roles listed in the token map. For example, suppose that Ray Newton is a policyholder.
Ray Newton triggers a Cloud API call. The token map identifies the Insured role. Ray Newton is given the endpoint
access defined in the API role named "Insured".
For more information on how API roles are configured, see “Endpoint access” on page 333.
Strategy name Persona using this The resource access ID is assumed to be... Grants access to...
strategy
pc_accountNumbers Account holders An array of account numbers Information associated with the
account
When an external user makes a Cloud API call, PolicyCenter checks for a resource access token claim.
• If the resource access token is pc_accountNumbers, the resource access IDs are treated as a list of account
numbers. The user is given access to all accounts with these numbers.
Cloud API requires that the token map have no more than one resource access strategy token.
• If no resource strategy token is present, the caller is assigned the "default" resource access strategy. This resource
strategy grants access to metadata endpoints only.
• If multiple resource strategy tokens are present, the call is rejected.
For more information on how resource access behaves, see “Resource access” on page 345.
{
"groups" : [
"[Link].Account_Holder"
],
"scp": [
"pc_accountNumbers"
],
"pc_accountNumbers": [
"C000456352",
"C000456377"
]
}
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user The user name of the external user
Some values are used to determine multiple types of access. These values initially appear as black (when they do not
apply to a single type of access), and then later appear in one or more specific colors (to reflect the value is being used
at that point in the process for a specific type of access).
In the following example, an API call is triggered by Ray Newton, who is an external user, using a browser-based
application.
1. When Ray triggers an API call, the caller application must first request a JWT from Guidewire Hub. To initiate
the process of getting the JWT, the caller application submits its client ID (00ubx7m33sHP1tsew7b4), the ID of
the IdP (acmeIdP_ID), the application's resource access strategy (pc_accountNumbers), and additional
deployment information ([Link], [Link], planet_class.prod).
2. Guidewire Hub sends a request to the appropriate IdP to authenticate the user. The IdP authenticates the user and
provides a SAML response with information about the user, such as the user's name (aapplegate@[Link]). If
API roles and/or resource access IDs are stored in the IdP, the SAML response may also include this information
(such as the role [Link].Account_Holder or the resource access ID 464778619).
3. Guidewire Hub sends a code to the caller application. The caller application uses this code to request a JWT.
4. Guidewire Hub generates a JWT and sends it to the caller application. This JWT includes the client ID (cid), a
scp token claim which names the resource access strategy (pc_accountNumbers) and additional deployment
information. The JWT also contains any relevant information Guidewire Hub received in the SAML response,
such as a groups token which names the user's API roles ([Link].Account_Holde), or a
pc_accountNumbers token which names the user's resource access IDs (464778619).
5. The caller application sends the API request to PolicyCenter along with the JWT.
6. PolicyCenter extracts the information in the JWT into a token map. Then, the IExpandTokenPlugin plugin calls
any relevant authorization applications to retrieve any relevant additional auth values that must be added to or
modified in the token map. (For external users, this could include API roles and/or resource access IDs that are
not stored in the IdP.)
7. PolicyCenter determines the endpoint access. Based on the groups listed in the token map
([Link].Account_Holder), the Account_Holder.[Link] API role file is used to define the endpoint
access.
8. Next, PolicyCenter determines the resource access strategy. Based on the resource access strategy value in the
token map (pc_accountNumbers), it grants resource access as defined in the accountholder [Link] files.
(* PolicyCenter starts with accountholder_ext-[Link], but this file references additional
[Link] files whose name starts with "accountholder".)
9. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The token map specified a resource access strategy of
pc_accountNumbers. So, the plugin returns the proxy user for external users: extuser.
10. PolicyCenter processes the request.
a. The session user is the proxy external user: extuser.
b. The endpoint access is defined by Account_Holder.[Link].
c. The resource access is defined by accountholder [Link] using the resource access ID of
464778619.
11. PolicyCenter provides the response to the initial call.
To make a system API call for external users, the caller application must:
1. Request a code from Guidewire Hub
2. Use the code to request a JWT from Guidewire Hub
3. Include the JWT with the system API call
For more information, see “Sending authenticated calls for external users” on page 272.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
Within the context of Cloud API authentication, an anonymous user is a person who is not yet known to the insurer but
who may establish a business relationship with the insurer. Typically, an anonymous user can only create an account
(and its associated objects), quote a submission, and bind a submission. Once an anonymous user binds a submission,
they logically move from being an anonymous user to an external user.
PolicyCenter is the only InsuranceSuite application that supports anonymous users for Cloud API.
This topic describes how to implement Cloud API authentication for anonymous users.
Credentials
By definition, an anonymous user does not initially have any credentials. If the user binds a policy, they logically
become an external user. At this point, the user's user name and password would be stored in the IdP.
For more information on how configuration of the IdP, see “Configuring the IdP” on page 330.
OAuth2 authorization code flow: Anonymous users 273
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Authorization
Endpoint access for anonymous users
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
In the anonymous flow, when the caller makes their first Cloud API call, Cloud API automatically assigns them to the
unauthenticated role. This role gives them access to endpoints for creating an account and its child objects. Once the
account has been created, when the caller makes additional Cloud API calls, Cloud API automatically assigns them to
the anonymous role.
For more information on how API roles are configured, see “Endpoint access” on page 333.
Resource access for anonymous users
Resource access defines, for a given type of resource, which instances of that resources the caller can access. For
example, suppose there is a GET /claims endpoint that is available to policyholders, underwriters, adjusters, and
service vendors. All of these callers can use the endpoint to access resources whose type is claim, but none of the
callers can access all of the claims. For example:
• A policyholder may be able to see only the claims associated with the policies they hold.
• An underwriter may be able to see only the claims for policies assigned to them.
• An adjuster may be able to see only the claims assigned to them.
• A service vendor may be able to see only the claims that have a service request assigned to them.
A resource access strategy is a set of logic that identifies the meaning of a resource access ID. Anonymous users use
the same resource access strategy as that used by external users. The base configuration includes the following resource
access strategies for external users:
Strategy name Persona using this strategy The resource access ID is assumed Grants access to...
to be...
pc_accountNumbers Account holders (including anonymous An array of account numbers Information associated with
users who have created an account) the account
For anonymous users, the pc_accountNumbers strategy is used automatically. Any resource access ID is treated as a
list of account numbers. The user is given access to all accounts with these numbers.
For more information on how resource access behaves, see “Resource access” on page 345.
Proxy user access for anonymous users
When a caller makes a Cloud API call, the internal PolicyCenter logic may trigger checks that are unrelated to endpoint
access or resource access. For example:
• A caller may attempt to assign an activity to themselves. PolicyCenter must check to see if the caller has sufficient
permission to own an activity.
• A caller may attempt to create a collision coverage with a deductible less than $1000. PolicyCenter must check to
see if the amount of the coverage term is within the caller's authority limit.
Anonymous users are not listed in the PolicyCenter operational database, and therefore do not have any system
permissions or authority limits tied to them. To execute these checks, Cloud API makes use of proxy users. A proxy
user is an internal user that is assigned to an external user or service when the API call is made. Whenever internal
PolicyCenter logic must check to see if the caller has sufficient access, the proxy user is checked. Anonymous users are
assigned proxy user access as if they were external users.
For more information on how proxy user access behaves, see “Proxy user access” on page 351.
{
"groups" : [
"[Link]"
],
"scp": [
"pc_accountNumbers"
],
"pc_accountNumbers": [
"C000999111"
]
}
1. The user triggers an API call by creating a new account. The caller application sends the API request to
PolicyCenter. The call includes no JWT, and no authentication information in the header.
2. The IExpandTokenPlugin plugin is not relevant for anonymous users.
3. Because the call has no authentication header, PolicyCenter grants endpoint access as defined in the
[Link] API role file.
4. Because the call has no authentication header, PolicyCenter grants resource access as defined in the
[Link] API role file. (This provides no access to existing business resources.)
5. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The call has no authentication header. So, the plugin returns the
proxy user for unauthenticated users: uauser.
6. PolicyCenter processes the request.
a. The session user is the proxy unauthenticated user: uauser.
b. The endpoint access is defined by [Link]. (This API role provides sufficient
endpoint access to create a new account and the required child objects, such as contacts and locations.)
c. The resource access is defined by [Link].
7. PolicyCenter provides the response to the initial call. The response includes the account number for the newly
created account (464778619) and a self-signed JWT generated by PolicyCenter. The JWT includes the client ID
(cid), a scp token claim which names the resource access strategy (pc_accountNumbers) and additional
deployment information, a groups token which names the user's groups ([Link]), and a
pc_accountNumbers token which names the user's resource access IDs (464778619).
1. The user triggers an API call to complete a previously initiated submission for an existing anonymous user
account. The caller application sends the API request to PolicyCenter using the /recover-new-jobs endpoint as
configured by the insurer. The call includes search criteria configured by the insurer (such as an account number
or user name), but it has no JWT and no authentication information in the header.
2. The IExpandTokenPlugin plugin is not relevant for anonymous users.
3. Because the call has no authentication header, PolicyCenter grants endpoint access as defined in the
[Link] API role file.
4. Because the call has no authentication header, PolicyCenter grants resource access as defined in the
[Link] API role file.
5. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The call has no authentication header. So, the plugin returns the
proxy user for unauthenticated users: uauser.
6. PolicyCenter processes the request.
a. The session user is the proxy unauthenticated user: uauser.
b. The endpoint access is defined by [Link]. (This API role provides sufficient
endpoint access to create a new account and the required child objects, such as contacts and locations, and
to complete a submission.)
c. The resource access is defined by [Link].
7. PolicyCenter provides the response to the initial call. The response includes the unbound submissions that meet
the search criteria provided with the initial call. It also includes a new self-signed JWT generated by
PolicyCenter. As was the case with the first self-signed JWT, this JWT includes the client ID (cid), a scp token
claim which names the resource access strategy (pc_accountNumbers) and additional deployment information, a
groups token which names the user's groups ([Link]), and a pc_accountNumbers token
which names the user's resource access IDs (464778619).
1. The user triggers an API call by attempting to create, modify, or bind a submission. The caller application sends
the API request to PolicyCenter. The call includes the self-signed JWT.
2. The IExpandTokenPlugin plugin is not relevant for anonymous users.
3. PolicyCenter determines the endpoint access. Based on the groups listed in the JWT ([Link]),
the [Link] API role file is used to define the endpoint access.
4. Next, PolicyCenter determines the resource access strategy. Based on the resource access strategy value in the
JWT (pc_accountNumbers), it grants resource access as defined in the [Link] files. (*
PolicyCenter starts with accountholder_ext-[Link], but this file references additional [Link]
files whose name starts with "accountholder".)
5. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The JWT specified a resource access strategy of
pc_accountNumbers. So, the plugin returns the proxy user for external users: extuser.
6. PolicyCenter processes the request.
a. The session user is the proxy external user: extuser.
b. The endpoint access is defined by [Link]. (This API role provides access to actions
appropriate for anonymous users, such as quoting and binding submissions.)
c. The resource access is defined by [Link].
7. PolicyCenter provides the response to the call.
If the anonymous user's policy is bound, then the user becomes "known" to the insurer. At some point in the future, the
user's information is sent to the IdP. Once this occurs, the user will be treated as an external user.
To make a Cloud API call for anonymous users, the caller application must:
1. Create an account as an unauthenticated user, and retain the self-signed JWT that is provided in the response
object
2. Include the self-signed JWT with subsequent system API calls
For more information, see “Sending calls as an anonymous user” on page 284.
For example, suppose there is an unauthenticated user who wants to create an account. The following information is
true about this user:
• Name: Bill Presley
• Primary Address: 1234 Hillsdale Blvd, Foster City, CA, 12345
• Producer: Armstrong and Company (whose public ID is "pc:6")
The caller application can create an account for this user by executing a POST /accounts with the following request
payload:
{
"data": {
"attributes": {
"accountHolder": {
"refid": "newperson"
},
"organizationType": {
"code": "individual"
},
"preferredCoverageCurrency": {
"code": "USD"
},
"preferredSettlementCurrency": {
"code": "USD"
},
"primaryLocation": {
"refid": "newloc"
},
"producerCodes": [
{
"id": "pc:6"
}
]
}
},
"included": {
"AccountContact": [
{
"attributes": {
"contactSubtype": "Person",
"firstName": "Bill",
"lastName": "Presley",
"primaryAddress": {
"addressLine1": "1234 Hillsdale Blvd",
"city": "Foster City",
"postalCode": "12345",
"state": {
"code": "CA"
}
}
},
"method": "post",
"refid": "newperson",
"uri": "/account/v1/accounts/this/contacts"
}
],
"AccountLocation": [
{
"attributes": {
"locationCode": "0001",
"locationName": "Location 0001",
"nonSpecific": true,
"postalCode": "12345",
"state": {
"code": "CA"
}
},
"method": "post",
"refid": "newloc",
"uri": "/account/v1/accounts/this/locations"
}
]
}
}
PolicyCenter creates an account, which in this case is assigned an account number of 2558363138. PolicyCenter also
sends a response object. In the response header, the GW-Access-Token attribute is set to the following:
eyJhbGciOiJIUzUxMiIsImtpZCI6ImN1cnJlbnRfa2V5IiwidHlwIjoiSldUIn0.eyJleHAiOjE1OTU1NjYzNjksImdyb3VwcyI6WyJwYy5hbm9ueW1
vdXMiXSwiaWF0IjoxNTk1NTU1NTY5LCJpc3MiOiJQQyIsImp0aSI6InJCMEVDYVdoOVh1Y2U5M3cyYkFETnVXOUszdkZoUGxuS0FpbVR3NVdFNWNueW
9VM0FBQUFCQS4uIiwicGNfYWNjb3VudE51bWJlcnMiOlsiMjU1ODM2MzEzOCJdLCJzdWIiOiJhdXRoIiwidGVuYW50X2lkIjoiTm9UZW5hbnQiLCJ0e
XBlIjoiYWNjb3VudEhvbGRlciJ9.Ix4GCz4nJg_QM3AsC-jVyZU_V8ysGBgWfvIxAIS59t7EN2C6Pi2QgJRs09y0ThqFX-_1-ucD58Vunqs5dMivJg
{
"exp": 1595566369,
"groups": [
"[Link]"
],
"iat": 1595555569,
"iss": "PC",
"jti": "rB0ECaWh9Xuce93w2bADNuW9K3vFhPlnKAimTw5WE5cnyoU3AAAABA..",
"pc_accountNumbers": [
"2558363138"
],
"sub": "auth",
"tenant_id": "NoTenant",
"type": "accountHolder"
}
{
"data": {
"attributes": {
"firstName_Ext": "Francine",
"lastName_Ext": "Michaels"
}
}
}
Suppose there is one job that matches the search criteria. The response would look like this. For the sake of clarity,
some properties have been omitted.
RESPONSE BODY:
{
"count": 1,
"data": [
{
"attributes": {
"account": {
"displayName": "C000143542",
"id": "pc:Srx-YL_xDmdj455LyQtIu",
"type": "Account",
"uri": "/account/v1/accounts/pc:Srx-YL_xDmdj455LyQtIu"
},
"id": "pc:SVAyPWiBiNuBrYFPjd7ZX",
"jobNumber": "47586734721",
"jobStatus": {
"code": "Quoted",
"name": "Quoted"
},
"jobType": {
"code": "Submission",
"name": "Submission"
},
"policy": {
"displayName": "P000143542",
"id": "pc:SH21ByixaZ0O-2Hteuwc8",
"type": "Policy",
"uri": "/policy/v1/policies/pc:SH21ByixaZ0O-2Hteuwc8"
},
"policyNumber": "P000143542",
"primaryInsured": {
"displayName": "Francine Michaels",
"id": "test_pp:2",
"type": "PolicyContact",
"uri": "/job/v1/jobs/pc:SVAyPWiBiNuBrYFPjd7ZX/contacts/test_pp:2"
}
},
...
RESPONSE HEADER:
GW-Access-Token:
eyJhbGciOiJIUzUxMiIsImtpZCI6ImN1cnJlbnRfa2V5IiwidHlwIjoiSldUIn0.eyJleHAiOjE1OTU1NjYzN
jksImdyb3VwcyI6WyJwYy5hbm9ueW1vdXMiXSwiaWF0IjoxNTk1NTU1NTY5LCJpc3MiOiJQQyIsImp0aSI6In
JCMEVDYVdoOVh1Y2U5M3cyYkFETnVXOUszdkZoUGxuS0FpbVR3NVdFNWNueW9VM0FBQUFCQS4uIiwicGNfYWN
jb3VudE51bWJlcnMiOlsiMjU1ODM2MzEzOCJdLCJzdWIiOiJhdXRoIiwidGVuYW50X2lkIjoiTm9UZW5hbnQi
LCJ0eXBlIjoiYWNjb3VudEhvbGRlciJ9.Ix4GCz4nJg_QM3AsC-jVyZU_V8ysGBgWfvIxAIS59t7EN2C6Pi2Q
gJRs09y0ThqFX-_1-ucD58Vunqs5dMivJg
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
A service is an application that typically executes action without human intervention. Services typically have no user
interface. Examples of services include:
• A billing application that alerts PolicyCenter about a delinquent policy that needs to be canceled.
• An application that uploads pictures of a covered location or vehicle, either when a policy is bound or after a loss
has occurred.
• An external document management system.
This topic discusses how to execute authentication for standalone services.
Standalone service
A service can authenticate as a standalone service. In this case, the service executes the call as itself. It does not
execute the call as a specific person or on behalf of a specific person. The service does not execute the call using a
service account stored in PolicyCenter.
PolicyCenter designates a single internal user as the "proxy service user" for all standalone service calls. This proxy
service user is attached to the standalone service session. If the call creates or modifies an object, the proxy service user
is recorded as the user of record.
The primary advantage to this approach is that you need to manage authentication and authorization information at the
service level only. There is no need to create and manage user accounts, user permissions, or additional mappings.
The primary disadvantage is that all standalone service calls share a single proxy service user. When a standalone
service call creates or modifies an object, it may not be possible to identify which service made the call.
The specified user can be an internal user (a user who is listed in the PolicyCenter database). When this is the case, this
internal user is attached to the session. If the call creates or modifies an object, this internal user is recorded as the user
of record.
The specified user can be an external user (a user who is not listed in the PolicyCenter database). PolicyCenter
designates a single internal user as the "proxy external user" for all service with user context calls that reference
external users. When the specified user is an external user, the external proxy user is attached to the session. If the call
creates or modifies an object, the external proxy user is recorded as the user of record.
The primary advantage to this approach is that a single service can send calls on behalf of different users. At the
service level, you can specify service-level access. But, you can also further control access for each associated user.
There are two primary disadvantages. First, you must maintain access information at two levels: the service level and at
the user level. Second, a service can specify any user in its header. There is no way to restrict a given set of users for
use by a given service.
Standalone service Service with user context Service with service account
mapping
Does the call provide Yes, in the JWT. Yes, in the JWT. Yes, in the JWT.
information about the service?
Does there need to be a user No If the associated user is an internal user, Yes. (This user account is the
account in the PolicyCenter yes. "service account".)
database for the call?
If the associated user is an external
user, no.
Does the call include No Yes, in the GW-User-Context header. No. The call provides a client ID
information about a user or for the service, but the
user account? mapping of client ID to service
account is stored elsewhere.
Which endpoints can the call The endpoints available The endpoints available to both the The endpoints available to the
access? to the service's API roles service's API roles and the user's API service account.
roles.
Which resources can the call All resources (in the The resources available to both the The resources available to the
access? base configuration). service and the user. service account.
What is the session user set to? The proxy service user. If the associated user is an internal user, The service account.
the internal user.
If the associated user is an external
user, the proxy external user.
• For more information on authentication for services with service account mapping, see “OAuth2 client credential
flow: Services with service account mapping” on page 309.
Credentials
When a service makes an API call, the service sends a client ID and secret to Guidewire Hub. Guidewire Hub
authenticates the service by confirming that the client secret is correct. This is true for standalone services, services
with user context, and services with service account mapping.
For more information on how client IDs and secrets are registered with Guidewire Hub, see “Registering the caller
application with Guidewire Hub” on page 332.
Authorization
Endpoint access for standalone services
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
Theoretically, a standalone service can be associated with multiple API roles. Typically, insurers create one API role
for each service and this role is used only by this service.
For a standalone service call, Cloud API checks the API role or roles assigned to the service. The call has access to the
endpoints, operations, and fields specified in those roles. For example, suppose that the ACME External Document
Manager service has the following API role with the following endpoint access:
• acme_externaldocumentmanager
◦ GET /documents
◦ POST /documents
Then, suppose ACME External Document Manager service makes a standalone service call. The call would have
access to GET /documents and POST /documents. But if there was a DELETE /documents endpoint, the call would
not have access to it because it has not been specified in the acme_externaldocumentmanager role.
For more information on how API roles are configured, see “Endpoint access” on page 333.
Strategy name Persona using this strategy The resource access ID is assumed to be... Grants access to...
[Link] Services Not applicable All resources
For more information on how resource access behaves, see “Resource access” on page 345.
"sub": "<clientId>",
"cid": "<clientId>",
"scp": [
"[Link]",
"[Link].<serviceAPIRole>"
]
• sub is the subject of the token. This is set to the service's client ID.
• cid is the client ID of the service. This is also set to the service's client ID.
• The scp token claim has at least the following entries:
{
"sub": "acme_externalbillingapp",
"cid": "acme_externalbillingapp",
"scp": [
"[Link]"
"[Link].acme_externalbillingapp"
]
}
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user An empty string
1. When BillingApp triggers an API call, it must first request a JWT from Guidewire Hub. The request for the JWT
includes the client ID (0oaqt9pl1vZK1kybt0h7), the secret (aSecret), the application's API role
([Link].acme_billingapp), the application's resource access strategy ([Link]), and additional deployment
information ([Link], [Link], planet_class.prod).
2. Guidewire Hub authenticates the services based on the client ID and secret. It also verifies that the API role and
resource access strategy provided in the request match what was specified when the service was registered with
Guidewire Hub.
3. Guidewire Hub generates a JWT and sends it to the service. This JWT includes the client ID (cid) and a scp
token claim which names the API role ([Link].acme_billingapp), the resource access strategy ([Link]),
and additional deployment information.
4. The service sends the API request to PolicyCenter along with the JWT.
5. PolicyCenter extracts the information in the JWT into a token map. Then, the IExpandTokenPlugin plugin calls
any relevant authorization applications to retrieve any relevant additional auth values that must be added to or
modified in the token map. (For standalone services, there is no need for resource access IDs. But, an insurer
could choose to retrieve either the API role (such as [Link].acme_billingapp) or the resource access strategy
name ([Link]) using the IExpandTokenPlugin plugin instead of sending them in the JWT.)
6. PolicyCenter determines the endpoint access. Based on the "[Link]." value listed in the token map
([Link].acme_billingapp), the acme_billingapp.[Link] API role file is used to define the endpoint
access.
7. Next, PolicyCenter determines the resource access strategy. Based on the resource access strategy value in the
token map ([Link]), it grants resource access as defined in the service [Link] files. (* PolicyCenter
starts with service_ext-[Link], but this file references additional [Link] files whose name
starts with "service".)
8. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The token map specified a resource access strategy of [Link].
So, the plugin returns the proxy user for services: serviceuser.
9. PolicyCenter processes the request.
a. The session user is the proxy service user: serviceuser.
b. The endpoint access is defined by acme_billingapp.[Link].
c. The resource access is defined by service [Link]. In the base configuration, the service
[Link] files make all resources available. Therefore, logically speaking, there are no resource access
restrictions.
10. PolicyCenter provides the response to the initial call.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
A service is an application that typically executes action without human intervention. Services typically have no user
interface. Examples of services include:
• A billing application that alerts PolicyCenter about a delinquent policy that needs to be canceled.
• An application that uploads pictures of a covered location or vehicle, either when a policy is bound or after a loss
has occurred.
• An external document management system.
This topic discusses how to execute authentication for services with user context.
Standalone service
A service can authenticate as a standalone service. In this case, the service executes the call as itself. It does not
execute the call as a specific person or on behalf of a specific person. The service does not execute the call using a
service account stored in PolicyCenter.
PolicyCenter designates a single internal user as the "proxy service user" for all standalone service calls. This proxy
service user is attached to the standalone service session. If the call creates or modifies an object, the proxy service user
is recorded as the user of record.
The primary advantage to this approach is that you need to manage authentication and authorization information at the
service level only. There is no need to create and manage user accounts, user permissions, or additional mappings.
The primary disadvantage is that all standalone service calls share a single proxy service user. When a standalone
service call creates or modifies an object, it may not be possible to identify which service made the call.
The specified user can be an internal user (a user who is listed in the PolicyCenter database). When this is the case, this
internal user is attached to the session. If the call creates or modifies an object, this internal user is recorded as the user
of record.
The specified user can be an external user (a user who is not listed in the PolicyCenter database). PolicyCenter
designates a single internal user as the "proxy external user" for all service with user context calls that reference
external users. When the specified user is an external user, the external proxy user is attached to the session. If the call
creates or modifies an object, the external proxy user is recorded as the user of record.
The primary advantage to this approach is that a single service can send calls on behalf of different users. At the
service level, you can specify service-level access. But, you can also further control access for each associated user.
There are two primary disadvantages. First, you must maintain access information at two levels: the service level and at
the user level. Second, a service can specify any user in its header. There is no way to restrict a given set of users for
use by a given service.
Standalone service Service with user context Service with service account
mapping
Does the call provide Yes, in the JWT. Yes, in the JWT. Yes, in the JWT.
information about the service?
Does there need to be a user No If the associated user is an internal user, Yes. (This user account is the
account in the PolicyCenter yes. "service account".)
database for the call?
If the associated user is an external
user, no.
Does the call include No Yes, in the GW-User-Context header. No. The call provides a client ID
information about a user or for the service, but the
user account? mapping of client ID to service
account is stored elsewhere.
Which endpoints can the call The endpoints available The endpoints available to both the The endpoints available to the
access? to the service's API roles service's API roles and the user's API service account.
roles.
Which resources can the call All resources (in the The resources available to both the The resources available to the
access? base configuration). service and the user. service account.
What is the session user set to? The proxy service user. If the associated user is an internal user, The service account.
the internal user.
If the associated user is an external
user, the proxy external user.
• For more information on authentication for services with service account mapping, see “OAuth2 client credential
flow: Services with service account mapping” on page 309.
Credentials
When a service makes an API call, the service sends a client ID and secret to Guidewire Hub. Guidewire Hub
authenticates the service by confirming that the client secret is correct. This is true for standalone services, services
with user context, and services with service account mapping.
When a service authenticates with user context, it provides information about a user. However, there is no
authentication at the user level. Authentication occurs only at the service level.
For more information on how client IDs and secrets are registered with Guidewire Hub, see “Registering the caller
application with Guidewire Hub” on page 332.
Authorization
Endpoint access for services with user context
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
For a service-with-user-context call, Cloud API checks two sets of API roles:
• The API roles assigned to the service
• The API roles assigned to the user
The endpoint access granted to the call is the intersection of the endpoint access granted by these two sets. In other
words, in order to access an endpoint, operation, or field, the access must be granted to at least one API role assigned to
the service and at least one API role assigned to the user account.
For example, suppose that the ACME External Document Manager service has the following API role with the
following endpoint access:
• acme_externaldocumentmanager
◦ GET /documents
◦ POST /documents
And, suppose that Ray Newton has the following API role with the following endpoint access:
• Insured
◦ GET /documents
◦ GET /coverages
Suppose ACME External Document Manager service makes a call as a service with user account using the Ray
Newton user account. The call would have access to GET /documents, as this endpoint has been granted to both the
service and the user account. The call would not have access to either POST /documents or GET /coverages, as
neither of these endpoints have been granted to both the service and the user account.
For more information on how API roles are configured, see “Endpoint access” on page 333.
• If the call triggers an authority limit check, the session user's authority limits are checked.
• There is a small chance the call could trigger logic that must check to see if the caller has a specific domain-level
system permission, such as the permission to own an activity. When this occurs, the session user's system
permissions are checked.
When a service makes a call with a user context, the associated user could be an internal user. An internal user is a
person who is listed as a user in the PolicyCenter operational database. In this case, that internal user is used as the
session user.
When a service makes a call with a user context, the associated user could be an external user. An external user is a
person who is known to the insurer but who is not listed as a user in the PolicyCenter operational database. For
example, this could be a policyholder, vendor, or account holder. When the user context specifies an external user, a
proxy user must be assigned to the session.
A proxy user is an internal user that is assigned to a session for an API call made by an external user or service. Proxy
users are assigned by the RestAuthenticationSourceCreatorPlugin plugin. This plugin specifies four proxy users.
One of them, the proxy external user, is used for calls made either by external users or by services with user context
where the user context specifies an external user.
For more information on proxy users, see “Proxy user access” on page 351.
"sub": "<clientId>",
"cid": "<clientId>",
"scp": [
"[Link]",
"[Link].<serviceAPIRole>",
"[Link]"
]
• sub is the subject of the token. This is set to the service's client ID.
• cid is the client ID of the service. This is also set to the service's client ID.
• The scp token claim has at least the following entries:
◦ The [Link] value, which specifies the caller is a service.
◦ A list of one or more API roles associated with the service. These roles are prefixed with "[Link].".
◦ The [Link] value, which allows the call to specify additional user context in the header. (If the
header contains a GW-User-Context header, then this is treated as a service-with-user-context call and not a
standalone service call).
◦ Must specify the user name, the user roles, and the resource access strategy and resource access IDs
◦ Must be base64-encoded
Note: When using the service with user context flow, you cannot specify the application's unrestricted user as
the user of context. In the base configuration, the unrestricted user is su.
Syntax for the JSON object
The header must be a JSON payload that is formatted as described in the following paragraphs.
For an internal user, the syntax of the GW-User-Context header is:
{
"sub": "<userName>",
"pc_username" : "<userName>"
}
{
"sub": "<userName>",
"groups": [
"<userAPIroleList>"
],
"pc_accountNumbers" : [
"<accountNumbers>"
]
}
{
"sub": "aapplegate@[Link]",
"pc_username" : "aapplegate@[Link]"
}
The header must contain the base64-encoded version of this object, as shown below.
ewogICJzdWIiOiAiYWFwcGxlZ2F0ZUBhY21lLmNvbSIsCiAgInBjX3VzZXJuYW1lIiA6ICJhYXBw
bGVnYXRlQGFjbWUuY29tIgp9
• Key: GW-User-Context
• Value: ewogICJzdWIiOiAiYWFwcGxlZ2F0ZUBhY21lLmNvbSIsCiAgInBjX3VzZXJuYW1lIiA6ICJhYXBw
bGVnYXRlQGFjbWUuY29tIgp9
Note: If a call includes a JWT with the [Link] token claim, but the request object's header does
not contain a user context header, Cloud API treats the call as if it were coming from a standalone service. In
other words, the call will be restricted to the access provided to the service. No user-based restrictions are
applied because there was no user context header specifying a user.
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user If the user in the user context is an internal user, the user name of the internal user.
If the user in the user context is an external user, the sub value from the user context.
1. When BillingApp triggers an API call, it must first request a JWT from Guidewire Hub. The request for the JWT
includes the client ID (0oaqt9pl1vZK1kybt0h7), the secret (aSecret), the application's API role
([Link].acme_billingapp), the application's resource access strategy ([Link]), the fact that the call will
be made for a user ([Link]) and additional deployment information ([Link],
[Link], planet_class.prod).
2. Guidewire Hub authenticates the services based on the client ID and secret. It also verifies that the API role and
resource access strategy provided in the request match what was specified when the service was registered with
Guidewire Hub.
3. Guidewire Hub generates a JWT and sends it to the service. This JWT includes the client ID (cid) and a scp
token claim which names the API role ([Link].acme_billingapp), the resource access strategy ([Link]),
the [Link] value (which indicates that user information is specified in an additional user context
header), and additional deployment information.
4. The service sends the API request to PolicyCenter along with the JWT and a user context header that identifies
the user (aapplegate@[Link]), the user's resource access strategy (pc_username), and resource access ID
(aapplegate@[Link]).
5. PolicyCenter extracts the information in the JWT into a token map. Then, the IExpandTokenPlugin plugin calls
any relevant authorization applications to retrieve any relevant additional auth values that must be added to or
modified in the token map. (The IExpandTokenPlugin plugin can affect only the information that normally comes
in the JWT. It cannot affect information in a user context header. Therefore, for services with user context, an
insurer could choose to retrieve either the service's API role (such as [Link].acme_billingapp) or the service's
resource access strategy name ([Link]) using the IExpandTokenPlugin plugin. But the API roles and
resource access IDs for the user must be in the user context header when the call is sent to PolicyCenter.)
6. PolicyCenter must determine the endpoint access at both the service level and the user level. It starts at the
service level. Based on the API role value in the JWT ([Link].acme_billingapp), the
acme_billingapp.[Link] API role file is used to define the service-level access.
7. Next, PolicyCenter determines the user-level endpoint access.
a. Using the user name in the user context header (aapplegate@[Link]), PolicyCenter queries for the user
roles that this user has. One role is returned: Underwriter.
b. Based on the returned role, the [Link] API role file is used to define the user-level
access.
8. PolicyCenter must also determine the resource access at the service level and the user level. It starts with the
service-level resource access strategy. Based on the resource access strategy value in the JWT ([Link]), it
grants service-level resource access as defined in the service [Link] files. (* PolicyCenter starts with
service_ext-[Link], but this file references additional [Link] files whose name starts with
"service".)
9. PolicyCenter determines the user-level resource access strategy. Based on the resource access strategy value in
the user context header (pc_username), it grants user-level resource access as defined in the internal
[Link] files. (* PolicyCenter starts with internal_ext-[Link], but this file references
additional [Link] files whose name starts with "internal".)
10. Proxy user access is not relevant for services with user context when the user is an internal user.
11. PolicyCenter processes the request.
a. The session user is the internal user: aapplegate@[Link].
b. The endpoint access is the intersection of the endpoints and operations defined granted at the service level
(acme_billingapp.[Link]) and at the user level ([Link]). Endpoints, operations,
and fields must be listed at both levels to be available to the call.
c. The resource access is the intersection of the resources accessible to the service (as defined in the service
[Link]) and the resources available to the user (as defined in the internal [Link] using the
resource access ID of aapplegate@[Link]). In the base configuration, the service [Link] files
make all resources available. Therefore, logically speaking, the service-level resource access does not
specify any restrictions. The call can access any resource provided it is available through the user-level
resource access.
12. PolicyCenter provides the response to the initial call.
1. When BillingApp triggers an API call, it must first request a JWT from Guidewire Hub. The request for the JWT
includes the client ID (0oaqt9pl1vZK1kybt0h7), the secret (aSecret), the application's API role
([Link].acme_billingapp), the application's resource access strategy ([Link]), the fact that the call will
be made for a user ([Link]) and additional deployment information ([Link],
[Link], planet_class.prod).
2. Guidewire Hub authenticate the services based on the client ID and secret. It also verifies that the API role and
resource access strategy provided in the request match what was specified when the service was registered with
Guidewire Hub.
3. Guidewire Hub generates a JWT and sends it to the service. This JWT includes the client ID (cid) and a scp
token claim which names the API role ([Link].acme_billingapp), the resource access strategy ([Link]),
the [Link] value (which indicates that user information is specified in an additional user context
header), and additional deployment information.
4. The service sends the API request to PolicyCenter along with the JWT and a user context header that identifies
the user (rnewton@[Link]), the user's resource access strategy (pc_accountNumbers), and resource access ID
(464778619).
5. PolicyCenter extracts the information in the JWT into a token map. Then, the IExpandTokenPlugin plugin calls
any relevant authorization applications to retrieve any relevant additional auth values that must be added to or
modified in the token map. (The IExpandTokenPlugin plugin can affect only the information that normally comes
in the JWT. It cannot affect information in a user context header. Therefore, for services with user context, an
insurer could choose to retrieve either the service's API role (such as [Link].acme_billingapp) or the service's
resource access strategy name ([Link]) using the IExpandTokenPlugin plugin. But the API roles and
resource access IDs for the user must be in the user context header when the call is sent to PolicyCenter.)
6. PolicyCenter must determine the endpoint access at both the service level and the user level. It starts at the
service level. Based on the API role value in the JWT ([Link].acme_billingapp), the
acme_billingapp.[Link] API role file is used to define the service-level access.
7. Next, PolicyCenter determines the user-level endpoint access. Based on the contents of the groups token claim in
the user context header ([Link].Account_Holder), the Account_Holder.[Link] API role file is used
to define the user-level access.
8. PolicyCenter must also determine the resource access at the service level and the user level. It starts with the
service-level resource access strategy. Based on the resource access strategy value in the JWT ([Link]),
PolicyCenter grants service-level resource access as defined in the service [Link] files. (* PolicyCenter
starts with service_ext-[Link], but this file references additional [Link] files whose name starts
with "service".)
9. Next, PolicyCenter determines the user-level resource access strategy. Based on the resource access strategy
value in the user context header (pc_accountNumbers), it grants user-level resource access as defined in the
accountNumbers [Link] files. (* PolicyCenter starts with accountNumbers_ext-[Link], but
this file references additional [Link] files whose name starts with "accountNumbers".)
10. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The user context header specified a resource access strategy of
pc_accountNumbers. So, the plugin returns the proxy user for external users: extuser.
11. PolicyCenter processes the request.
a. The session user is the proxy external user: extuser.
b. The endpoint access is the intersection of the endpoints and operations defined granted at the service level
(acme_billingapp.[Link]) and at the user level (Account_Holder.[Link]). Endpoints,
operations, and fields must be listed at both levels to be available to the call.
c. The resource access is the intersection of the resources accessible to the service (as defined in the service
[Link]) and the resources available to the user (as defined in the accountNumbers [Link]
using the resource access ID of 464778619). In the base configuration, the service [Link] files
make all resources available. Therefore, logically speaking, the service-level resource access does not
specify any restrictions. The call can access any resource provided it is available through the user-level
resource access.
12. PolicyCenter provides the response to the initial call.
Note: If a call includes a JWT with the [Link] token claim, but the request object's header does
not contain a user context header, Cloud API treats the call as if it were coming from a standalone service. In
other words, the call will be restricted to the access provided to the service. No user-based restrictions are
applied because there was no user context header specifying a user.
◦ Must specify the user name, the user roles, and the resource access strategy and resource access IDs
◦ Must be base64-encoded
Syntax for the JSON object
The header must be a JSON payload that is formatted as described in the following paragraphs.
For an internal user, the syntax of the GW-User-Context header is:
{
"sub": "<userName>",
"pc_username" : "<userName>"
}
{
"sub": "<userName>",
"groups": [
"<userAPIroleList>"
],
"pc_accountNumbers" : [
"<accountNumbers>"
]
}
{
"sub": "aapplegate@[Link]",
"pc_username" : "aapplegate@[Link]"
}
The header must contain the base64-encoded version of this object, as shown below.
ewogICJzdWIiOiAiYWFwcGxlZ2F0ZUBhY21lLmNvbSIsCiAgInBjX3VzZXJuYW1lIiA6ICJhYXBw
bGVnYXRlQGFjbWUuY29tIgp9
• Value: ewogICJzdWIiOiAiYWFwcGxlZ2F0ZUBhY21lLmNvbSIsCiAgInBjX3VzZXJuYW1lIiA6ICJhYXBw
bGVnYXRlQGFjbWUuY29tIgp9
Note: If a call includes a JWT with the [Link] token claim, but the request object's header does
not contain a user context header, Cloud API treats the call as if it were coming from a standalone service. In
other words, the call will be restricted to the access provided to the service. No user-based restrictions are
applied because there was no user context header specifying a user.
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
A service is an application that typically executes action without human intervention. Services typically have no user
interface. Examples of services include:
• A billing application that alerts PolicyCenter about a delinquent policy that needs to be canceled.
• An application that uploads pictures of a covered location or vehicle, either when a policy is bound or after a loss
has occurred.
• An external document management system.
This topic discusses how to execute authentication for services with service account mapping.
Standalone service
A service can authenticate as a standalone service. In this case, the service executes the call as itself. It does not
execute the call as a specific person or on behalf of a specific person. The service does not execute the call using a
service account stored in PolicyCenter.
PolicyCenter designates a single internal user as the "proxy service user" for all standalone service calls. This proxy
service user is attached to the standalone service session. If the call creates or modifies an object, the proxy service user
is recorded as the user of record.
The primary advantage to this approach is that you need to manage authentication and authorization information at the
service level only. There is no need to create and manage user accounts, user permissions, or additional mappings.
The primary disadvantage is that all standalone service calls share a single proxy service user. When a standalone
service call creates or modifies an object, it may not be possible to identify which service made the call.
The specified user can be an internal user (a user who is listed in the PolicyCenter database). When this is the case, this
internal user is attached to the session. If the call creates or modifies an object, this internal user is recorded as the user
of record.
The specified user can be an external user (a user who is not listed in the PolicyCenter database). PolicyCenter
designates a single internal user as the "proxy external user" for all service with user context calls that reference
external users. When the specified user is an external user, the external proxy user is attached to the session. If the call
creates or modifies an object, the external proxy user is recorded as the user of record.
The primary advantage to this approach is that a single service can send calls on behalf of different users. At the
service level, you can specify service-level access. But, you can also further control access for each associated user.
There are two primary disadvantages. First, you must maintain access information at two levels: the service level and at
the user level. Second, a service can specify any user in its header. There is no way to restrict a given set of users for
use by a given service.
Standalone service Service with user context Service with service account
mapping
Does the call provide Yes, in the JWT. Yes, in the JWT. Yes, in the JWT.
information about the service?
Does there need to be a user No If the associated user is an internal user, Yes. (This user account is the
account in the PolicyCenter yes. "service account".)
database for the call?
If the associated user is an external
user, no.
Does the call include No Yes, in the GW-User-Context header. No. The call provides a client ID
information about a user or for the service, but the
user account? mapping of client ID to service
account is stored elsewhere.
Which endpoints can the call The endpoints available The endpoints available to both the The endpoints available to the
access? to the service's API roles service's API roles and the user's API service account.
roles.
Which resources can the call All resources (in the The resources available to both the The resources available to the
access? base configuration). service and the user. service account.
What is the session user set to? The proxy service user. If the associated user is an internal user, The service account.
the internal user.
If the associated user is an external
user, the proxy external user.
This topic focuses on authentication for services with service account mapping.
• For more information on authentication for standalone services, see “OAuth2 client credential flow: Standalone
services” on page 285.
310 OAuth2 client credential flow: Services with service account mapping
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• For more information on authentication for services with user context, see “OAuth2 client credential flow: Services
with user context” on page 293.
Credentials
When a service makes an API call, the service sends a client ID and secret to Guidewire Hub. Guidewire Hub
authenticates the service by confirming that the client secret is correct. This is true for standalone services, services
with user context, and services with service account mapping.
When a service authenticates with service account mapping, the service is mapped to a service account in the
PolicyCenter database. However, there is no authentication at the service account level. Authentication occurs only at
the service level.
For more information on how client IDs and secrets are registered with Guidewire Hub, see “Registering the caller
application with Guidewire Hub” on page 332.
Authorization
Endpoint access for services with service account mapping
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
For a service-with-service-account-mapping call, Cloud API maps the service to a service account in the PolicyCenter
database. Then, PolicyCenter queries the operational database for this service account's user roles. The service is given
endpoint access to all API roles whose names corresponds to the names of the service account's user roles.
For example, suppose that the ACME QuoteAndBind service is mapped to a service account named
"acmeQuoteAndBind". The acmeQuoteAndBind account has two user roles: "ACME Underwriter" and "ACME
Reinsurance Manager". The ACME QuoteAndBind service triggers a Cloud API call. PolicyCenter maps the service to
the acmeQuoteAndBind account and queries the database for the service account's user roles. Two user roles are
returned: "ACME Underwriter" and "ACME Reinsurance Manager". PolicyCenter then gives the service the endpoint
access defined in the API roles named "ACME Underwriter" and "ACME Reinsurance Manager".
For more information on how API roles are configured, see “Endpoint access” on page 333.
OAuth2 client credential flow: Services with service account mapping 311
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• An underwriter may be able to see only the claims for policies assigned to them.
• An adjuster may be able to see only the claims assigned to them.
• A service vendor may be able to see only the claims that have a service request assigned to them.
Resource access is controlled by two features: resource access IDs and resource access strategies.
A resource access ID is a string that defines who the caller is or what the caller owns. Resource access IDs are used to
determine which resources an authenticated caller has access to through API calls.
• A resource access ID can identify who the caller is. For example, the resource access ID for a service provider is
the provider's Address Book ID. Typically, a service provider can access all claims which include this ID in the list
of associated contact IDs.
• A resource access ID can identify what the caller owns. For example, the resource access ID for a policyholder is a
list of one or more policy numbers. Typically, a policyholder can access all policies with those policy numbers.
A resource access strategy is a set of logic that identifies the meaning of a resource access ID. The base configuration
includes the following resource access strategies for service account:
Strategy name Persona using this The resource access ID is assumed Grants access to...
strategy to be...
pc_username Internal users and service A PolicyCenter account name Any information this account could see in
accounts PolicyCenter based on their associated Access
Control Lists (ACLs).
When a service makes a service-with-service-account-mapping call, the service is mapped to a service account name.
This account name is used as the resource access ID, and the pc_username strategy is used. This strategy consists of
Cloud API logic that matches, as closely as possible, the user's access as defined in the base configuration's Access
Control Lists (ACLs).
For more information on how resource access behaves, see “Resource access” on page 345.
"sub": "<clientId>",
"cid": "<clientId>"
• sub is the subject of the token. This is set to the service's client ID.
• cid is the client ID of the service. This is also set to the service's client ID.
For a service-with-service-account-mapping call, the JWT may contain a scp token claim. But, unlike calls from
standalone services or services with user context, there is no authorization information specific to Cloud API in the scp
token claim. All authorization information comes from the service account that the service is mapped to.
312 OAuth2 client credential flow: Services with service account mapping
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
Suppose a call is received from a service with a client ID of "0oaqt9pl1vZK1kybt0h7". This client ID exists in the
service account mapping. Therefore, the call is treated as a service-with-service-account mapping call. The call is
associated with the service account whose user name is acmeDocuments.
Similarly, suppose a call is received from a service with a client ID of "0oa33344455566677788". This client ID does
not exist in the service account mapping. Therefore, the call is treated as either a service-with-user-context call or a
standalone service call.
Every service has a single client ID. Therefore, for a given service, either all calls are treated as service-with-service-
account-mapping calls, or none of the calls are treated as service-with-service-account-mapping calls. If the client ID is
in the service account mapping, it is the former. If not, it is the latter.
Storing service account mapping
Service account mapping can be stored in different locations. For every service call, Cloud API checks all locations.
Cloud API uses the first mapping it finds. So, if a client ID is mapped in multiple places, only the first mapping is used.
If a client ID is not listed in any of these locations, Cloud API treats the call as a either a service-with-user-context call
or a standalone service call.
From a technical perspective, service account mappings can be spread out across all of these locations. However,
insurers may find it easier to manage service account mappings if a single location is used.
Storing service account mapping: Guidewire Cloud Platform
Cloud API checks the Guidewire Cloud Platform (GWCP) variables. Insurers can configure the variables using the
Variables app in Guidewire Home.
Service mapping entries in GWCP variables use the following syntax:
PLUGIN_AUTHENTICATIONVERIFIER_SUBJECTMAPPINGS_<sub>=<username>
where:
• <sub> is the value of the JWT's sub token claim (which is set to the client ID).
• <username> is the user name of the service account.
To deploy changes to GWCP variables, you must restart the server.
Note: When specifying values through the Variables app, the user interface gives you the ability to specify that
a given value applies only to a given Environment. Guidewire recommends using a single set of service account
mapping values for all environments. In other words, when specifying service account mapping values,
Guidewire recommends leaving the Environment field blank.
OAuth2 client credential flow: Services with service account mapping 313
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
plugin.PLUGIN_AUTHENTICATIONVERIFIER_SUBJECTMAPPINGS_<sub>=<username>
where:
• <sub> is the value of the JWT's sub token claim (which is set to the client ID).
• <username> is the user name of the service account.
To deploy changes to the [Link] file, you must restart the server.
Storing service account mapping is [Link] may be appropriate in development instances. But, Guidewire
does not recommend storing service account mapping is [Link] in production instances.
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user The user name of the service account
314 OAuth2 client credential flow: Services with service account mapping
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
1. When FNOLReporter triggers an API call, it must first request a JWT from Guidewire Hub. The request for the
JWT includes the client ID (0oaqt9pl1vZK1kybt0h7), the secret (aSecret), and additional deployment
information ([Link], [Link], planet_class.prod).
2. Guidewire Hub authenticates the services based on the client ID and secret.
OAuth2 client credential flow: Services with service account mapping 315
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
3. Guidewire Hub generates a JWT and sends it to the service. This JWT includes the client ID (cid) and additional
deployment information.
4. The service sends the API request to PolicyCenter along with the JWT.
5. The IExpandTokenPlugin plugin is not relevant for services with service account mapping.
6. PolicyCenter determines the endpoint access.
a. First, PolicyCenter executes a lookup to map the client ID (0oaqt9pl1vZK1kybt0h7) to a service account
name (acmebillingappuser).
b. Then, PolicyCenter queries for the user roles that this account name has. One role is returned:
acme_billingapp.
c. Based on the returned role, the acme_billingapp.[Link] API role file is used to define the endpoint
access.
7. Next, PolicyCenter determines the resource access strategy. Based on the fact that the service account lookup
found a valid service account, PolicyCenter grants resource access as defined in the internal [Link] files.
(* PolicyCenter starts with internal_ext-[Link], but this file references additional [Link]
files whose name starts with "internal".)
8. Proxy user access is not relevant for services with service account mapping.
9. PolicyCenter processes the request.
a. The session user is the service account: acmebillingappuser.
b. The endpoint access is defined by acme_billingapp.[Link].
c. The resource access is defined by internal [Link] using the resource access ID of
acmebillingappuser.
10. PolicyCenter provides the response to the initial call.
316 OAuth2 client credential flow: Services with service account mapping
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
"status": 404,
"errorCode": "[Link]",
"userMessage": "No resource was found at path <path>"
For endpoints that return collections, Cloud API returns all resources that meet the criteria and for which the user has
sufficient resource access. If a resource exists, but the user lacks sufficient authorization, Cloud API omits it from the
results.
These approaches are considered to be more secure as they prevent malicious callers from being able to verify the
existence of data that they are not authorized to access.
OAuth2 client credential flow: Services with service account mapping 317
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
318 OAuth2 client credential flow: Services with service account mapping
chapter 45
Unauthenticated callers
An unauthenticated caller is a user or service who provides no authentication information. Unauthenticated callers can
access only metadata endpoints. Unauthenticated callers are typically callers who need information about Cloud API
endpoints only.
This topic describes how to implement Cloud API authentication for unauthenticated callers.
Note: Anonymous users start out as unauthenticated callers. This topic focuses on unauthenticated callers who
remain unauthenticated and who request Cloud API metadata only. For more information about anonymous
users, see “OAuth2 authorization code flow: Anonymous users” on page 273.
Credentials
By definition, an unauthenticated user has no credentials.
Authorization
Endpoint access for unauthenticated callers
Endpoint access defines the aspects of an endpoint's behaviors that are available to a caller. This includes:
• What endpoints and resource types are available to the caller?
• What operations can a caller call on the available endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
Endpoint access is controlled by API roles. An API role is a list of endpoints, operations, and fields that are available to
a set of callers through API calls. API roles act as allowlists. By default, a caller has no endpoint access. When the
caller is associated with one or more API roles, they gain access to the endpoints, operations, and fields allowlisted in
each of those API roles.
When an unauthenticated caller makes a Cloud API call, Cloud API automatically assigns them the Unauthenticated
role. In the base configuration, this role provides two types of access:
• Access to [Link] endpoints
Unauthenticated callers 319
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• Access to POST to the /accounts, /accounts/*/contacts, and /accounts/*/locations endpoints. This is part
of the authentication flow for anonymous users.
◦ Note that these endpoints must be called in a single POST /accounts call that uses request inclusion for any
contacts and locations. You cannot call the POST /accounts/*/contacts or POST /accounts/*/locations
endpoints on their own.
For more information on how API roles are configured, see “Endpoint access” on page 333.
Strategy name Persona using this strategy The resource access ID is Grants access to...
assumed to be...
default Callers who have presented no Not applicable Metadata resources only (information
resource access strategy returned by the various /[Link]
endpoints)
For more information on how resource access behaves, see “Resource access” on page 345.
Logging
For each call, information about the caller is logged. The following table lists the fields that provide information about
who the caller is, and where the logged value comes from.
Field Value
sub The value of the sub token claim from the JWT
clientId The value of the cid token claim from the JWT
user An empty string
1. The caller application sends the API request to PolicyCenter. The call includes no JWT, and no authentication
information in the header.
2. The IExpandTokenPlugin plugin is not relevant for unauthenticated callers.
3. Because the call has no authentication header, PolicyCenter grants endpoint access as defined in the
[Link] API role file. (This provides access to metadata endpoints. This also provides
access to endpoints that can be used to create a new account. This is part of the anonymous auth flow.)
4. Because the call has no authentication header, PolicyCenter grants resource access as defined in the
[Link] API role file. (This provides no access to existing business resources.)
5. To determine which proxy user to assign to the session, PolicyCenter calls the
RestAuthenticationSourceCreator plugin. The call has no authentication header. So, the plugin returns the
proxy user for unauthenticated users: uauser.
6. PolicyCenter processes the request.
To make a Cloud API call for unauthenticated callers, the caller application does not need to request a code, request a
JWT, or include a JWT with the call. The caller simply provides no authentication information.
Implementing authentication
This section provides information on how to execute each task for the implementation of authentication. This includes:
• How to enable bearer token authentication for a given instance of PolicyCenter
• How to configure endpoint access
• How to configure resource access
• How to configure proxy user access
In the base configuration, InsuranceSuite applications do not make calls to the Cloud API endpoints of other
InsuranceSuite applications. For example, the base configuration of ClaimCenter does not make calls to Cloud API for
PolicyCenter. However, through configuration, an insurer can enable this type of interaction.
To describe this behavior, this documentation uses the following terminology:
• The calling application is the caller application.
• The application whose Cloud API endpoints are being called is the responder application.
• <callerAppCode> and <responderAppCode> are values that represent the two-letter code for the appropriate
application (cc, pc, bc, or ab).
Configuration is needed in both applications to ensure the caller application has the proper authorization.
API role in the responder application
The responder application must have an API role that defines the endpoint access granted to the caller application. This
role must be named gw_<callerAppCode>_ext.
Scopes for the caller application
The caller application is considered to be a standalone service. Guidewire automatically registers it with the following
scopes:
• <responderAppCode>.service
◦ This allows the caller application to use the resource access strategy for services as defined in the responder
application.
• scp.<responderAppCode>.gw_<callerAppCode>_ext
◦ This is used to verify that the caller application can be granted the gw_<callerAppCode>_ext role.
Example
Suppose that you have instances of both ClaimCenter and PolicyCenter. You want ClaimCenter to make calls to Cloud
API for PolicyCenter. To enable this, the following must be true:
• In PolicyCenter, there is an API role named gw_cc_ext. This role is declared in a file whose name is
gw_cc_ext.[Link].
• ClaimCenter is registered with the following scopes:
◦ [Link]
◦ [Link].gw_cc_ext
• When ClaimCenter makes a call to PolicyCenter, the JWT includes this claim:
"scp": [
"[Link]",
"[Link].gw_cc_ext",
<additional tenant, project, and planet values>
]
◦ [Link].gw_bc_ext
◦ [Link].gw_bc_ext
◦ [Link].gw_bc_ext
• Instances of ClaimCenter have the following scopes registered:
◦ [Link]
◦ [Link]
◦ [Link]
◦ [Link].gw_ab_ext
◦ [Link].gw_ab_ext
◦ [Link].gw_ab_ext
However, none of the applications have the corresponding API roles.
To enable cross-application Cloud API calls, you must create one API role in each responder application. The API
role's name must adhere to the scp.<responderAppCode>.gw_<callerAppCode>_ext naming convention. The API
role must also define whatever endpoint access is appropriate for the caller application.
For more information on defining API roles, see “Endpoint access” on page 333.
Insurers must execute several steps to enable bearer token authentication for an instance of PolicyCenter.
1. PolicyCenter must be registered with Guidewire Hub.
2. PolicyCenter must be configured so that it can use asymmetric encryption.
3. PolicyCenter must have its deployment information specified.
4. The IdP must be configured to store and assert information about the users.
• This is required for internal and external users only.
5. Every caller application must be registered with Guidewire Hub.
This topic details all of the tasks that fall into the category of enabling bearer token authentication.
Note: The auth server URI is used by the SignatureKeyProviderPluginV1 plugin. In the base configuration,
the plugin registry reads the value from the PolicyCenter [Link] file. Therefore, these instructions
indicate how to modify the value in the properties file. If you have modified your configuration to read the
value from other locations, then you will need to change the value in those locations as needed.
Procedure
1. In Guidewire Studio, navigate to configuration > config, and open [Link].
2. Add the following line to the file. (Note that this line may already be in the file as a comment. If so, you can
simply uncomment the line.) [Link] =
3. Set the value of the allowedissuers properties to the value of the authServerUri provided to you by
Guidewire.
4. Restart the application.
Note: The IdP is relevant only for the internal user auth flow and external user auth flow. The service auth
flows (standalone service, service with user context, and service with service account mapping) do not make
use of an IdP. When you implement a service flow, there are no IdP requirements.
Procedure
1. Configure your IdP so that every internal user is associated with their user credentials (such as user name and
password).
2. Configure your IdP so that when an internal user is verified, the authorization information is asserted using the
following attribute names:
• User name is asserted as pc_username.
Procedure
1. Configure your IdP so that every external user is associated with their user credentials (such as user name and
password).
2. If you store API roles in the IdP, configure your IdP so that it knows all of the API roles that are assigned to any
external user.
• Typically, this is done with IdP groups.
• Each group name must be prefixed with "gwa.<planetclass>.pc.", where <planetclass> is set to either
"prod", "preprod", or "lower".
• After this prefix, each group name must be identical to a Cloud API role name.
• For example, to assign users to an API role named "Account_Holders" for a production planet, the IdP group
must be named "[Link].Account_Holders".
3. If you store API roles in the IdP, configure your IdP so that every external user is associated with their API roles.
4. If you store resource access IDs in the IdP, configure your IdP so that every external user is associated with the
correct resource access IDs:
• For account holders, this is an array of one or more account numbers.
5. If you store API roles and/or resource access IDs in the IDP, configure your IdP so that when an external user is
verified, the authorization information is asserted using the following attribute names:
• API roles are asserted as an array named groups.
• Resource access IDs for account holders are asserted as an array named pc_accountNumbers.
6. If you do not store either API roles and/or resource access IDs in the IDP, configure your IdP so that when an
external user is verified, the SAML response includes one or more lookup values that the IExpandTokenPlugin
plugin can use to retrieve either API roles and/or resource access IDs from the appropriate additional
authorization application. For more information on configuring the IExpandTokenPlugin plugin, see
“Configuring the IExpandTokenPlugin plugin” on page 355.
Procedure
1. Determine which auth flow the application will use. The auth flow must be one of the following:
• Front end application (auth code flow for internal users and/or external users). If choosing this option, you
must also specify whether you plan to use PKCE or a client secret.
• Standalone service
• Service with user context
• Service with service account mapping
2. Contact Guidewire and specify that you need an "InsuranceSuite REST API registration with Guidewire Hub"
using the desired auth flow.
3. Guidewire sends a list of required information based on the selected auth flow. Provide this information to
Guidewire.
4. Guidewire registers the application for OAuth based on the information provided. They will also send
information to you that you need to further configure authentication, such as a client ID and client secret.
Results
Once you have the authorization information from Guidewire, you can proceed with authentication configuration.
For further information on the difference between auth code flow with PKCE and auth code flow with client secret,
refer to Authentication with Guidewire Identity Federation Hub in the Guidewire Cloud Platform documentation set.
Endpoint access
Endpoint access is defined by API roles. An API role is a list of endpoints, operations, and fields that are available to a
set of callers when triggering Cloud API calls. For example, API roles determine the following:
• What endpoints and resource types are available to the caller?
◦ For example, can a given caller access the /activities endpoint?
• What methods can a caller call on the available endpoint?
◦ For example, can a caller execute both a GET and a POST on the /activities endpoint?
• What fields can the caller specify in a request payload or get in a response payload?
◦ For example, can a caller include the priority field in a POST /activities or retrieve the assignedUser in a
GET /activities?
Note: PolicyCenter includes an "unrestricted user". This user behaves as if it has all permissions. (In the base
configuration, the unrestricted user is su.) The unrestricted user is not bound by endpoint access. Any
authenticated call from the unrestricted user automatically have access to all endpoints.
endpoints:
- endpoint: <endpoint 1>
methods:
- <method 1 on endpoint 1>
- <method 2 on endpoint 1>
- endpoint: <endpoint 2>
methods:
accessibleFields:
<Resource 1>:
edit:
- <fields the grantee can edit on resource 1>
view:
- <fields the grantee can view on resource 1>
<Resource 2>:
edit:
- <fields the grantee can edit on resource 2>
view:
- <fields the grantee can view on resource 2>
Allowlisting resources
Resources can be named in several ways. You can name the resource explicitly. For example, the following specifies
permissions for the Activity resource only:
accessibleFields:
Activity:
edit:
- <fields the grantee can edit on this resource>
view:
- <fields the grantee can view on this resource>
You can also use the "*" wildcard. In this context, it means "all resources available to the endpoints listed in the
endpoints section". For example, the following specifies permissions for all resources available to the role's endpoints:
accessibleFields:
"*":
edit:
- <fields the grantee can edit on this resource>
view:
- <fields the grantee can view on this resource>
Allowlisting fields
For every resource, you can specify two field-level permissions: edit and view. If a permission is not explicitly listed,
then callers will not have that permission for any fields on the resource.
Field-level permissions can be named in several ways. You can explicitly name the field and permission. For example,
the following grants edit access to the Activity resource's subject field , and view access to priority field and the
subject field.
accessibleFields:
Activity:
edit:
- "subject"
view:
- "priority"
- "subject"
You can also use the "*" wildcard. In this context, it means "all fields". For example, the following grants edit access to
the subject field on the Activity resource, and view access to all fields.
accessibleFields:
Activity:
edit:
- "subject"
view:
- "*"
Some resource schemas tag individual fields with a security level of internal, sensitive, or public. When
specifying field permissions, you can use the expression "*<level>" to indicate "all fields on the resource that have
the specified level". For example, the following grants access to fields on the Job resource. The grantee can edit and
view all fields on the Job resource that have a security level of public as well as the jobFilter field (which
presumably does not have a security level of public).
accessibleFields:
Job:
edit:
- "*public"
- jobFilter
view:
- "*public"
- jobFilter
For more information on security levels, see “Security levels” on page 361.
permissions:
- <permissionName>
For example, the following grants the restunmasktaxid permission to the role.
permissions:
- restunmasktaxid
name: Underwriter
endpoints:
- endpoint: /account/v1/accounts
methods:
- GET
- POST
- endpoint: "/account/v1/accounts/*"
methods:
- GET
- PATCH
- endpoint: "/account/v1/accounts/*/activities"
methods:
- GET
- POST
...
accessibleFields:
"*":
view: "*"
edit: "*"
Type of role What does the role For internal users logging For internal users who Where is the role
specify? directly in to PolicyCenter... trigger a Cloud API call... configured?
InsuranceSuite user A set of system This specifies what the user This is used to determine The Roles screen on the
role permissions can do through the which API roles to assign to PolicyCenter Admin tab
PolicyCenter user interface the user
API role A list of accessible Not applicable This specifies the endpoint A set of YAML files in
endpoints, methods, access provided to the user Studio
and fields
If there are multiple matches between the resulting substrings and API role names, the caller is given the union of the
access specified in all matching roles. In other words, the API roles are ANDed together.
application code ("cc", "pc", or "bc"). Then, PolicyCenter queries the operational database for this internal user's user
roles. The user is given endpoint access to all API roles whose names correspond to the names of the user's user roles.
Parsing API role information in the user context header (external users)
When PolicyCenter receives a request with a user context header, it looks for the API roles to grant. If the user context
specifies an external user, PolicyCenter checks the groups token in the user context header. Any value in this token
claim is assumed to be an API role if it starts with "gwa.<planetclass>.<xc>.", where <planetclass> is set to either
"prod", "preprod", or "lower", and where <xc> is the application code ("cc", "pc", or "bc"). For each value,
PolicyCenter does the following:
1. It strips off the prefix "gwa.<planetclass>.<xc>." substring.
2. It converts any blanks in the remaining to string to underscores.
3. It then searches for an API role file with the same name.
Type of role What does the role If the service were to directly For internal users who Where is the role
specify? log in to PolicyCenter... trigger a Cloud API call... configured?
InsuranceSuite user A set of system This specifies what the service This is used to determine The Roles screen on the
role permissions account could do if it were to log which API roles to assign to PolicyCenter Admin tab
in to the PolicyCenter user the service
interface
API role A list of accessible Not applicable This specifies the endpoint A set of YAML files in
endpoints, methods, access provided to the Studio
and fields service
Reserved roles
Cloud API has reserved roles, which are roles used either by Cloud API or by other Guidewire features or services.
Use caution when modifying these roles, as modifications may prevent the relevant Guidewire feature or service from
behaving as expected.
API roles designed for services are typically associated with a single service. This is because each instance of
PolicyCenter interacts with a relatively small number of services and each service has its own access requirements. It is
more efficient to create one role for each service rather than trying to define multiple, reusable roles.
To improve the performance of this lookup, the role names for the default language and US English are now cached by
PLDependencies (RoleNameCache). This cache refreshes:
• Any time a Role is updated.
• After the number of minutes specified by the RoleNameCacheStaleTimeMinutes application configuration
parameter has elapsed.
In the base configuration, RoleNameCacheStaleTimeMinutes is set to 60 minutes. The parameter can have a minimum
value of 1 and a maximum value of 720.
WARNING: Do not change the names for the role files in the previous list, regardless of the language you are
working in. Doing so will cause Cloud API authorization to not work properly.
Resource access
In order to view and edit information from PolicyCenter, a caller needs to be able to access one or more endpoints.
This type of access is known as endpoint access. For example, if a caller has access to the GET /policies endpoint,
that caller can view policies.
However, having access to a given endpoint does not mean a caller can view every resource that endpoint could return.
In some cases, callers can access only certain instances of the relevant resource. For example, the GET /policies
endpoint could be available to a policyholder, an underwriter, and a claims adjuster. But each of these users have access
to a different set of policies:
• The policyholder can see only the policies they hold.
• The underwriter can see only the policies assigned to them.
• The claims adjuster can see only the policies associated with claims assigned to them.
This type of access is known as resource access. Resource access determines which instances of a given resource are
available to a given caller. Resource access is defined by a set of resource access strategies. This topic describes how
resource access strategies are assigned to a caller, how they are executed for each call, and how to interpret the base
configuration files so that you can understand how resource access is executed.
Strategy name Persona using this strategy Resource access Grants access to... More
ID is... information
pc_accountNumbers Account holders (including An account number Resources associated with the
anonymous users who have account, including its jobs and policies
created an account)
pc_username Internal users A PolicyCenter user Resources this internal user could see
name in PolicyCenter based on their
associated Access Control Lists (ACLs).
[Link] Trusted service-to-service Not applicable All resources “The service
application resource access
strategy” on
page 347
default Callers who have been Not applicable Typically just metadata resources only
authenticated but specify no (such as API definitions)
resource access strategy with
the call
unauthenticated Callers who have not been Not applicable API definition metadata and the
authenticated endpoints to create accounts. (The
account endpoints are used by
anonymous users who may want to
quote and potentially bind a policy.)
The JWT identifies which resource access strategy to use by listing the strategy name in the scp token claim. If the
given strategy requires resource access IDs, then the JWT also contains a token claim whose name is the strategy name
and whose contents are the resource access IDs.
For example, suppose that a given call is using the pc_accountNumbers resource access strategy with a resource access
ID of 464778619. The JWT would include the following.
"scp": [
"pc_accountNumbers"
],
"pc_accountNumbers": [
"464778619"
]
WARNING: If you need to configure the base configuration resource access behavior, Guidewire recommends
that you consult the Guidewire Professional Services team before attempting to modify any extension access
files.
An extension access file is an access file that provides a location for extensions to base configuration resource access
strategy behavior. Extension access files either have ext in the name, or are located in a package with ext in the path.
Note: If you need to configure the base configuration resource access behavior, Guidewire recommends that
you consult your Guidewire account manager before attempting to modify any extension access files.
When a resource is named in the plural, the information that follows applies to endpoints that return collections of that
resource type. This includes endpoints whose operations are GET (for a collection) and POST. For collections, there
can be two sections: permissions and filters.
There are different types of access information you can specify for a resource type:
• permissions
◦ Defines actions that the caller can take on accessible resources, such as view and edit
◦ Can be specified for both element and collection resources
• filters
◦ Defines criteria that the resource must meet to be accessible to the caller
◦ Can be specified for collection resources only
Account:
permissions:
view: "[Link].
canAccessAccount([Link]) || [Link]"
freeze: false
purge: false
unfreeze: false
For example, the following specifies permissions for the Job entity. Note that is specifies standard view and edit
permissions as well as a custom business action permission, quote.
Job:
permissions:
view: "[Link]([Link])"
edit: "[Link]([Link])"
...
quote: "[Link]([Link])"
...
WARNING: If you create a new endpoint that executes a custom action, do not name the endpoint with a name
that would conflict with a base permission, such as view, edit, create, or delete. Doing so will result in
unexpected permission behaviors.
If a given permission is not specified in an access file, then the permission defaults to the permission of the resource's
parent. If a given resource does not have a permissions section, then all permissions default to the permission of the
resource's parent.
For more information on writing Gosu expressions that check for system permissions or resource permissions, refer to
the Rules Guide.
In some cases, multiple expressions are listed on several lines, such as the following example. In this case, the
expressions are ANDed together. All expressions must return true for the permission to be granted.
Account:
permissions:
purge:
- "[Link]([Link])"
- "[Link]"
• The keyword __nofilter, which indicates that there is no filter and all resources are accessible.
For example, the following code defines the filters for the Accounts resource (for a collection of accounts) as declared
in the accountholder_core-[Link] file:
Accounts:
filter: [Link]
A proxy user is an internal user account in the PolicyCenter database that is assigned to certain types of Cloud API
calls made by external users or services. If the call records information or executes a permissions check that requires an
internal user account, the proxy user account is used. This type of access is referred to as proxy user access.
Proxy user access is defined by the RestAuthenticationSourceCreatorPlugin plugin and a set of proxy users. This
topic describes how to work with proxy users.
Note: Proxy users do not apply to internal users (using either basic authentication or bearer token
authentication). Proxy users are relevant only for external users, anonymous users, standalone services, services
with external user context, and unauthenticated callers.
Proxy users
When a caller makes a Cloud API call, Cloud API checks to see if the caller has sufficient endpoint access and
resource access. If they do, Cloud API hands processing over to the appropriate internal PolicyCenter logic.
The internal PolicyCenter logic may trigger code that can only be completed using a user account from the pc_user
table. For example:
• The call may create or modify data. When this occurs, PolicyCenter records the name of the CreateUser or
UpdateUser.
• The call may trigger a domain-level permission check.
◦ For example, the call may attempt to assign an activity to the caller. To do this, PolicyCenter must verify that the
caller has sufficient permission to own an activity.)
• The call may trigger an authority limit check.
◦ For example, the call may attempt to create a collision coverage with a deductible less than $1000. PolicyCenter
must check to see if the amount of the coverage term is within the caller's authority limit.
When the caller is an internal user, PolicyCenter uses the internal user account for these types of code.
• The internal user is recorded as the CreateUser or UpdateUser.
• The internal user's user roles are checked for domain-level permissions as needed.
• The internal user's authority limit profiles are checked for authority limit checks as needed.
However, external users and services are not listed in the pc_user table. They cannot be recorded as a CreateUser or
UpdateUser. They also have no system permissions or authority limits assigned to them. So, when a call is made by
someone who is not an internal user, PolicyCenter assigns a proxy user to the call.
Proxy user access 351
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
• If the call creates or modifies data, the proxy user is listed as the CreateUser or UpdateUser.
• If the call triggers a domain-level permissions check, the proxy user's user roles are checked.
• If the call triggers an authority profile check, the proxy user's authority profile limits are checked.
Proxy user type Base configuration user User role UW authority profile
External proxy user extuser External User External User Profile
Service proxy user serviceuser Service User Service User Profile
Unauthenticated proxy user uauser Unauthenticated User Unauthenticated User Profile
Default proxy user defaultuser Default User (none)
To prevent anyone from logging in as one of these users, each of these users is created with a password that makes use
of a character that is not valid Base64 encoding.
You can configure the user roles and authority limit profiles referenced by these users. But, Guidewire recommends
that you do not configure the users themselves.
WARNING: Do not remove the base configuration proxy users from your database. If these proxy users do not
exist, authorization will not behave as expected.
WARNING: Do not modify the settings in the RestAuthenticationSourceCreatorPlugin plugin that identify
the users for each proxy user type. Doing so could make the authorization functionality not behave as expected.
Actions that require a "user of record" can be triggered by Cloud API calls. When the call is triggered by an internal
user, the internal user is noted as the user of record. When the call is triggered by an external user or service, the proxy
user is noted as the user of record.
For more information on configuring API roles, see “Endpoint access” on page 333.
For more information on configuring user roles, see the Application Guide.
In bearer token authentication, the caller presents a JSON Web Token (JWT). The JWT contains a set of claims. Each
claim is a key/value pair that represents information that "the bearer of the token claims to be true". For example, a
JWT could contain the following claim, which asserts the identity of the bearer of the token (in the sub claim, which
identifies the "subject"):
[
"sub": "rnewton@[Link]",
...
]
Cloud API uses information in the JWT to determine the authorization to grant to the caller. This typically involves two
types of information:
• Some information in the JWT identifies the API roles to assign to the caller. This determines the level of endpoint
access the caller has.
• Some information in the JWT identifies the caller's resource access IDs. This determines the level of resource
access the caller has. (In other words, this determines which specific resources that caller can access.)
For example, suppose Ray Newton is an insured making a request to PolicyCenter. The JWT includes the following.
[
"sub": "rnewton@[Link]",
"groups": [
"[Link].Account_Holder"
],
"pc_accountNumbers": [
"C000143542"
],
...
]
The authorization information that is placed into a JWT can come from the IdP. It can also come from the caller
application itself, provided it is a scope value that the caller application has already registered with Guidewire Hub.
Cloud API also supports the ability to add PolicyCenter-specific authorization information after the JWT has been
received but before authorization is determined. This is done by the IExpandTokenPlugin plugin.
For more overview information on JWTs and how the IExpandTokenPlugin plugin interacts with the information flow,
see “Constructing JWTs” on page 239.
The method receives the original token map in the map object, which contains all the key/value pairs from the JWT as
received from the caller.
The method must do the following:
1. Extract any appropriate lookup values from the original token map
2. Call the appropriate system of record to retrieve the relevant additional authorization values
3. Construct a "token expansions" map return value that specifies all claims to add to the original token map, and all
claims already in the original token map that must be replaced
The method cannot return null. If there are no required changes, return an empty map.
The pc_accountNumbers resource access strategy permits one or more resource access IDs set to the caller's policy
numbers. If the caller owns accounts C000123 and C000456, the value added to the expansion map must be:
"pc_accountNumbers": [
"C000123",
"C000456"
]
Performance considerations
This plugin is called during Cloud API authentication. Guidewire recommends that insurers confirm that the SLA with
their authorization system of record is sufficient for such a heavily used case.
Guidewire recommends against adding more than 1000 elements in a List or Array that is the value for a key. Such a
large number of entries can result in performance issues when GenericCenter passes queries to the database that
contain filtering logic with more than 1000 values.
After the plugin has been called, the original token map would look like this:
"sub": "kegerston@[Link]",
"scp": [
"cc_producerCodes",
"[Link]",
"[Link]",
"planet_class.prod"
],
"groups": [
"[Link]"
],
"cc_producerCodes": [
"100-002541",
"100-002542",
"100-002543"
]
Example implementation
The following is an example of a complete implementation class for the IExpandtokenPlugin plugin that adds the
producer codes discussed in the previous example.
package [Link]
uses [Link]
uses [Link]
@Nonnull
override function getTokenExpansions(map : Map<String, Object>) : Map<String, Object> {
return dgcMap
}
}
Procedure
1. In Studio, navigate to config > plugins > registry.
2. Right-click the registry node and select New > plugin.
Security levels
API roles specify the resources that callers can access, and the properties on those resources that callers can view or
edit. In an API role file, you can explicitly list each property and its view and edit access. However, there may be some
situations where it is easier to grant access to a set of properties without explicitly naming all of them. In these
situations, you can use security levels.
Security level is a property-level attribute that can be used by API roles to grant view or edit permissions to a set of
properties. API roles can grant view or edit permissions using the "*level" expression, which means "grant the
permission to all properties on this resource with the security level of level."
There are three security levels: internal, sensitive, and public. These levels are not hierarchical. Granting access to a
specific security level does not inherently include any other security levels. Also, there is no inherent meaning tied to
them. They are arbitrary labels that you can use in whatever way is most appropriate.
"User": {
"properties": {
"firstName": {
...
},
"homePhone": {
...
"securityLevel": "internal"
}
},
The homePhone property has a security level of internal. The firstName property has no defined security level, and
therefore defaults to a security level of public.
For example, the following grants access to fields on the User resource. The grantee can edit and view all properties on
the User resource that have a security level of public as well as the workPhone property (which presumably is not a
Security levels 361
Guidewire PolicyCenter for Guidewire Cloud 2024.07 Cloud API Developer Guide
public field). (Based on the previous code snippet, the grantee would be able to view and edit firstName and
workPhone, but not homePhone.)
accessibleFields:
User:
edit:
- "*public"
- workPhone
view:
- "*public"
- workPhone
User:
edit:
- ["*public", "*sensitive"]
If the view or edit section of a resource lists both explicit properties and a "*level" expression, the grantee has access
to all explicitly listed properties and all properties with the given security level.
For example, the following grants edit access to all properties on the User resource that are public as well as the
workPhone property:
User:
edit:
- "*public"
- workPhone
An anonymous user can create an account and start a submission, but not bind the submission within the same session.
This could happen because:
• The original session expired (the user left the session with the intent to finish the work later).
• The user switched to a different device.
When an anonymous user wants to return and complete a submission, they must first find the incomplete submission,
and then obtain a new self-signed JWT to authenticate with PolicyCenter. The POST /job/v1/recover-new-jobs
endpoint is designed for this use case.
• The request body contains search criteria that Cloud API can use to identify incomplete submissions associated
with the anonymous account.
• The response contains the incomplete submissions matching those criteria along with a new self-signed JWT.
With the response, the third-party application can identify which submission the anonymous user wishes to complete,
and it can use the self-signed JWT to start a new session.
The implicit criteria consist of criteria that are automatically applied to all /recover-new-jobs searches. This criteria
cannot be configured. The implicit criteria are:
• The job type must be Submission.
• The job status must be Draft or Quoted.
• The account cannot have any bound jobs associated with it.
• The criteria cannot match submissions from multiple accounts. (If it does, the endpoint returns 0 results.)
Risk assessment
By design, the /recover-new-jobs endpoint returns account and job information to an anonymous user. For any
endpoint of this nature, there is a risk that personal information could be returned to a caller who is not authorized to
access that information.
Guidewire recommends that insurers execute a sufficiently rigorous amount of testing and evaluation to ensure that the
search criteria and query logic that they configure will not result in returning unintended personal information to an
unauthorized caller.
◦ Meet the implicit criteria for new job recovery (such as the job is an unbound submission)
◦ Has an exact match with all values submitted
Note that, as this is a sample implementation, none of the properties are required. This includes First Name and Last
Name, each of which can be specified without specifying the other.
WARNING: This implementation has not gone through any risk assessment. Guidewire does not recommend
using this example in a production environment, as it may expose secure data and it may not have acceptable
performance. Guidewire recommends that insurers implement their own search logic and that they ensure their
implementation is secure and has sufficient performance.
uses [Link]
@Export
class RecoverNewJobsWrapperExt extends RecoverNewJobsWrapper {
}
To enable new job recovery, define the required search criteria in this class.
package [Link]
uses [Link]
/*
This class has recovery extension properties used for the Recover New Jobs endpoint. These recovery properties are
examples only and have not gone through Risk Acceptance.
*/
@Export
class RecoverNewJobsWrapperExt extends RecoverNewJobsWrapper {
var _accountNumber : String as AccountNumber
var _firstName : String as FirstName
var _jobNumber : String as JobNumber
var _lastName : String as LastName
var _postalCode : String as PostalCode
}
The class has a single getter named RecoverNewJobsWrapper. In the base configuration, it simply returns a new
RecoverNewJobsWrapperExt instance. The base configuration version looks similar to this:
package [Link]
uses [Link]
uses [Link]
@Export
class RecoverNewJobsExtResource extends RecoverNewJobsCoreResource {
To enable new job recovery, add a method override to the class that overrides the populateRecoverNewJobsQuery
method. The new method must return a PolicyPeriod query that specifies whatever query restrictions are required
based on the search criteria properties. The following is a high-level syntax statement for the method.
return <some_value_of_type_IQueryBeanResult<PolicyPeriod>_>
}
For more information on writing Gosu queries, see the Gosu Reference Guide. You can also refer to the
makeQueryBuilderForNormalSearches method in the [Link] for more example properties.
package [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
uses [Link]
@Export
class RecoverNewJobsExtResource extends RecoverNewJobsCoreResource {
if ((recoverNewJobsWrapper as RecoverNewJobsWrapperExt).[Link]) {
[Link](false)
}
// Limit the query to match First Name, Last Name, and Postal Code only
for contacts whose role on the policy the primary insured
var policyContactRoleQueryBuilder = new PolicyContactRoleQueryBuilder()
.withSubtype(TC_POLICYPRINAMEDINSURED)
.withContactDenorm(contactQueryBuilder)
[Link](policyContactRoleQueryBuilder)
{
"$schema": "[Link]
"x-gw-combine": [
"[Link].v1.policyperiod_content-1.0",
"[Link].v1.common_ext-1.0"
],
"definitions": {
"RecoverNewJobsRequestAttributes": {
"title": "Recover new jobs request attributes",
"description": "Recovery properties used to recover new non-complete jobs for an unauthenticated user",
"type": "object",
"x-gw-sinceVersion": "1.6.0",
"properties": {
"accountNumber_Ext": {
"title": "Account number",
"description": "The `accountNumber` of the account",
"type": "string"
},
"firstName_Ext": {
"title": "First name",
"description": "The `firstName` of the account's `accountHolder`",
"type": "string"
},
"jobNumber_Ext": {
"title": "Job number",
"description": "The number of the job",
"type": "string"
},
"lastName_Ext": {
"title": "Last name",
{
"schemaName": "[Link].v1.policyperiod_ext-1.0",
"combine": [
"[Link].v1.policyperiod_content-1.0",
"[Link].v1.common_ext-1.0"
],
"mappers": {
// Added to suppress "no mappers" warnings
"RecoverNewJobsRequestAttributes": {
"schemaDefinition": "RecoverNewJobsRequestAttributes",
"root": "[Link]",
"properties": {
"accountNumber_Ext": {
"path": "null as String"
},
"firstName_Ext": {
"path": "null as String"
},
"jobNumber_Ext": {
"path": "null as String"
},
"lastName_Ext": {
"path": "null as String"
},
"postalCode_Ext": {
"path": "null as String"
}
}
}
}
}
{
"schemaName": "[Link].v1.policyperiod_ext-1.0",
"combine": [
"[Link].v1.policyperiod_content-1.0",
"[Link].v1.common_ext-1.0"
],
"updaters": {
"RecoverNewJobsRequestAttributes": {
"schemaDefinition": "RecoverNewJobsRequestAttributes",
"root": "[Link]",
"properties": {
"accountNumber_Ext": {
"path": "[Link]"
},
"firstName_Ext": {
"path": "[Link]"
},
"jobNumber_Ext": {
"path": "[Link]"
},
"lastName_Ext": {
"path": "[Link]"
},
"postalCode_Ext": {
"path": "[Link]"
}
}
}
}
}
{
"data": {
"attributes": {
"firstName_Ext": "Francine",
"lastName_Ext": "Michaels"
}
}
}
Suppose there is one job that matches the search criteria. The response would look like this. For the sake of clarity,
some properties have been omitted.
RESPONSE BODY:
{
"count": 1,
"data": [
{
"attributes": {
"account": {
"displayName": "C000143542",
"id": "pc:Srx-YL_xDmdj455LyQtIu",
"type": "Account",
"uri": "/account/v1/accounts/pc:Srx-YL_xDmdj455LyQtIu"
},
"id": "pc:SVAyPWiBiNuBrYFPjd7ZX",
"jobNumber": "47586734721",
"jobStatus": {
"code": "Quoted",
"name": "Quoted"
},
"jobType": {
"code": "Submission",
"name": "Submission"
},
"policy": {
"displayName": "P000143542",
"id": "pc:SH21ByixaZ0O-2Hteuwc8",
"type": "Policy",
"uri": "/policy/v1/policies/pc:SH21ByixaZ0O-2Hteuwc8"
},
"policyNumber": "P000143542",
"primaryInsured": {
"displayName": "Francine Michaels",
"id": "test_pp:2",
"type": "PolicyContact",
"uri": "/job/v1/jobs/pc:SVAyPWiBiNuBrYFPjd7ZX/contacts/test_pp:2"
}
},
...
RESPONSE HEADER:
GW-Access-Token:
eyJhbGciOiJIUzUxMiIsImtpZCI6ImN1cnJlbnRfa2V5IiwidHlwIjoiSldUIn0.eyJleHAiOjE1OTU1NjYzN
jksImdyb3VwcyI6WyJwYy5hbm9ueW1vdXMiXSwiaWF0IjoxNTk1NTU1NTY5LCJpc3MiOiJQQyIsImp0aSI6In
JCMEVDYVdoOVh1Y2U5M3cyYkFETnVXOUszdkZoUGxuS0FpbVR3NVdFNWNueW9VM0FBQUFCQS4uIiwicGNfYWN
jb3VudE51bWJlcnMiOlsiMjU1ODM2MzEzOCJdLCJzdWIiOiJhdXRoIiwidGVuYW50X2lkIjoiTm9UZW5hbnQi
LCJ0eXBlIjoiYWNjb3VudEhvbGRlciJ9.Ix4GCz4nJg_QM3AsC-jVyZU_V8ysGBgWfvIxAIS59t7EN2C6Pi2Q
gJRs09y0ThqFX-_1-ucD58Vunqs5dMivJg
When you encounter an auth issue, the single most effective action you can take to troubleshoot the issue is to set the
[Link] and [Link] loggers to DEBUG, reproduce the error, and then check the application log for the
resulting error messages. Most auth issues trigger log messages that identify the source of the problem.
Be aware of the following:
• In a standalone instance of PolicyCenter, there is only one log. By default, it is located in /tmp/gwlogs/
GenericCenter/logs. In a Cloud or multiclustered instance, there may be multiple logs.
• Some messages are written to the log only when the [Link] and [Link] loggers are set to DEBUG.
When troubleshooting auth issues, Guidewire recommends setting these loggers to DEBUG.
For more information on how to configure general PolicyCenter logging, refer to the Server Tools section of the
Administration Guide.
For more information on enabling asymmetric encryption, see “Enabling asymmetric encryption” on page 329.
Cloud API writes a log message for each check it performs to see if paths and operations are accessible. The log
message lists the roles that have been checked and whether the roles grant access. For example, suppose a caller
attempts to access GET /claims/{claimId}/exposures. Also, suppose the caller has two roles, "Adjuster" and
"Trusted for Sensitive Claims", but neither role grants access to this endpoint. When the call fails, Cloud API writes the
following to the log.
When trying to track down "no <action> permission" errors, it may be helpful to search for the error messages
containing the string Roles grant access: false.
Note that the error message says Roles acquired from: token. This means that the roles were retrieved using
information from the JWT, but the roles may not have been explicitly listed on the JWT. For internal users, roles come
from a database query to the cc_user, pc_user, or bc_user table using information in the JWT. For external users,
roles could come from the JWT or from information retrieved by the IExpandTokenPlugin.
For more information on endpoint access, see “Endpoint access” on page 333.
ContactManager authentication
This section provides information on how ContactManager authentication differs from PolicyCenter authentication.
ContactManager authentication
Authentication for Cloud API for ContactManager is nearly identical to authentication for Cloud API for PolicyCenter.
This topic identifies the differences between the two. If a topic is not explicitly discussed here, you can assume that it
behaves in the same way for the two applications.