I'm upserting a custom object via the REST api. How can I use the REST api to populate the record owner using an external id? See details below:
Endpoint:
/services/data/v42.0/sobjects/finserv__Alert__c/FinServ__SourceSystemId__c/test-external_id
Method: PATCH
Body:
{
"FinServ__Account__r":{
"External_Id__c":"account-external-id-1"
},
"FinServ__Message__c":"Alert-Subject-Finserv-CREATE-1",
"FinServ__MessageDescription__c":"Alert-Description-Finserv-CREATE-1",
"FinServ__Active__c":false,
"Owner":{
"External_Id__c":"user-external-id-1"
}
}
I get the following error when I run this in workbench:
message: Unexpected character ('F' (code 70)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [line:1, column:2]
errorCode: JSON_PARSER_ERROR
This seems to be because Owner is a UserOrGroup lookup, and not a lookup to a single object. The moment I remove "Owner": {...} from the payload, it succeeds.
How can I use the REST api to populate the record owner using an external id?
OwnerId
via trigger.