def get_factors(self, user_id):
self.clean_error()<EOL>try:<EOL><INDENT>url = self.get_url(Constants.GET_FACTORS_URL, user_id)<EOL>response = self.execute_call('<STR_LIT>', url)<EOL>auth_factors = []<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>json_data = response.json()<EOL>if json_data and json_data.get('<STR_LIT:data>', None):<EOL><INDENT>for auth_factor_data in json_data['<STR_LIT:data>']['<STR_LIT>']:<EOL><INDENT>if auth_factor_data:<EOL><INDENT>auth_factors.append(AuthFactor(auth_factor_data))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self.error = str(response.status_code)<EOL>self.error_description = self.extract_error_message_from_response(response)<EOL><DEDENT>return auth_factors<EOL><DEDENT>except Exception as e:<EOL><INDENT>self.error = <NUM_LIT><EOL>self.error_description = e.args[<NUM_LIT:0>]<EOL><DEDENT>
Returns a list of authentication factors that are available for user enrollment via API.

:param user_id: Set to the id of the user.
:type user_id: integer

:return: AuthFactor list
:rtype: list[AuthFactor]

See https://developers.onelogin.com/api-docs/1/multi-factor-authentication/available-factors Get Available Authentication Factors documentation