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
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.