2 factor authentication and find-my login

I try to develop a software which connects to the find-my network to locate devices attached to my Apple-ID.

This should pe possible using web requests. For example I post a request with my credentials to:

https://setup.icloud.com/setup/ws/1/login

This is working in the first step, but now I'm facing the problem that 2 factor authentication is to be used for logging in.

Can someone help me/show me next steps in the login process via web request for 2 factor authentication? (Of course I receive the login authentication code on my apple devices)

Thanks in advance ...
2 factor authentication and find-my login
 
 
Q