Best answer

Invalid input JSON when configuring custom request

  • 3 November 2023
  • 9 replies
  • 367 views

Userlevel 1

Hi there,

 

I am experiencing an error when trying to configure a custom request. For some reason Zapier does not like the json body I am using, even is the same body I am using on Insomnia/Postman.

Here is more information about how I configure the request:

 

Request Type: Patch
Data Pass-Through? True
Data: { "name": "test_zapier", "label": "test_zapier", "type": "enumeration", "fieldType": "select", "groupName": "contactinformation", "hidden": false, "displayOrder": 2, "hasUniqueValue": false, "formField": true, "modificationMetadata": { "readOnlyOptions": false, "readOnlyValue": false, "readOnlyDefinition": false, "archivable": true }, "options": [ { "label": "Option A", "description": "Choice number one", "value": "A", "displayOrder": 1, "hidden": false }, { "label": "Option B", "description": "Choice number two", "value": "B", "displayOrder": 2, "hidden": false }, { "label": "Option Cuarta", "description": "asdfasdf", "value": "4", "displayOrder": 4, "hidden": false } ] }
Unflatten: Yes

The error I get when testing:

Invalid input JSON on line 1, column 3: Unexpected character (''' (code 39)): was expecting double-quote to start field name

Thanks in advance!

icon

Best answer by Troy Tessalone 3 November 2023, 20:49

View original

9 replies

Userlevel 7
Badge +14

Hi @LIN3S 

Good question.

Please post screenshots with how your Zap step is configured along with the encountered error.

Userlevel 1

@Troy Tessalone  Sure!

Some screenshots about the configuration:

 


 


 


For the Body which is what seems to be not working:

 

 

Userlevel 7
Badge +14

@LIN3S 

Can you post a screenshots of the encountered error?

Userlevel 7
Badge +14

@LIN3S 

Which of these HubSpot API endpoints are you trying to use?

 

Userlevel 1

@LIN3S

Which of these HubSpot API endpoints are you trying to use?

 


Sure! This is the error screenshot:

 



The HubSpot Api Endpoint is this one: 
 


Thanks for your time!

Userlevel 7
Badge +14

@LIN3S 

Try removing the “name” line as that doesn’t appear to be indicated in the HubSpot API endpoint docs.

 

Userlevel 1

@Troy Tessalone 

Didn’t work. I tried to simplify just with the minimum paramenters, but I keep getting the same error:
 

{
"groupName": "contactinformation",
"hidden": false,
"options": [
{
"label": "Option A",
"description": "Choice number one",
"value": "A",
"displayOrder": 1,
"hidden": false
}
]
}

 

Userlevel 7
Badge +14

@LIN3S 

Make sure any extra whitespace (spaces/tabs) are removed from the JSON.

 

Perhaps try one of these HubSpot Zap actions:

 

Userlevel 1

@Troy Tessalone Thank you so much! 

With the first option API Request (Beta) worked properly!

Reply