curl --request POST \
--url https://api.hubapi.com/integrators/timeline/v3/events/batch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"inputs": [
{
"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
}
},
{
"eventTemplateId": "1001298",
"email": "pocket-tiger@petspot.com",
"tokens": {
"petName": "Pocket",
"petAge": 3,
"petColor": "yellow"
},
"extraData": {
"questions": [
{
"question": "Who's a good kitty?",
"answer": "Purr..."
},
{
"question": "Will you stop playing with that?",
"answer": "Meow!"
}
]
},
"timelineIFrame": {
"linkLabel": "View Pocket",
"headerLabel": "Pocket Tiger",
"url": "https://my.petspot.com/pets/Pocket",
"width": 600,
"height": 400
}
}
]
}
EOF{
"results": [
{
"objectType": "contacts",
"id": "petspot:1001298:art3mis-pup@petspot.com-b9d73144-41bb-46c8-9a3f-f0849c1ad7e6",
"eventTemplateId": "1001298",
"email": "art3mis-pup@petspot.com",
"objectId": "28001",
"timestamp": "2020-01-30T18:10:17.057Z",
"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
}
},
{
"objectType": "contacts",
"id": "petspot:1001298:pocket-tiger@petspot.com-c09a620f-60a4-46a8-be9f-fe0609fc3f0e",
"eventTemplateId": "1001298",
"email": "pocket-tiger@petspot.com",
"objectId": "28651",
"timestamp": "2020-01-30T18:10:17.057Z",
"tokens": {
"petName": "Pocket",
"petColor": "yellow",
"petAge": "3"
},
"extraData": {
"questions": [
{
"question": "Who's a good kitty?",
"answer": "Purr..."
},
{
"question": "Will you stop playing with that?",
"answer": "Meow!"
}
]
},
"timelineIFrame": {
"linkLabel": "View Pocket",
"headerLabel": "Pocket Tiger",
"url": "https://my.petspot.com/pets/Pocket",
"width": 600,
"height": 400
}
}
],
"status": "COMPLETE",
"startedAt": "2020-01-30T18:10:16.478734Z",
"completedAt": "2020-01-30T18:10:17.793206Z"
}Batch create multiple instances of timeline events based on an event template. Once created, these event are immutable on the object timeline and cannot be modified. If the event template was configured to update object properties via objectPropertyName, this call will also attempt to updates those properties, or add them if they don’t exist.
curl --request POST \
--url https://api.hubapi.com/integrators/timeline/v3/events/batch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"inputs": [
{
"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
}
},
{
"eventTemplateId": "1001298",
"email": "pocket-tiger@petspot.com",
"tokens": {
"petName": "Pocket",
"petAge": 3,
"petColor": "yellow"
},
"extraData": {
"questions": [
{
"question": "Who's a good kitty?",
"answer": "Purr..."
},
{
"question": "Will you stop playing with that?",
"answer": "Meow!"
}
]
},
"timelineIFrame": {
"linkLabel": "View Pocket",
"headerLabel": "Pocket Tiger",
"url": "https://my.petspot.com/pets/Pocket",
"width": 600,
"height": 400
}
}
]
}
EOF{
"results": [
{
"objectType": "contacts",
"id": "petspot:1001298:art3mis-pup@petspot.com-b9d73144-41bb-46c8-9a3f-f0849c1ad7e6",
"eventTemplateId": "1001298",
"email": "art3mis-pup@petspot.com",
"objectId": "28001",
"timestamp": "2020-01-30T18:10:17.057Z",
"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
}
},
{
"objectType": "contacts",
"id": "petspot:1001298:pocket-tiger@petspot.com-c09a620f-60a4-46a8-be9f-fe0609fc3f0e",
"eventTemplateId": "1001298",
"email": "pocket-tiger@petspot.com",
"objectId": "28651",
"timestamp": "2020-01-30T18:10:17.057Z",
"tokens": {
"petName": "Pocket",
"petColor": "yellow",
"petAge": "3"
},
"extraData": {
"questions": [
{
"question": "Who's a good kitty?",
"answer": "Purr..."
},
{
"question": "Will you stop playing with that?",
"answer": "Meow!"
}
]
},
"timelineIFrame": {
"linkLabel": "View Pocket",
"headerLabel": "Pocket Tiger",
"url": "https://my.petspot.com/pets/Pocket",
"width": 600,
"height": 400
}
}
],
"status": "COMPLETE",
"startedAt": "2020-01-30T18:10:16.478734Z",
"completedAt": "2020-01-30T18:10:17.793206Z"
}Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
The timeline event definition.
Used to create timeline events in batches.
A collection of timeline events we want to create.
Show child attributes
The event template ID.
The event domain (often paired with utk).
The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the objectId).
Additional event-specific data that can be interpreted by the template's markdown.
Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use {{uuid}} anywhere in the ID to generate a unique string, guaranteeing uniqueness.
The CRM object identifier. This is required for every event other than contacts (where utk or email can be used).
Show child attributes
The label of the modal window that displays the iframe contents.
The height of the modal window in pixels.
The text displaying the link that will display the iframe.
The URI of the iframe contents.
The width of the modal window in pixels.
{
"linkLabel": "View Art3mis",
"headerLabel": "Art3mis dog",
"url": "https://my.petspot.com/pets/Art3mis",
"width": 600,
"height": 400
}The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline.
Use the utk parameter to associate an event with a contact by usertoken. This is recommended if you don't know a user's email, but have an identifying user token in your cookie.
Was this page helpful?