how can I get with the twilio whatsap api that clients can send messages to the user who registers on my website.
For example, if the user registered with the number 12345, the clients can send messages to the number 12345 of the cell phone.
Then if another user registers with the number 456789, their clients can send messages to the cell phone number 456789 and so on.
At the moment I am thinking of using twilio, but if you can recommend another api that works with nodejs I would appreciate it
i am working with nodejs
thanks
Please Read The Question before down vote. I am building a taxi app backend. the requirement is we want to find driver for user request we placed the request data in sqs now we want to send alert to nearest driver which is easily done by distance calculation. Now We sent alert to to first driver and wait for 30 seconds if the driver reject or not respond to request we want to deliver the request to send driver in distance array. Please Help and thank in advance. I am using node js for backend
Question
How can the Twilio API be used to get overall statistics for all channels and messages with given time ranges?
One example of this statistic is: What is the total message count for all channels today?
Bruteforce method (Non-ideal)
Get all channels for a Twilio service. Get all messages for each channel. Check the timestamp of these messages.
The bruteforce method mentioned above is not scalable. Is there a more efficient way this could be done?
Twilio developer evangelist here.
To get that information from the API, you're right you will need to loop through your channels and fetch the messages.
An alternative is to register for the onMessageSent webhook and aggregate the messages in your own database.
Hope this helps.
I recently aquired a Segway Ninebot ES2 electric scooter. I can connect to the scooter via Bluetooth LE and grab information such as battery status, current mileage, temperature, and so on. This is all done through an application.
On my Android device, I've successfully extraceted the HCI log file, which I imported into Wireshark. I can see all the requests and commands send back and forth between my phone and the scooter. However, the requests and responses are all garbage and I have no idea how to interpret them.
Example of a sent command (info says Sent Write Command, Handle: 0x000e (Nordic UART Service: Nordic UART Tx))
Example of the received value I got right after (info says Rcvd Handle Value Notification, Handle: 0x000b (Nordic UART Service: Nordic UART Rx))
How am I supposed to interpret these responses? If the battery status was 59%, I would expect it to return something like 0x3b (0x3b hex is 59 decimal). But honestly, I have no idea how this works. Maybe they're returning a bunch of data in a data type only their app knows how to interpret? Like JSON for web.
Here's an example from the nRF Connect for Mobile application, where I hit the down arrow on all the characteristics: https://i.imgur.com/hREDomP.jpg (large image)
And probably more important: How do I replicate a request or command in nRF Connect? I've tried sending a byte array that looks like 0x {02410011000d.....} (from the Write Command) in the application, but I have no idea how to read the response.
If someone is still interested, I did the same research for this scooter.
That's standart BLE communacation, device offers BLE "services" and "characteristics". Service can contain one or more characteristics, by which you communicate with device. Each charateristic can allow different types of interaction with it: writing into it, reading from it, subscribing to notifications (so you dont have to to manually read, it kinda pushes data to your app), and more (read here, for example)
Take a look at your wireshark screenshot: you can see Service UUID, Handle UUID (the characteristic), and handle ID. You can communicate with device via uuid or id, depending on your programming language or library (more about uuids).
In this particular scooter there are two characteristics, one allows writing into it, another - allows subscribing to it. Together, they act like RX and TX wires in UART: you write data into one and read from another. So, to begin communication with scooter you must establish connection to it, subscribe for notifications from one ch, and write data to another.
As for protocol: look again at she screenshots, "UART Tx" is the actual payload that was sent to scooter and "UART Rx" was the response. Yes, it's binary data, that only app would understand. Luckily, protocol has been reverse engineered and is well documented. In your example app requests serial number, and it's returned in response - "N2GWX...". In order to request battery percentage you must build another payload according to protocol.
I'm not sure if it's still relevant, but at least for those, who will be interested in the topic.
You can try the following to understand how to interpret response from the device.
An option to consider is to fetch manufacturer's mobile app (apk) either by adb or from sites like apkmirror, etc.
Then apply some reverse-eng tool like JADX.
If you're lucky and the code is somewhat readable, then search for smth that has to do with response (like ResponseParser) and try to find algo that is used to interpret the response.
However, the very first attemp should always be to search on github/google if smb did it already for your device, unless it's very niche.
For the private chat application, how do we identify the persons port do display the appropriate persons message?
is there any port limits for users count?
Think of a port as a bus line number. To get to the city center you probably need to get on a specific bus. Then when you're in the city center (aka you're connected) you can do whatever you want.
Each connection is unique and when it comes to private chatting you should probably identify connections somehow and store them in an array, possibly. This way you can send messages only to a specific receiver.