Skip to main content

Whenever I am trying to hit the platform event bus in the format below then it gets successful but it's not being parsed as this has single quotes inside Message_Details__c.

{

"Message_Name__c": "Batch Failure",

"Source__c": "IPE",

"Destination__c": "Salesforce",

"Message_Action__c": "Testing",

"Message_Details1__c":"{[{'ValidationErrorDetails': 'Duplicate Invoice Batch'},{'ValidationErrorDetails1': 'Duplicate Invoice Batch1'}]}"

}

Response :

{

"id": "e06xx0000000001AAA",

"success": true,

"errors": [

{

"statusCode": "OPERATION_ENQUEUED",

"message": "1b05b592-cbec-42c1-aa3d-737d3980590c",

"fields": []

}

]

--------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------

But when I am sending the correct JSON as below then it gives me error :

{

"Destination__c": "Salesforce",

"Source__c": "IPE",

"Message_Action__c": "Success",

"Message_Name__c":"Invoice",

"Message_Details1__c": [{ "InvoiceNumber": "DRAFT-0000001", "AWSURL": "the AWS S3 bucket url for the PDF generated"}]

}

Response :

[

{

"message": "Cannot deserialize instance of textarea from START_ARRAY value [line:9, column:44]",

"errorCode": "JSON_PARSER_ERROR"

}

]

 
18 answers
  1. Mar 10, 2020, 7:29 PM

    Hello. I think you should remove the quotes around the array of objects as seen below:

    {

    "Message_Name__c": "Batch Failure",

    "Source__c": "IPE",

    "Destination__c": "Salesforce",

    "Message_Action__c": "Testing",

    "Message_Details1__c":{["ValidationErrorDetails": "Duplicate Invoice Batch"},{"ValidationErrorDetails1": "Duplicate Invoice Batch1"}]}

    }

     
0/9000