SeamAPIException: status=404, request_id=4b1d2f1b-3988-4949-9279-fddef25dc9ae, metadata={'type': 'access_code_not_found', 'message': 'Could not find an access_code with device_id or access_code_id', 'data': {'access_code_id': '11111111-1111-1111-1111-555555555555'}, 'request_id': '4b1d2f1b-3988-4949-9279-fddef25dc9ae'}
Once the access code has been deleted, a request to get the access code returns a 404 error.
Request:
# Use GET or POST.curl-X'GET' \'https://connect.getseam.com/access_codes/get' \-H'accept: application/json' \-H"Authorization: Bearer ${SEAM_API_KEY}" \-H'Content-Type: application/json' \-d'{ "access_code_id": "11111111-1111-1111-1111-555555555555"}'
Response:
{"error": {"type":"access_code_not_found","message":"Could not find an access_code with device_id or access_code_id","data": {"access_code_id":"11111111-1111-1111-1111-555555555555" },"request_id":"e034a368-1936-418e-8219-dbc99b49165e" },"ok":false}
SeamAPIError: Could not find an access_code with device_id or access_code_id at file:... { status:404, requestId: '799c903f-0768-4249-8226-cff55d3fbdbb', metadata: { type: 'access_code_not_found', message: 'Could not find an access_code with device_id or access_code_id', data: { access_code_id: '11111111-1111-1111-1111-555555555555' }, request_id: '799c903f-0768-4249-8226-cff55d3fbdbb' }}
ApiError{statusCode: 404, body: {error={type=access_code_not_found, message=Could not find an access_code with device_id or access_code_id, data={access_code_id=11111111-1111-1111-1111-555555555555}, request_id=be588519-00c6-4992-9cf0-f77d6b20a120}, ok=false}}
2. Verify that the access code has been removed
There are two methods to verify that an access code has been removed:
Polling method
Utilize the action_attempt_id provided in the response from the deletion endpoint to call the Get Action Attempt endpoint. Typically, you'd poll this endpoint until the status reads success.
Here, you'll need to keep an eye on incoming webhook events. Specifically, watch for the access_code.deleted and access_code.removed_from_device events. These signify successful access code deletion and its removal from the device, respectively. It's worth noting that if you delete an access code that was never programmed onto a device, the access_code.removed_from_device event won't be triggered.
If, however, you encounter access_code.failed_to_remove_from_device or access_code.delay_in_removing_from_device events, it's imperative to consult the "Troubleshooting access code issues" guide.