Webhooks - different data types on json payload

I’m building a service which receives webhooks from pipedrive for update events on deals.
Trigger: “updated.deal”

The json payload that is sent to the registered webhook sometimes contains strings and sometimes integer fields for the company_id and deal_id fields.

Below is an extract where these fields are integers:

{ "v": 1, "matches_filters": { "current": [] }, "meta": { "action": "updated", "change_source": "api", "company_id": 7823181, "host": "damsak.pipedrive.com", "id": 1175, "is_bulk_update": false,....

and then another call on the same webhook where these fields are sent as Strings:

{ "v": 1, "matches_filters": { "current": [] }, "meta": { "action": "updated", "change_source": "api", "company_id": 7823181, "host": "10.245.46.24:3081.pipedrive.com", "id": "1175", "is_bulk_update": false,

Notice that the host is also different… why are these data types not consistent across multiple calls?
This means that I have to handle Strings and Integer values on the same field.

1 Like

Hey @cobusbez,
Welcome to the community :wave: and thanks for bringing this to our attention.:slight_smile:
I see that the only way to tackle this is to deliberately cast the field type to a particular data type (Say, String) every time. However, I realize that this is also an unnecessary step for someone to perform and it ideally should be a consistent data type. I will forward this to the concerned team and get back on the same.

Thank you. I’ll have to do the casting for now… just wanted to bring this to your attention.

Regards

1 Like

I have the same problem.

Hey folks,
Thanks for the wait. This issue has been resolved and should not result in field type inconsistency anymore. However, if you notice it, feel free to mention it in the thread :slight_smile:

It looks like there has been a regression. As of yesterday, mixed data types are being returned in organization webhooks and from the organizations API. Some custom field values for single choice fields are coming back as integers, where they used to be strings.