简体   繁体   English

Nexmo入站邮件跟踪

[英]Nexmo Inbound message tracking

I have used below code to send the message using Nexmo. 我已使用以下代码使用Nexmo发送消息。 which is running successfully and I am getting unique messageId in response. 运行成功,并且我得到唯一的messageId作为响应。

$url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
                [
                    'api_key' => env("NEXMO_API_KEY"),
                    'api_secret' => env("NEXMO_API_SECRET"),
                    'to' => $data['to'],
                    'from' => $data['from'],
                    'text' => 'Hi I am sending the message',
                    'callback' => $data['callbackUrl']
                ]
            );
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        $data = json_decode($response);

Response: "message_id": "0D000000890273B7". 响应: “ message_id”:“ 0D000000890273B7”。

After sending the SMS, my customer replied the SMS. 发送短信后,我的客户回复了短信。 and I am trying to track the messages and stored into DB. 我正在尝试跟踪消息并存储到数据库中。 I have set the webhooks callback URL on Nexmo setting. 我在Nexmo设置中设置了webhooks回调URL。 which is also running and dumped the response. 它也正在运行并转储了响应。

[msisdn] => 121#######
[message_id] => 0B000000CB352009
[to] => 1#########
[message_timestamp] => 2018-04-09 15:04:45
[keyword] => YES
[text] => Hello I am replying the message.

Here I noticed that messageId is coming different, so How can we track the replied message is related to this messageId "0D000000890273B7"? 在这里,我注意到messageId有所不同,因此如何跟踪与该messageId“ 0D000000890273B7”相关的邮件? Please help me out. 请帮帮我。 I cannot match with phone number because we are not using phone number as unique. 我无法使用电话号码,因为我们没有使用唯一的电话号码。

There is no way to perfectly correlate SMS 'replies' as there is no concept of reply within the SMS specification, when the user sends a reply on their handset they are in fact composing a new message to the senderID of the message they received but no data is shared betweeen messages, all you have in an SMS is TO, FROM, TEXT and a TIMESTAMP. SMS规范中没有答复的概念,因此无法完美地关联SMS“答复”,当用户在手机上发送答复时,他们实际上是在将新消息编写为接收到的消息的senderID,但没有数据是在消息之间共享的,在SMS中,您只有TO,FROM,TEXT和TIMESTAMP。 Everything else is local to the handset operating systems 其他所有内容都在手机操作系统本地

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM