def Send_message(access_token):
msg_sending_URL = "https://kapi.kakao.com/v2/api/talk/memo/default/send"
headers = {
"Content-Type" : "application/x-www-form-urlencoded charset=utf-8",
"Authorizaion" : "Bearer " + access_token
}
data_raw = {
"object_type" : "feed",
"content" : "Today's WeatherForecast",
"item_content" : {
"profile_text" : "오늘의 날씨",
"title_image_text" : OW_dic_wthr["description"],
"title_image_category" : OW_dic_wthr["main"],
"items" : [
{
"item" :"평균기온",
"item_op" : str(OW_dic_main["temp"]) + "°C"
},
{
"item" :"체감기온",
"item_op" : str(OW_dic_main["feels_like"]) + "°C"
},
{
"item" :"최저기온",
"item_op" : str(OW_dic_main["temp_min"]) + "°C"
},
{
"item" :"최고기온",
"item_op" : str(OW_dic_main["temp_max"]) + "°C"
}
]
},
"buttons" : [
{
"title" : "네이버 날씨",
"link" : "https://m.search.naver.com/search.naver?sm=mtp_hty.top&where=m&query=오늘+서울+날씨"
}
]
}
data = {'template_object' : json.dumps(data_raw, ensure_ascii=False)}
msg_rqst = requests.post(msg_sending_URL, headers=headers, data=data)
return print(msg_rqst.content, access_token)
b’{“msg”:“access token should not be null or empty”,“code”:-401}’ {엑세스 토큰(정상 출력)}
앱 ID 743874 입니다
엑세스 토큰이 정상적으로 출력되는 것을 확인하였으나 모종의 이유로 토큰이 요청에 포함되지 않는 것 같습니다 혹시 무슨 문제인지 아시는 분이 있으시다면 댓글 부탁드립니다…