Retrieve emails related to a specifc lead

Hi there,

I am trying to retrieve all the emails associated with a specific lead using rest api.
i use the following code:

$get_lead_email_parameters = array(
ā€˜sessionā€™=>$sessionID,
ā€˜module_nameā€™=>ā€˜Leadsā€™,
ā€˜module_idā€™=>$lead_id,
ā€˜link_field_nameā€™=>ā€˜emailsā€™,
ā€˜related_module_link_name_to_fields_arrayā€™ => array(),
ā€˜related_fieldsā€™ => array(
ā€˜nameā€™,
ā€˜from_addr_nameā€™,
ā€˜reply_to_addrā€™,
ā€˜descriptionā€™,
),
ā€˜deletedā€™ => ā€˜0ā€™,
);
$get_lead_email = call(ā€˜get_relationshipsā€™, $get_lead_email_parameters, $url);

This code works with an opportunity but not with the lead. Why is that so?
Can anyone tell me how do i display all the emails attached with a lead id?

Okay i got it,
outbound emails are attached and not the inbound emails. Inbound emails are not linked directly. I need to a MySQL query to get the inbound emails using parent_id value.