import requests # Replace YOUR_DIRECT_LINE_SECRET with your bot's Direct Line secret direct_line_secret = 'eyJhbGciOiJSUzI1NiIsImtpZCI6Ik5MZjUwanFheTN1R0VpQUpOV29EWmZzRnE4QSIsIng1dCI6Ik5MZjUwanFheTN1R0VpQUpOV29EWmZzRnE4QSIsInR5cCI6IkpXVCJ9.eyJib3QiOiI0OWU3Mzc4Yy02MGEyLTk0MTAtZmVhYy0zNjNjYzBiZjYzMjgiLCJzaXRlIjoiV2lkbl9BY05tWTQiLCJjb252IjoiSzJCRnlWeW05a2JzS01LMmNPYWNNLWV1IiwibmJmIjoxNzE5MzMxMDE2LCJleHAiOjE3MTkzMzQ2MTYsImlzcyI6Imh0dHBzOi8vZGlyZWN0bGluZS5ib3RmcmFtZXdvcmsuY29tLyIsImF1ZCI6Imh0dHBzOi8vZGlyZWN0bGluZS5ib3RmcmFtZXdvcmsuY29tLyJ9.He-xwjJujuDaUAoJzo_c8-GfhM00CGeg2VPJKTQK5D7OR7iahEG2JZN4ZsR1XP1WIX84nuRXPDEMLeIV4m54dJkRpHmGMy0GxUnrjcV0kFvaEXs8PpEqWIEyV8il2YrpHino_XuGoaUYgl7hsqyNnRrIKH4eICqr_V4VSi5nQ5ZXoEEnVjUc9OsdpSLGE6O4yKJkAfavqf5tdyqMLz0uqD_QdOJRPlD_Ps3HDveiwVc8gF3i_Fb0U9JrwLFoDnz5XFZuU-bNT4c52rqKdlnu_anLCwPMYJx9KAI80YEorrXTntCji4tnOtB8r_wdEQlgffIHhuogWrobN2j8G99oBw' # Set the headers for the request headers = { 'Authorization': 'Bearer ' + direct_line_secret, 'Content-Type': 'application/json' } # Set the parameters for the request data = { 'type': 'message', 'from': { 'id': 'cohitai' }, 'text': 'fuk ya diggah?! <#' } # Send the request to the Direct Line API response = requests.post('https://europe.directline.botframework.com/v3/directline/conversations/K2BFyVym9kbsKMK2cOacM-eu/activities', json=data, headers=headers) # Print the response status code print(response.status_code) print(response.json()) print(response.content)