Zum Hauptinhalt springen
POST
/
integrators
/
timeline
/
v3
/
{appId}
/
event-templates
イベントテンプレートを作成
curl --request POST \
  --url https://api.hubapi.com/integrators/timeline/v3/{appId}/event-templates \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "PetSpot Registration",
  "objectType": "contacts",
  "headerTemplate": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})",
  "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}",
  "tokens": [
    {
      "name": "petName",
      "label": "Pet Name",
      "type": "string"
    },
    {
      "name": "petAge",
      "label": "Pet Age",
      "type": "number"
    },
    {
      "name": "petColor",
      "label": "Pet Color",
      "type": "enumeration",
      "options": [
        {
          "value": "white",
          "label": "White"
        },
        {
          "value": "black",
          "label": "Black"
        },
        {
          "value": "brown",
          "label": "Brown"
        },
        {
          "value": "other",
          "label": "Other"
        }
      ]
    }
  ]
}'
{
  "id": "1001298",
  "objectType": "contacts",
  "createdAt": "2020-02-12T20:58:26Z",
  "updatedAt": "2020-02-12T20:58:26Z",
  "name": "PetSpot Registration",
  "headerTemplate": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})",
  "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}",
  "tokens": [
    {
      "name": "petName",
      "type": "string",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Name",
      "options": []
    },
    {
      "name": "petAge",
      "type": "number",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Age",
      "options": []
    },
    {
      "name": "petColor",
      "type": "enumeration",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Color",
      "options": [
        {
          "value": "white",
          "label": "White"
        },
        {
          "value": "black",
          "label": "Black"
        },
        {
          "value": "brown",
          "label": "Brown"
        },
        {
          "value": "other",
          "label": "Other"
        }
      ]
    }
  ]
}
サポートされる製品
次のいずれかの製品またはそれ以上が必要です。
Marketing HubMarketing Hub無料ツール
Sales HubSales Hub無料ツール
Service HubService Hub無料ツール
Content HubContent HubStarter

Authorizations

hapikey
string
query
required

Path Parameters

appId
integer
required

ターゲットアプリのID。

Body

application/json

The new event template definition.

State of the template definition being created.

name
string
required

テンプレート名。

Example:

"PetSpot Registration"

tokens
object[]
required

イベントのカスタムプロパティーとして使用でき、完全なCRMオブジェクトを作成するためのトークンのコレクション。

Example:

"[{\"name\":\"petName\",\"type\":\"string\",\"label\":\"Pet Name\"},{\"name\":\"petAge\",\"type\":\"number\",\"label\":\"Pet Age\"},{\"name\":\"petColor\",\"type\":\"enumeration\",\"label\":\"Pet Color\",\"options\":[{\"label\":\"White\",\"value\":\"white\"},{\"label\":\"Black\",\"value\":\"black\"},{\"label\":\"Brown\",\"value\":\"brown\"},{\"label\":\"Other\",\"value\":\"other\"}]}]"

objectType
string
required

このテンプレートが[コンタクト、会社、チケット、取引]についてサポートされているCRMオブジェクトのタイプ。

Example:

"contacts"

detailTemplate
string

詳細を展開すると、Handlebarsとイベント固有のデータを含めてMarkdown構文を使用してタイムラインでHTMLがレンダリングされます。

Example:

"Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}"

headerTemplate
string

ヘッダーとして、Handlebarsとイベント固有のデータを含めてMarkdown構文を使用してタイムラインでHTMLがレンダリングされます。

Example:

"Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})"

Response

successful operation

The current state of the template definition.

name
string
required

テンプレート名。

tokens
object[]
required

イベントのカスタムプロパティーとして使用でき、完全なCRMオブジェクトを作成するためのトークンのコレクション。

id
string
required

テンプレートID。

objectType
string
required

このテンプレートが[コンタクト、会社、チケット、取引]についてサポートされているCRMオブジェクトのタイプ。

createdAt
string<date-time>

イベントテンプレートが作成された日時(ISO 8601タイムスタンプ)。テンプレートが2020年2月18日より前に作成された場合はnullになります。

detailTemplate
string

詳細を展開すると、Handlebarsとイベント固有のデータを含めてMarkdown構文を使用してタイムラインでHTMLがレンダリングされます。

headerTemplate
string

ヘッダーとして、Handlebarsとイベント固有のデータを含めてMarkdown構文を使用してタイムラインでHTMLがレンダリングされます。

updatedAt
string<date-time>

イベントテンプレートが最後に更新された日時(ISO 8601タイムスタンプ)。テンプレートが2020年2月18日より前に作成された場合はnullになります。

I