Hi,
We’re using HubSpot’s V3 API to create a deal, but hit a strange error when we do it via Code.
We target this URI: (POST) https://api.hubapi.com/crm/v3/objects/deals (and yes, we pass the hapikey
This is the payload we send:
{
"properties": {
"dealname": "Test2",
"pipeline": "{A GUID HERE}",
"dealstage": "{A GUID HERE}",
"createdate": "2021-08-07T16:50:06.678Z",
"closedate": "2022-12-07T16:50:06.678Z",
"lead_obtained": null,
"dealtype": "New Site",
"hubspot_owner_id": null,
"number_of_users": null,
"deal_currency_code": null,
"region": "Africa",
"account_managed_by": null,
"amount": "999.00"
}
}
We use a C# nuget package called flURL for all of our requests to Hubspot, and they all work fine, however we’re not sure why we keep hitting this strange error. From what I gather, it seems like HubSpot cannot deserialize the data we’re sending them.
This is the error received when we make the request via code:
Invalid input JSON on line 1, column 1: Cannot construct instance of `com.hubspot.inbounddb.publicobject.core.v2.SimplePublicObjectInput$Json` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('
{
"properties": {
"dealname": "Test2",
"pipeline": "{A GUID HERE}",
"dealstage": "{A GUID HERE}",
"createdate": "2021-08-07T16:50:06.678Z",
"closedate": "2022-12-07T16:50:06.678Z",
"lead_obtained": null,
"dealtype": "New Site",
"hubspot_owner_id": null,
"number_of_users": null,
"deal_currency_code": null,
"account_managed_by": null,
"amount": "999.00"
}
}')
However, when we post this via Postman, it works as expected, even though they requests and payloads look identical.
If you take a look at the payload returned in the error, you’ll note that it looks identical to what we send.
Do you have any insight as to why we could be seeing this error?
Thank you.