In this post, we will talk about how to resolve the JSON error in cURL. It was a tricky conundrum but we got to the bottom of it with some trial and error.
What are JSON and cURL?
First, a bit of background information. JavaScript Object Notation (JSON) is essentially a readable format that is used for structuring and transmitting data. Meanwhile, ‘cURL‘ (short for ‘client URL’) is a tool used in transferring data from one server to another.
The JSON Error
How did we chance upon this problem? Well, it happened when we tried to send email using the cURL.
The Data for the cURL has been provided with the help of a JSON script. We got an error when we ran the cURL.
The error message read as follows:
<html><head><title>411 Invalid Request</title></head><body>Invalid Request: ??</body>{“ErrorCode”:402,”Message”:”Received invalid JSON input.”}<html><head><title>501 Invalid Request</title></head><body>Invalid Request: ??</body>{“ErrorCode”:402,”Message”:”Received invalid JSON input.”}{“ErrorCode”:403,”Message”:”Received valid, but incompatible JSON input.”}{“ErrorCode”:402,”Message”:”Received invalid JSON input.”}{“ErrorCode”:402,”Message”:”Received invalid JSON input.”}
Now, naturally this caused frustration. We thought we could send the email through the use of cURL but something had gone wrong. The software had a different idea in mind. So, we decided to investigate the issue and figure out the source of our woes.
So where was the mistake made? After some digging and trying and testing different theories, we came to a conclusion: Formatting.
You see, there was a formatting error that had somehow slipped past us. A problem in the formatting had caused this JSON error in cURL.
Solution for Fixing JSON Error in cURL
If you have faced the same or similar issue, make sure you have the proper format. Even if you haven’t, check right now and implement it as this will keep you from running into the problem in the future.
So, what is the proper format for JSON input in cURL? Well, we’ll tell you.
The correct JSON format should look like this:
“-X POST
-H \”Accept: application/json\”
-H \”Content-Type: application/json\”
-H \”X-Postmark-Server-Token: tokenvalue\”
–data{\”From\”:\”test1@mail.com\”,\”To\”:\”test2@mail.com\”,\”TemplateId\”:tempid,\”TemplateModel\”:{\”commenter_name\”:\”commenter_name_Value\”,\”body\”:\”body_Value\”,\”attachment_details\”:[{\”attachment_url\”:\”attachment_url_Value\”,\”attachment_name\”:\”attachment_name_Value\”,\ “attachment_size\”:\”attachment_size_Value\”,\”attachment_type\”:\”attachment_type_Value\”}],\”timestamp\ “:\”timestamp_Value\”,\”action_url\”:\”action_url_Value\”,\”notifications_url\”:\”notifications_url_Value\”}}”
We made the changes and we were able to send our email properly, thus fixing the JSON error in cURL. This worked for us and should work just as well for you.
FileMaker Fixes from FMDBSolutions
The team at FMDBSolutions hopes this article taught you how to solve the JSON Error in cURL. If you are still facing problems with this issue or another one, contact us. FMDBSolutions is a team of well-qualified experts that have a lot of experience with the many versions of FileMaker Pro and the FileMaker Go app too.
This JSON error in cURL is actually nothing compared to some of the other dilemmas that we faced, such as enabling the Web Server or making PDF display in Preview Mode. There are many similar issues but we guarantee you that we have the capability to deal with any difficulties when it comes to FileMaker.
Our team knows all about transitioning, migrating, converting, and upgrading for FileMaker. Companies that require FileMaker Integration can also use our services. We have worked with clients from the USA, Australia, and Singapore and will complete your FileMaker assignment in the best possible way at a lower price but the same or higher level of excellence.
If you want solutions to your FileMaker database, we can help. Click the below box for a free FileMaker consultation.
You can also leave us your email below for receiving new updates regarding FileMaker and our company.


