Zum Hauptinhalt springen
POST
/
integrators
/
timeline
/
v3
/
events
イベントデータを送信(単一)
curl --request POST \
  --url https://api.hubapi.com/integrators/timeline/v3/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "eventTemplateId": "1001298",
  "email": "art3mis-pup@petspot.com",
  "tokens": {
    "petName": "Art3mis",
    "petAge": 3,
    "petColor": "black"
  },
  "extraData": {
    "questions": [
      {
        "question": "Who'\''s a good girl?",
        "answer": "Bark!"
      },
      {
        "question": "Do you wanna go on a walk?",
        "answer": "Woof!"
      }
    ]
  },
  "timelineIFrame": {
    "linkLabel": "View Art3mis",
    "headerLabel": "Art3mis dog",
    "url": "https://my.petspot.com/pets/Art3mis",
    "width": 600,
    "height": 400
  }
}'
{
  "objectType": "contacts",
  "id": "petspot:1001298:art3mis-pup@petspot.com-004",
  "eventTemplateId": "1001298",
  "email": "art3mis-pup@petspot.com",
  "objectId": "28001",
  "timestamp": "2020-01-30T17:42:10.276Z",
  "tokens": {
    "petName": "Art3mis",
    "petColor": "black",
    "petAge": "3"
  },
  "extraData": {
    "questions": [
      {
        "question": "Who's a good girl?",
        "answer": "Bark!"
      },
      {
        "question": "Do you wanna go on a walk?",
        "answer": "Woof!"
      }
    ]
  },
  "timelineIFrame": {
    "linkLabel": "View Art3mis",
    "headerLabel": "Art3mis dog",
    "url": "https://my.petspot.com/pets/Art3mis",
    "width": 600,
    "height": 400
  }
}
次のいずれかの製品またはそれ以上が必要です。
Marketing HubMarketing Hub -無料ツール
Sales HubSales Hub -無料ツール
Service HubService Hub -無料ツール
Content HubContent Hub -Starter
この API には、次のいずれかのスコープが必要です。
crm.objects.companies.highly_sensitive.write.v2
crm.objects.companies.sensitive.write.v2
crm.objects.companies.write
crm.objects.contacts.highly_sensitive.write.v2
crm.objects.contacts.sensitive.write.v2
crm.objects.contacts.write
crm.objects.deals.highly_sensitive.write.v2
crm.objects.deals.sensitive.write.v2
crm.objects.deals.write
crm.schemas.companies.write
crm.schemas.contacts.write
crm.schemas.deals.write
tickets
tickets.highly_sensitive.v2
tickets.sensitive.v2
timeline

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

The timeline event definition.

The state of the timeline event.

eventTemplateId
string
required

イベントテンプレートID。

Example:

"1001298"

tokens
object
required

テンプレートトークンに関連付けられているトークンキーと値のコレクション。

Example:

"{\"petAge\":3,\"petName\":\"Art3mis\",\"petColor\":\"black\"}"

extraData
object

テンプレートのMarkdownによって解釈可能な追加のイベント固有データ。

Example:

"{\"questions\":[{\"answer\":\"Bark!\",\"question\":\"Who's a good girl?\"},{\"answer\":\"Woof!\",\"question\":\"Do you wanna go on a walk?\"}]}"

timelineIFrame
object
Example:
{
"linkLabel": "View Art3mis",
"headerLabel": "Art3mis dog",
"url": "https://my.petspot.com/pets/Art3mis",
"width": 600,
"height": 400
}
domain
string

イベントドメイン(UTKとペアになることが多い)。

id
string

イベントのID。任意であり、渡さないことをお勧めします。省略すると、自動で作成されます。IDの任意の場所で「{{uuid}}」を使用して固有の文字列を生成し、確実に重複させないようにすることもできます。

utk
string

「utk」パラメーターを使用して、「usertoken」によってイベントをコンタクトに関連付けます。ユーザーのEメールアドレスは分からないが、Cookieにユーザーを特定するトークンが含まれている場合にお勧めします。

email
string

コンタクト固有のイベントに使用されるEメールアドレス。既存のコンタクトの特定、新規作成、既存のコンタクトのEメールの変更に使用できます(「objectId」とペアになっている場合)。

Example:

"art3mis-pup@petspot.com"

objectId
string

CRMオブジェクトID。コンタクト以外の全てのイベントに必要です(コンタクトの場合は、UTKまたはEメールを使用できます)。

timestamp
string<date-time>

イベントが発生した日時。渡されなかった場合、現在の時刻であると想定されます。イベントがCRMオブジェクトのタイムラインに表示される場所を決定するために使用されます。

Response

successful operation

The current state of the timeline event.

eventTemplateId
string
required

イベントテンプレートID。

Example:

"1001298"

tokens
object
required

テンプレートトークンに関連付けられているトークンキーと値のコレクション。

Example:

"{\"petAge\":\"3\",\"petName\":\"Art3mis\",\"petColor\":\"black\"}"

id
string
required

イベントのID。アプリやイベントテンプレートに対して固有である必要があります。異なるCRMオブジェクトに同じIDを使用すると、最後に処理したオブジェクトが残り、最初のオブジェクトにはレコードがなくなります。IDの任意の場所で「{{uuid}}」を使用して固有の文字列を生成し、確実に重複させないようにすることもできます。

Example:

"petspot:1001298:art3mis-pup@petspot.com-004-invalid"

objectType
string
required

EventTemplateに関連付けられているObjectType。

Example:

"contacts"

createdAt
string<date-time>
extraData
object

テンプレートのMarkdownによって解釈可能な追加のイベント固有データ。

Example:

"{\"questions\":[{\"answer\":\"Bark!\",\"question\":\"Who's a good girl?\"},{\"answer\":\"Woof!\",\"question\":\"Do you wanna go on a walk?\"}]}"

timelineIFrame
object
Example:
{
"linkLabel": "View Art3mis",
"headerLabel": "Art3mis dog",
"url": "https://my.petspot.com/pets/Art3mis",
"width": 600,
"height": 400
}
domain
string

イベントドメイン(UTKとペアになることが多い)。

utk
string

「utk」パラメーターを使用して、「usertoken」によってイベントをコンタクトに関連付けます。ユーザーのEメールアドレスは分からないが、Cookieにユーザーを特定するトークンが含まれている場合にお勧めします。

email
string

コンタクト固有のイベントに使用されるEメールアドレス。既存のコンタクトの特定、新規作成、既存のコンタクトのEメールの変更に使用できます(「objectId」とペアになっている場合)。

Example:

"art3mis-pup@petspot.com"

objectId
string

CRMオブジェクトID。コンタクト以外の全てのイベントに必要です(コンタクトの場合は、UTKまたはEメールを使用できます)。

Example:

"28001"

timestamp
string<date-time>

イベントが発生した日時。渡されなかった場合、現在の時刻であると想定されます。イベントがCRMオブジェクトのタイムラインに表示される場所を決定するために使用されます。

Example:

"2020-01-30T18:37:15.569+00:00"

I