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
SImmySImmy 

Please help me with JSON

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"
    }
]