Attributes

You can use the Cloud API to create custom user attributes to provide additional information about users. PolicyCenter can then use these attributes to determine how to assign users to work. For example, you can create a custom attribute called 'Spanish', of the language type, to indicate a user's level of Spanish fluency. PolicyCenter can then use this attribute to assign work to users with the attribute. To learn more about attributes, refer to .

These custom attributes are found in the UserAttributeType.ttx typelist, accessible through Guidewire Studio. In the base configuration, the typelist contains the typecodes default, account, expertise, language, and LOB. You can extend this typelist in Studio.

This topic provides a high-level overview of attributes, discussing both what they are and how to work with them through the Cloud API. Read this topic to learn how to create and modify attributes so administrators can apply these attributes to users, providing additional information about the users and how they can be useful.

Querying for attributes

Use the following endpoints to query for attributes:

  • GET /admin/v1/attributes
  • GET /admin/v1/attributes/{attributeId}

The first endpoint retrieves a collection of attributes and their details. For example, the following request retrieves all the available attributes in your system.

Command

GET /admin/v1/attributes

Response


{
    "count": 2,
    "data": [
        {
            "attributes": {
                "description": "Auto Expertise",
                "id": "xc:S2b-p7gTyL5RU-aF33kWg",
                "name": "Auto-Expertise",
                "type": {
                    "code": "expertise",
                    "name": "Expertise"
                }
            }
        },
        {
            "attributes": {
                "description": "Spanish Fluency",
                "id": "xc:SPhpXiegc0R8SqTsSrL4y",
                "name": "Spanish",
                "type": {
                    "code": "language",
                    "name": "Language"
                }
            }
        }
    ]
}

You can use an attribute's id from the response to retrieve that specific attribute. For example, the following request retrieves information about the attribute xc:SPhpXiegc0R8SqTsSrL4y.

Command

GET /admin/v1/xc:SPhpXiegc0R8SqTsSrL4y

Response


{
    "data": {
        "attributes": {
            "description": "Spanish Fluency",
            "id": "xc:SPhpXiegc0R8SqTsSrL4y",
            "name": "Spanish",
            "type": {
                "code": "language",
                "name": "Language"
         }
     }
}

Creating attributes

Use the following endpoint to create an attribute.

  • POST /admin/v1/attributes

The only required fields are the attribute name and type/code (the description is optional). For example, the following request creates an attribute for French fluency.

Note: The code within type is a string that represents a TypeKey defined in the UserAttributeType typelist of available code, so you can only use a value enumerated in that list. In the base configuration of PolicyCenter, this typelist contains default, expertise, language, account, and LOB. You can access and extend this typelist in Guidewire Studio. To learn more about attributes, refer to .

Command

POST /admin/v1/attributes

Request


{
    "data": {
        "attributes": {
            "name": "French",
            "type": {
                "code": "language"
            }
        }
    }
}

Response


{
    "data": {
        "attributes": {
            "id": "xc:Sk15XVYWTjBDfXB9wrfOV",
            "name": "French",
            "type": {
                "code": "language",
                "name": "Language"
    }
}

Modifying attributes

Use the following endpoint to modify an existing attribute:
  • PATCH /admin/v1/attributes/{attributeId}

You can modify the following fields:

  • description
  • name
  • type/code
Note: The code within type is a String that represents a TypeKey defined in the UserAttributeType typelist of available codes, so you can only use a value enumerated in that list. In the base configuration of PolicyCenter, this typelist contains default, expertise, language, account, and LOB. You can access and extend this typelist in Guidewire Studio. To learn more about attributes, refer to .

For example, the following request modifies the code for the existing attribute xc:S28_4MXQ4eF4rPt259n9z.

Command

PATCH /admin/v1/attributes/xc:S28_4MXQ4eF4rPt259n9z

Request


{
    "data": {
        "attributes": {
            "type": {
                "code": "expertise"
            }
        }
    }
}

The API responds with the updated attribute.

Response


{
    "data": {
        "attributes": {
                "description": "Auto Expertise",
                "id": "xc:S28_4MXQ4eF4rPt259n9z",
                "name": "Auto-Expertise",
                "type": {
                    "code": "expertise",
                    "name": "Expertise"
            }
        }
    }
}        

Deleting attributes

Use the following endpoint to delete attributes:

  • DELETE /admin/v1/attributes/{attributeId}

For example, the following request deletes the attribute xc:SfeDAefI5coDfBSGUd2xt .

Command

DELETE admin/v1/attributes/xc:SfeDAefI5coDfBSGUd2xt

When the API has successfully deleted the attribute, it will return an empty body in response.