Attributes

Create custom attribute

[!note] Management API endpoints are not meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Create a custom attribute in this account. Custom attributes allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on.

These attributes can then be given values when creating/updating these entities, and these values can be used in your campaign rules.

For example, you could define a zipCode field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes.

These attributes are shared across all Applications in your account and are never required.

post/v1/attributes

Request

Request body

entity'Application' | 'Campaign' | 'CustomerProfile' | 'CustomerSession' | 'CartItem' | 'Coupon' | 'Event' | 'Giveaway' | 'LoyaltyCard' | 'Referral' | 'Store' required

The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an attributes object with keys corresponding to the name of the custom attributes for that type.

eventTypestring
namestring required

The attribute name that will be used in API requests and Talang. E.g. if name == "region" then you would set the region attribute by including an attributes.region property in your request payload.

titlestring required

The human-readable name for the attribute that will be shown in the Campaign Manager. Like name, the combination of entity and title must also be unique.

type'string' | 'number' | 'boolean' | 'time' | '(list string)' | '(list number)' | '(list time)' | 'location' | '(list location)' required

The data type of the attribute, a time attribute must be sent as a string that conforms to the RFC3339 timestamp format.

descriptionstring required

A description of this attribute.

suggestionsstring[] required

A list of suggestions for the attribute.

hasAllowedListboolean

Whether or not this attribute has an allowed list of values associated with it.

restrictedBySuggestionsboolean

Whether or not this attribute's value is restricted by suggestions (suggestions property) or by an allowed list of value (hasAllowedList property).

editableboolean required

Whether or not this attribute can be edited.

subscribedApplicationsIdsinteger[]

A list of the IDs of the applications where this attribute is available.

subscribedCatalogsIdsinteger[]

A list of the IDs of the catalogs where this attribute is available.

allowedSubscriptionsstring[]

A list of allowed subscription types for this attribute.

Note: This only applies to attributes associated with the CartItem entity.

Example request

{
  "entity": "Event",
  "eventType": "pageViewed",
  "name": "pageViewed",
  "title": "Page view event",
  "type": "string",
  "description": "Event triggered when a customer displays a page.",
  "editable": true,
  "subscribedApplicationsIds": [
    1,
    4,
    9
  ],
  "subscribedCatalogsIds": [
    2,
    5
  ],
  "allowedSubscriptions": [
    "application",
    "catalog"
  ]
}

Response

Created

idinteger required

The internal ID of this entity.

createdstring date-time required

The time this entity was created.

accountIdinteger required

The ID of the account that owns this entity.

entity'Application' | 'Campaign' | 'CustomerProfile' | 'CustomerSession' | 'CartItem' | 'Coupon' | 'Event' | 'Giveaway' | 'LoyaltyCard' | 'Referral' | 'Store' required

The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an attributes object with keys corresponding to the name of the custom attributes for that type.

eventTypestring
namestring required

The attribute name that will be used in API requests and Talang. E.g. if name == "region" then you would set the region attribute by including an attributes.region property in your request payload.

titlestring required

The human-readable name for the attribute that will be shown in the Campaign Manager. Like name, the combination of entity and title must also be unique.

type'string' | 'number' | 'boolean' | 'time' | '(list string)' | '(list number)' | '(list time)' | 'location' | '(list location)' required

The data type of the attribute, a time attribute must be sent as a string that conforms to the RFC3339 timestamp format.

descriptionstring required

A description of this attribute.

suggestionsstring[] required

A list of suggestions for the attribute.

hasAllowedListboolean

Whether or not this attribute has an allowed list of values associated with it.

restrictedBySuggestionsboolean

Whether or not this attribute's value is restricted by suggestions (suggestions property) or by an allowed list of value (hasAllowedList property).

editableboolean required

Whether or not this attribute can be edited.

subscribedApplicationsIdsinteger[]

A list of the IDs of the applications where this attribute is available.

subscribedCatalogsIdsinteger[]

A list of the IDs of the catalogs where this attribute is available.

allowedSubscriptionsstring[]

A list of allowed subscription types for this attribute.

Note: This only applies to attributes associated with the CartItem entity.

eventTypeIdinteger

Example response

{
  "id": 6,
  "created": "2020-06-10T09:05:27.993483Z",
  "accountId": 3886,
  "entity": "Event",
  "eventType": "pageViewed",
  "name": "pageViewed",
  "title": "Page view event",
  "type": "string",
  "description": "Event triggered when a customer displays a page.",
  "editable": true,
  "subscribedApplicationsIds": [
    1,
    4,
    9
  ],
  "subscribedCatalogsIds": [
    2,
    5
  ],
  "allowedSubscriptions": [
    "application",
    "catalog"
  ],
  "eventTypeId": 22
}

Changes

No recorded changes to this operation across all 2 revisions of this API.