You need to sign in to do that
Don't have an account?

json error
{ "rb": { "a": { "Name": "LG1", "SLAExpirationDate__c": "2016-4-21", "Active__c": "Yes", "SLA__c": "Platinum", "SLASerialNumber__c": "200" }, "cList": [{ "FirstName": "K1", "LastName": "K2" }, { "FirstName": "K3", "LastName": "K4" }] }, { "Name": "LG2", "SLAExpirationDate__c": "2016-4-21", "Active__c": "Yes", "SLA__c": "Platinum", "SLASerialNumber__c": "200" }, "cList": [{ "FirstName": "K5", "LastName": "K6" }, { "FirstName": "K7", "LastName": "K8" }] }Hello
I am getting an error in above json file.
for multiple accounts I have multiple contacts.
divya
Also, what is the error you are getting?
I am not making any api call.
I am testing the rest resource in workbench.
I am creating multiple accounts and for each account I have multiple contacts.
divya
It came back with the error:
Validator Output
Error:Expecting string, not {.[Code 8, Structure 54]
This corresponds to just before the:
I suspect you need a string to preceed this. Something like:
I ran ur suggestion in workbench but its not working.
error:
message: Unexpected parameter encountered during deserialization: foobar at [line:15, column:14]
errorCode: JSON_PARSER_ERROR
I have the done the above previously and its working.
But what I require is multiple account and contact, so I need to have another "a" folowed by "cList".
The json format you are using is not correct. This one is correct json. Please check the BOLD one.
{
"rb": {
"a": {
"Name": "LG1",
"SLAExpirationDate__c": "2016-4-21",
"Active__c": "Yes",
"SLA__c": "Platinum",
"SLASerialNumber__c": "200"
},
"cList": [{
"FirstName": "K1",
"LastName": "K2"
}, {
"FirstName": "K3",
"LastName": "K4"
}]
},
"b": {
"Name": "LG2",
"SLAExpirationDate__c": "2016-4-21",
"Active__c": "Yes",
"SLA__c": "Platinum",
"SLASerialNumber__c": "200"
},
"cList": [{
"FirstName": "K5",
"LastName": "K6"
}, {
"FirstName": "K7",
"LastName": "K8"
}]
}