$p_ms_message_text =$query[‘ms_message_text’]; (쿼리에서 받은text)
$stmt2 = $pjhDB_conn->prepare(“SELECT * FROM kara_member WHERE my_kakao_id = ‘$session_kakao_id’ and ms_time = ‘$p_ms_time’”);
$stmt2->bind_param(“ss”, $session_kakao_id, $p_ms_time);
$stmt2->execute();
$result2 = $stmt2->get_result();
$p_k_kakao_uuid = array();
while ($row = $result2->fetch_array()) {
$p_k_kakao_uuid[] = $row[‘k_kakao_uuid’];
}
if (isset($response->access_token)) {
$access_token = $response->access_token;
if (isset($p_k_kakao_uuid)) {
foreach ($p_k_kakao_uuid as $uuid) {
$url = ‘https://kapi.kakao.com/v1/api/talk/friends/message/default/send’;
$uuids = urlencode(‘[’ . $uuid . ‘]’);
$template_object = urlencode(‘{
“object_type”: “text”,
“text”: “텍스트 영역입니다. 최대 200자 표시 가능합니다.”,
“link”:{
“web_url”:“http://www.kakaocorp.com”
}
}’);
$post_params = “receiver_uuids=” . $uuids_encoded . “&template_object=” . $template_object;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/x-www-form-urlencoded’,
'Authorization: Bearer ’ . $access_token
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if($response === false)
{
echo 'cURL 오류: ’ . curl_error($ch);
}
else
{
echo $response;
}
성공했다고 나오는데…???
{“successful_receiver_uuids”:[“W2NVZlRlVWFYdEZ-S3tIcEV3Qm5fb15uVmVdLA”]}
문법오류인가…!!! 잘모르겠네요
ID 1010838