Fetch into child table based on value from the parent doctype

i have doctype called A in this doctype i have a value var as link form another doctype , and in A doctype i have a child table .
i need the best way to fetch some data into this child table once i select a valve var . i will send this value throw api method and i need to fetch the response into the child table .

any help on that!!

I am also having same problem. Will be nice if I get some help if u have achieved the result.
Thanks,Shreeyash