APIs & Integrations

Renegade
Top Contributor

Defining Timeline Templates

SOLVE

In the documentation to define templates for the Timeline API, there is the following sample PUT command:

 

curl -X PUT -H "Content-Type: application/json" -d '
{
    "id": 3,
    "applicationId": <<appId>>,
    "name": "Example event type",
    "headerTemplate": "Registered for [{{webinarName}}](https://mywebinarsystem/webinar/{webinarId})",
    "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}"
}'

QUESTIONS:

1. What is "id" (it is defined nowhere)?

2. What is "name"?  (Must it match the name of a defined event type, as it does in this example?  Does it matter?)

 

Thanks!

 

1 Accepted solution
lscanlan
Solution
HubSpot Alumni
HubSpot Alumni

Defining Timeline Templates

SOLVE

Hi @Renegade,

 

So this PUT request is really just updating the event type. So on the screen where the various event types are listed, you'll see that each has a value in the "Name" column, and each also has a value in the "ID" column. Those IDs are what identify the event type. The name can be updated in your PUT requests or kept as is. So to answer your questions:

 

  1. The ID identifies the event type. It can be found on the screen where the event types are listed. You also can pull all events types through the endpoint documented here: https://developers.hubspot.com/docs/methods/timeline/get-event-types. It will return the ID for each event type.
  2. The name is kind of like the label for the event type. You do need to include it in your request. If you don't want to update the name of the event type, just pass in its current value (you could copy/paste). If you want to update the name of the event type, you can pass in a new value in your request.

 

Let me know if that makes sense?

 

 - Leland

Leland Scanlan

HubSpot Developer Support

View solution in original post

0 Upvotes
1 Reply 1
lscanlan
Solution
HubSpot Alumni
HubSpot Alumni

Defining Timeline Templates

SOLVE

Hi @Renegade,

 

So this PUT request is really just updating the event type. So on the screen where the various event types are listed, you'll see that each has a value in the "Name" column, and each also has a value in the "ID" column. Those IDs are what identify the event type. The name can be updated in your PUT requests or kept as is. So to answer your questions:

 

  1. The ID identifies the event type. It can be found on the screen where the event types are listed. You also can pull all events types through the endpoint documented here: https://developers.hubspot.com/docs/methods/timeline/get-event-types. It will return the ID for each event type.
  2. The name is kind of like the label for the event type. You do need to include it in your request. If you don't want to update the name of the event type, just pass in its current value (you could copy/paste). If you want to update the name of the event type, you can pass in a new value in your request.

 

Let me know if that makes sense?

 

 - Leland

Leland Scanlan

HubSpot Developer Support
0 Upvotes