Issue
I am using Copilot API of twillio to send sms. so i am able to send sms to end user. Now if user reply to that sms, i am receiving the callback (PHP Script). Using that callback URL, i am able to get the reply message.
Now i want to do is, i am trying to find a relation between sent and received(which end user reply) message. so i can then forward the reply message to their sender.
I will have UI like below, where user enter the message and number where he wants to receive reply.
But the problem is i am not able to find relation between send/receive message.
Any advice will be helpful.
Solution
Twilio developer evangelist here.
Other than storing the information on your server upon sending/receiving a message, you could make use of the cookies stored at Twilio.
When Twilio makes a request to your server and it returns a cookie (a Set-Cookie
HTTP response header), Twilio stores this cookie and associates it with the From
and To
numbers for the incoming call or SMS message.
A little caveat to this is the fact that this cookie is only stored for four hours, so unless that works for you, I'd suggest using the from
& the to
as composite keys to find a relation.
Hope this helps you
Answered By - Marcos Placona Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.