APIs & Integrations

DKanunnikau
Member

Workflow webhook data types

(I hope this is not something that's clearly stated in the API docs that I just missed)

Has anyone else noticed that webhooks have a strong preference to use int values when POSTing payload from workflows, while calling HubSpot API from external servers will return the same values as Strings?

 

For example, if a Ticket has properties:

- id (standard "Record ID" property),

- some_custom_type (custom property created as "Dropdown select" with values like `123` filled in manually while created),

- some_custom_date (custom property created as "Date picker"),

- hs_pipeline_stage (standard "Ticket status" property).

 

then when these values are added to a workflow as webhook payload (via "Customize request body") they will be sent as following:

 

 

```

{
"id": 123123,
"some_custom_type": 111,
"some_custom_date": 1709769600000,
"hs_pipeline_stage": 555
}

```

And if the same object is pulled via API (`GET https://api.hubapi.com/crm/v3/objects/tickets/123123`),  the result will be like this:

```

{
"id": "123123",
"some_custom_type": "111",
"some_custom_date": "2024-03-07",
"hs_pipeline_stage": "555"
}

```

 

 

 

That was rather unexpected and it somewhat complicates things as there now have to be different handling for items received via webhooks vs items pulled via API.

Was this intentional?

Thank you.

0 Upvotes
2 Replies 2
BérangèreL
Community Manager
Community Manager

Workflow webhook data types

Hi @DKanunnikau,

Thank you for reaching out to the Community!

First, I'd like to share this post from @jackcoldrick, "How to implement Webhooks in HubSpot, and how do they differ from an API?" that might be of interest to you.

I also wanted to invite a couple of subject matter experts to this conversation  : Hi @beeginman, @stefen and @Oezcan do you have any insights you'd like to share to help @DKanunnikau, please?

If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂

Thank you so much and have a lovely day!

Best,
Bérangère


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres! !
0 Upvotes
DKanunnikau
Member

Workflow webhook data types

Hello

I have checked that post and did not see any mention of data types. Also, the links from that post seem to be poiting to the old docs (legacydocs.hubspot.com).

The new webhook API docs (https://developers.hubspot.com/docs/api/webhooks) mention which fields can be included (for example, "objectId: The ID of the object that was created, changed, or deleted. For contacts this is the contact ID; for companies, the company ID; for deals, the deal ID; and for conversations the thread ID. "), but do not explicitly say which data types those fields are. In the example JSON it can be seen that such values are sent as numbers, but you have to pay close attention to notice that.

 

Webhooks in workflows are different from the "general API" webhooks. There is a whole section about "Using webhooks in workflows", but it once again seems to point to the legacy docs (https://legacydocs.hubspot.com/docs/methods/workflows/webhook_information). That page points to a knowledge base article about using webhooks from workflows (https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows), but nowhere can I see any mention of which data types are used when adding custom request body properties.