Skip to main content
Best answer

Invalid input JSON when configuring custom request


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!

Best answer by Troy TessaloneBest answer by Troy Tessalone

@LIN3S 

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

 

Perhaps try one of these HubSpot Zap actions:

 

View original
Did this topic help you find an answer to your question?

9 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi @LIN3S 

Good question.

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


  • Author
  • Beginner
  • 6 replies
  • November 3, 2023

@Troy Tessalone  Sure!

Some screenshots about the configuration:

 


 


 


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

 

 


Troy Tessalone
Forum|alt.badge.img+14

@LIN3S 

Can you post a screenshots of the encountered error?


Troy Tessalone
Forum|alt.badge.img+14

@LIN3S 

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

 


  • Author
  • Beginner
  • 6 replies
  • November 3, 2023
Troy Tessalone wrote:

@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!


Troy Tessalone
Forum|alt.badge.img+14

@LIN3S 

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

 


  • Author
  • Beginner
  • 6 replies
  • November 3, 2023

@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
    }
  ]
}

 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30901 replies
  • Answer
  • November 3, 2023

@LIN3S 

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

 

Perhaps try one of these HubSpot Zap actions:

 


  • Author
  • Beginner
  • 6 replies
  • November 3, 2023

@Troy Tessalone Thank you so much! 

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