Skip to content

Atualizar a Central de Preferências

put

/preference_center/v1/{preferenceCenterExternalID}

Use esse endpoint para atualizar uma Central de Preferências.

Pré-requisitos

Para usar esse endpoint, você precisará de uma chave de API com a permissão preference_center.update.

Limite de taxa

Esse endpoint tem um limite de taxa de 10 solicitações por minuto, por espaço de trabalho, conforme documentado em Limites de taxa da API.

Parâmetros de caminho

Parâmetro Obrigatória Tipo de dados Descrição
preferenceCenterExternalID Obrigatória String O ID da sua Central de Preferências.

Corpo da solicitação

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "name": "preference_center_name",
  "preference_center_title": "string",
  "preference_center_page_html": "string",
  "confirmation_page_html": "string",
  "options": {
    "unknown macro": {links-tags}
  "options": {
    "meta-viewport-content": "string", (optional) Only the `content` value of the meta tag,
    "links-tags": [
      {
        "rel": "string", (required) One of: "icon", "shortcut icon", or "apple-touch-icon",
        "type": "string", (optional) Valid values: "image/png", "image/svg", "image/gif", "image/x-icon", "image/svg+xml", "mask-icon",
        "sizes": "string", (optional),
        "color": "string", (optional) Use when type="mask-icon",
        "href": "string", (required)
      }
    ]
  }
}

Parâmetros de solicitação

Parâmetro Obrigatória Tipo de dados Descrição
preference_center_page_html Obrigatória String O HTML da página da Central de Preferências.
preference_center_title Opcional String O título da Central de Preferências e das páginas de confirmação. Se um título não for especificado, o título das páginas será “Preference Center” por padrão.
confirmation_page_html Obrigatória String O HTML da página de confirmação.
state Opcional String Escolha active ou draft.
options Opcional Objeto Atributos:
meta-viewport-content: Quando presente, uma meta tag viewport será adicionada à página com content= <value of attribute>.

link-tags: Defina um favicon para a página. Quando definido, uma tag <link> com um atributo rel é adicionada à página.

Exemplo de solicitação

1
2
3
4
5
6
7
8
9
10
11
curl --location --request POST 'https://rest.iad-01.braze.com/preference_center/v1/{preferenceCenterExternalId}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-API-KEY-HERE' \
--data-raw '{
  "name": "Example",
  "preference_center_title": "Example Preference Center Title",
  "preference_center_page_html": "HTML for preference center here",
  "confirmation_page_html": "HTML here with a message to users here",
  "state": "active"
}
'

Exemplo de resposta

1
2
3
4
5
6
{
  "preference_center_api_id": "8efc52aa-935e-42b7-bd6b-98f43bb9b0f1",
  "created_at": "2022-09-22T18:28:07Z",
  "updated_at": "2022-09-22T18:32:07Z",
  "message": "success"
}
New Stuff!