Skip to main content
Hi! I can use the SF rest API to submit a record for approval, and I can approve that record via the UI, but not using the REST API, I get error: Exception: API error when calling https://na72.salesforce.com/services/data/v43.0/process/approvals/ : b'[{"message":"invalid cross reference id","errorCode":"INVALID_CROSS_REFERENCE_KEY","fields":[]}]'

 

My json package is pretty simple: {'requests':[{'actionType':'Approve','contextId':'a2e1H000000gsSJQAY','comments':'this record is API approved'}]}

 

The record exists and my user can access it. It is locked upon submission for approval, but this does not pose a problem for UI approval, could it be what is preventing API approval? Do I need to unlock the record via Apex prior to API approval?

 

Thanks for the help!
3 Antworten
  1. 31. Aug. 2018, 13:16
    I know this is the case with records that have not been submitted for approval, but is this also true for records that have been submitted? The REST API documentation does not mention that records must be unlocked prior to being approved or rejected.
0/9000