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:

NameTypeRead-onlyMandatoryDescription
activebooleanfalsefalseIf the variant is active and usable
contentstringfalsetrueThe content of the variant
created_atstringtruefalseWhen the variant was created
defaultbooleanfalsefalseIf the variant is the default for the item it belongs to
idintegertruefalseAutomatically assigned when the variant is created
locale_idintegerfalsetrueAn active locale
outdatedbooleantruefalseIf the variant is outdated
updated_atstringtruefalseWhen the variant was last updated
urlstringtruefalseThe 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

NameTypeInRequiredDescription
pageQueryfalsePagination 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_pageintegerQueryfalseNumber of records to return per page. Note: Default and maximum values vary by endpoint. Check endpoint-specific documentation for limits.
sortstringQueryfalseField 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_idintegerPathtrueThe 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.