IOS MDM Activation Unlock Not Working

Hello,

I am working on a MDM solution. I am facing issue to while Activation Unlock Iphone by MDM server. I am following this https://developer.apple.com/documentation/devicemanagement/device_assignment/activation_lock_a_device/creating_and_using_bypass_codes documentation as reference. I am able to activation lock the device from mdm server but while unlocking the device I am getting below error

"?xml version="1.0" encoding="UTF-8"?> ns:escrowKeyDeviceServicesResponse version="1" xmlns:ns="http://www.apple.com/cds/mdmescrowKeyDeviceServices/xml"> error code="1002" message="com.apple.cds.cyclops.mdm.MDMServiceException: No registered escrow key found"/> /ns:escrowKeyDeviceServicesResponse>"

I am sending below request for Unlock

Url=https://deviceservices-external.apple.com/deviceservicesworkers/escrowKeyUnlock?Device_Serial=XXXXXXXX&productType=iPhone12,8&imei=XXXXXXX&imei2=XXXXXXXXXXXXXX&meid=XXXXXXXXXX

Body=escrowKey=VT2DK-YR647-HWAY-096C-ER7P-89J1&orgName=ORGNAME&guid=9C1AE0D42A38A23AFFE59

Below working request for Activation Lock

URL=https://mdmenrollment.apple.com/device/activationlock

Body = { "Device" :"Serial_Number", "EscrowKey" :"B83C6E662299F3AF202656C4D7A434A319A34241A2892792132EECE56F6D898A", "LostMessage":"Message" }

Any idea what could cause this error.

Error 1002 from escrowKeyUnlock indicates the server did not find the specified device. I suggest double-checking how you identified the device in the request.

If that doesn't help, I suggest capturing the entire request and response and providing it in feedback to Apple. You can file developer feedback at https://feedbackassistant.apple.com/

I have filed the feedback. Number is 15020185

@Engineer I should have mentioned that iPhone is not involved in any way in this process. All requests are send between apple and mdm server. Even the escrow key is generated on mdm server side.

IOS MDM Activation Unlock Not Working
 
 
Q