Keys for logging onto and using the athom-api

Did you see my second post in [Unsupported] Homey v2 REST API?
In short, the returned html in step 2 contains a form, fill it and POST it. That will give you the 302 and the delegation code in the headers.