Adding the user Manager and His manager to the Deal Function

Adding the user Manager and His manager to the Deal Function

Hello Zoho Team & Community:
I need to write a function that brings the current user the deal owner "reporting line" i.e his manager and his manager manager and insert it into the Deal.

I am assuming i would use the Get Users API or the Role API? Would I be able to get the manager and his manager as well?

Thank you for helping me out in this