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
AnantGargAnantGarg 

Cannot deserialize instance of MailingAddress from VALUE_STRING

Using REST API, I am trying to insert/update a contact into my business org, though in response I am getting this error message 'Cannot deserialize instance of MailingAddress from VALUE_STRING', the same response also resulting for 'OtherAddress'.

To my understanding, I think this is due to the reason that 'MailingAddress' and 'OtherAddress' are not actual fields that contains some String data, rather they take a dynamic address which resulting in filling up all other related fields like - 'MailingCity, MailingStreet, etc'.
So I have 2 questions:
1. How can I set 'MailingAddress'  and 'OtherAddress' fields if I want to using API parameter only?
2. Is there any manual/documentation for this reference? As I am also having trouble with 'OtherLatitude' and 'OtherLogitude' fields.
Best Answer chosen by AnantGarg
AnantGargAnantGarg
The JSON string is almost like you stated:
"MailingAddress": "my address string",
Though I think I have got the answer here :
https://stackoverflow.com/questions/55101284/salesforce-api-using-compound-fields-cannot-deserialize-instance-of-mailinga (https://stackoverflow.com/questions/55101284/salesforce-api-using-compound-fields-cannot-deserialize-instance-of-mailinga" target="_blank)

All Answers

Raj VakatiRaj Vakati
Can you share the Json String .. MailingAddress value you need to pass it as "MailingStreet" and ext 

 
"MailingStreet": "Request for new bin(s) - residential",
                    "MailingCity": "Propmain ref  3234-1114",
                    "MailingpostalCode": "submitted",
                    "MailingCountry": "36 Pine Tree Close",

 
AnantGargAnantGarg
The JSON string is almost like you stated:
"MailingAddress": "my address string",
Though I think I have got the answer here :
https://stackoverflow.com/questions/55101284/salesforce-api-using-compound-fields-cannot-deserialize-instance-of-mailinga (https://stackoverflow.com/questions/55101284/salesforce-api-using-compound-fields-cannot-deserialize-instance-of-mailinga" target="_blank)
This was selected as the best answer