def create_thread(session, member_ids, context_type, context, message):
headers = {<EOL>'<STR_LIT:Content-Type>': '<STR_LIT>'<EOL>}<EOL>thread_data = {<EOL>'<STR_LIT>': member_ids,<EOL>'<STR_LIT>': context_type,<EOL>'<STR_LIT>': context,<EOL>'<STR_LIT:message>': message,<EOL>}<EOL>response = make_post_request(session, '<STR_LIT>', headers,<EOL>form_data=thread_data)<EOL>json_data = response.json()<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>return Thread(json_data['<STR_LIT:result>'])<EOL><DEDENT>else:<EOL><INDENT>raise ThreadNotCreatedException(message=json_data['<STR_LIT:message>'],<EOL>error_code=json_data['<STR_LIT>'],<EOL>request_id=json_data['<STR_LIT>'])<EOL><DEDENT>
Create a thread