You need to sign in to do that
Don't have an account?
Robert Jakubov
Creating a Case with custom filed
Hello friends,
i am trying to create a Salesforce Case using the REST api (sobject, etc) and one of my fields in the Case is a custom object (Social_Message__c) which i configured as a Case custom field. Now when I am doing a POST call to the /sobjects/Case/ SFDC endpoint, I get the following exception:
'[{"message":"Cannot deserialize instance of reference from START_OBJECT value { or request may be missing a required field at [line:1, column:490]","errorCode":"JSON_PARSER_ERROR"}]'.
The JSON payload that I am passing is:
{'AssetId': None, 'Social_Message__c': {'Private_Message__c': False, 'Processed__C': False, 'Social_Platform__c': u'Facebook', 'Body__c': 'test'}, 'Type': 'Customer Support', 'Status': 'New', 'Reason': None, 'Origin': 'Web', 'SuppliedName': None, 'SuppliedEmail': None, 'Language__c': 'English', 'ParentId': None, 'Subject': u'confirm pub fb msg', 'AccountId': None, 'ContactId': u'003c000000iQNDaAAO', 'SuppliedCompany': None, 'IsEscalated': False, 'Product__c': None, 'Country__c': 'United States', 'SuppliedPhone': None, 'Priority': 'Medium'}
Any ideas what might be the issue?
thanks
Rob
i am trying to create a Salesforce Case using the REST api (sobject, etc) and one of my fields in the Case is a custom object (Social_Message__c) which i configured as a Case custom field. Now when I am doing a POST call to the /sobjects/Case/ SFDC endpoint, I get the following exception:
'[{"message":"Cannot deserialize instance of reference from START_OBJECT value { or request may be missing a required field at [line:1, column:490]","errorCode":"JSON_PARSER_ERROR"}]'.
The JSON payload that I am passing is:
{'AssetId': None, 'Social_Message__c': {'Private_Message__c': False, 'Processed__C': False, 'Social_Platform__c': u'Facebook', 'Body__c': 'test'}, 'Type': 'Customer Support', 'Status': 'New', 'Reason': None, 'Origin': 'Web', 'SuppliedName': None, 'SuppliedEmail': None, 'Language__c': 'English', 'ParentId': None, 'Subject': u'confirm pub fb msg', 'AccountId': None, 'ContactId': u'003c000000iQNDaAAO', 'SuppliedCompany': None, 'IsEscalated': False, 'Product__c': None, 'Country__c': 'United States', 'SuppliedPhone': None, 'Priority': 'Medium'}
Any ideas what might be the issue?
thanks
Rob
It identified a number of problems.
- Strings should be delimited with double quotes, not single quotes (http://stackoverflow.com/q/14355655/54026)
- I a couple of locations the strings are prefixed with a rogue u. E.g. 'Subject': u'confirm pub fb msg'
- I suspect your None values should be null.
- Boolean values should be lower case. E.g. false
Try something like the following: