function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Martin AshkuriMartin Ashkuri 

I need to add contact in sales force using rest api.

I am adding contact in salesforce using REST api, getting error 
[{"message":"Cannot deserialize instance of double from START_OBJECT value { or request may be missing a required field at [line:1, column:501]","errorCode":"JSON_PARSER_ERROR"}]
Please anyone can help.
{!pramod_nishane}{!pramod_nishane}
Hi Martin,

As per your error message it seems like you are sending string value to Double parameter, meaing in your JSON request there will be Double parameter and you are assigning string value to it or it is going blank.

For example, check below request for Opportunity object- 
[{ "name":"OpportunityABC", 
"CloseDate":"2018-12-12",
"StageName":"Prospecting", 
"Amount":"4810308.0" }]
Here the error is "Amount":"4810308.0"  - Decimal receiving String value.

Please check your JSON request and also check the data type of contact field which you are using in it and assign proper data type values to it.

If possible can you share your JSON request.

Please let me know in case of any concerns.

Please mark this answer as the solution/ best answer if it solves your purpose so that it can help other community members.

Thanks,
Pramod Nishane
Salesforce Consultant
Varasi LLC
www.varasi.com