Attributes

You can use the Cloud API to create custom user attributes and apply them to users in BillingCenter, providing additional information about users. For example, you can create a custom attribute called 'Spanish', of the default type, to indicate a user's level of Spanish fluency. BillingCenter can then use this attribute to assign work to users with the attribute. You cannot create or manage custom user attributes from the BillingCenter UI itself, so to learn more about attributes, refer to in ClaimCenter.

These custom attributes are found in the UserAttributeType.ttx typelist, accessible through Guidewire Studio. In the base configuration, the typelist only contains the typecode default. 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": "default",
                    "name": "Default"
                }
            }
        },
        {
            "attributes": {
                "description": "Spanish Fluency",
                "id": "xc:SPhpXiegc0R8SqTsSrL4y",
                "name": "Spanish",
                "type": {
                    "code": "default",
                    "name": "Default"
                }
            }
        }
    ]
}

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": "default",
                "name": "Default"
         }
     }
}

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 BillingCenter, this typelist only contains default. You can access and extend this typelist in Guidewire Studio. You cannot manage attributes in the BillingCenter application, but you can manage them with the API. To learn more about attributes, refer to in ClaimCenter.

Command

POST /admin/v1/attributes

Request


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

Response


{
    "data": {
        "attributes": {
            "id": "xc:Sk15XVYWTjBDfXB9wrfOV",
            "name": "French",
            "type": {
                "code": "default",
                "name": "Default"
    }
}

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 BillingCenter, this typelist only contains default. You can access and extend this typelist in Guidewire Studio. You cannot manage attributes in the BillingCenter application, but you can manage them with the API. To learn more about attributes, refer to in ClaimCenter.

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": "default",
                    "name": "Default"
            }
        }
    }
}        

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.