1

I am trying to make a composite api request through workbench, where I get the error as referenceId' is a required field

Below is the request body:

{"compositeRequest" : [{
"method" : "POST",
"url" : "/services/data/v48.0/sobjects/Account/" ,
"referenceId":"refAccountId",
"body" :{
          "Name" : "Manish VP"
        }},{
"method" : "POST",
"url" : "/services/data/v48.0/sobjects/Contact/",
"body" : {
             "LastName" : "Manish",
             "AccountId" : "@{refAccountId.id}"  
          }  } ]}

Workbench URI - /services/data/v48.0/composite

0

1 Answer 1

4

You also need to specify a referenceId for the child objects.

{
    "compositeRequest": [
        {
            "method": "POST",
            "url": "/services/data/v38.0/sobjects/Account",
            "referenceId": "refAccount",
            "body": {
                "Name": "Manish VP"
            }
        },
        {
            "method": "POST",
            "url": "/services/data/v38.0/sobjects/Contact",
            "referenceId": "refContact",
            "body": {
                "LastName": "Manish",
                "AccountId": "@{refAccount.id}"
            }
        }
    ]
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .