Dynamic Content Item Variants
Dynamic content item variants are locale-specific versions of a dynamic content item. To learn more, see Dynamic Content Items.
JSON format
Dynamic Content Item Variants are represented as JSON objects with the following properties:
| Name | Type | Read-only | Mandatory | Description |
|---|---|---|---|---|
| active | boolean | false | false | If the variant is active and usable |
| content | string | false | true | The content of the variant |
| created_at | string | true | false | When the variant was created |
| default | boolean | false | false | If the variant is the default for the item it belongs to |
| id | integer | true | false | Automatically assigned when the variant is created |
| locale_id | integer | false | true | An active locale |
| outdated | boolean | true | false | If the variant is outdated |
| updated_at | string | true | false | When the variant was last updated |
| url | string | true | false | The API url of the variant |
A few items are worth noting:
-
locale_id- Must be an active locale in the account. To get a list, see /api/v2/locales -
default- Used as the fallback if Zendesk Support can't find an appropriate variant to match the locale of the user the content is being displayed for -
outdated- Indicates the default variant for this item has been updated, but the other variants were not changed. The content may be out of date -
active- If false, Zendesk Support will not use the variant even if the user's locale matches the variant
Example
{"active": true,"content": "This is my dynamic content in English","created_at": "2014-04-09T19:53:23Z","default": true,"id": 23,"locale_id": 125,"outdated": false,"updated_at": "2014-04-09T19:53:23Z","url": "https://subdomain.zendesk.com/api/v2/dynamic_content/items/3/variants/23"}
List Variants
GET /api/v2/dynamic_content/items/{dynamic_content_item_id}/variants
Returns all the variants of the specified dynamic content item.
Allowed For
- Admins
- Agents who have permission to manage dynamic content
Pagination
- Cursor pagination
See Pagination.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| page | Query | false | Pagination parameter. Supports both traditional offset and cursor-based pagination: - Traditional: ?page=2 (integer page number) - Cursor: ?page[size]=50&page[after]=cursor (deepObject with size, after, before) These are mutually exclusive - use one format or the other, not both. | |
| per_page | integer | Query | false | Number of records to return per page. Note: Default and maximum values vary by endpoint. Check endpoint-specific documentation for limits. |
| sort | string | Query | false | Field to sort results by. Prefix with - for descending order. When used with cursor pagination, this determines the cursor ordering. Example: ?sort=name or ?sort=-created_at |
| dynamic_content_item_id | integer | Path | true | The ID of the dynamic content item |
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/dynamic_content/items/{dynamic_content_item_id}/variants \-H "Authorization: Bearer {access_token}"
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/dynamic_content/items/47/variants?page=&per_page=50&sort=name"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.