I'm trying to execute the following compositeRequest but I'm getting the error.
{
"allOrNone": true,
"compositeRequest": [
{
"method": "GET",
"url": "/services/data/v46.0/query/?q=SELECT+id,Name+FROM+Contact+WHERE+Email+=+'test@gmail.com'",
"referenceId": "refContactData"
},{
"method": "PATCH",
"url": "/services/data/v46.0/sobjects/Case/5005O000000s7XXXX",
"referenceId": "refCase",
"body": {
"Subject":"test",
"ContactId": "@{refContactData.records[0].id}"
}
}
]
}
Second is getting failed and it is throwing an error.
Error:
{
"body": [
{
"errorCode": "PROCESSING_HALTED",
"message": "Invalid reference specified. No value for refContactData.records[0].id found in refContactData"
}
],
"httpHeaders": {},
"httpStatusCode": 400,
"referenceId": "refCase"
}
Kindly please let me know If I have missed any componet.
Best Answer
You have a capitalization error:
In the response body to a Query REST call, each record contains a field called
Id
, notid
:I was able to execute a composite request analogous to yours simply by using