Bulk Write API Job - Mapping to Lookup Field

Bulk Write API Job - Mapping to Lookup Field

Hi, I'm new to Zoho and I am working on writing a process to automate data imports to a company's CRM. I'm using the Bulk Write API with the Python SDK. I've successfully written to one module, "Contacts", but I have not been able to write to the "Licenses" module, because there is a mandatory field that is a lookup, and I cannot figure out how to map to this lookup field correctly. Here's a snippet of the code that's causing the problem:

resource = Resource()
resource.set_type(Choice('data'))
resource.set_module('Licenses')
resource.set_file_id('2931751000334796179')
resource.set_ignore_empty(True)
resource.set_find_by('Name')
field_mappings = []
field_mapping = FieldMapping()
field_mapping.set_api_name('Agent')
field_mapping.set_index(0)
field_mapping = FieldMapping()
field_mapping.set_api_name('License_State')
field_mapping.set_index(17)
field_mappings.append(field_mapping)
field_mapping = FieldMapping()
field_mapping.set_api_name('License_Number')
field_mapping.set_index(18)

I've tried different variations of the api name for 'Agent', and tried using field_mapping.set_find_by with different variations as well, but I continue to get the following error:

Status Code: 400
Status: error
Code: MANDATORY_FIELDS_NOT_MAPPED
Details
Message: All mandatory fields are not mapped for the layout [Agent]

Here are the lookup properties of the field in question:



And this is how the field shows up in the Licenses module:


I can see that the field Agent is related to the Agents ("Contacts") module using a related list, but I can't figure out how that relates to how I need to map to this field in the api call.

Any help would be greatly appreciated!