How is dead device identification done in windows phone when we make use of micosoft push notification service? Does mspn store information about such devices? Is it possible for an application to retrieve the list?
Uri Channels can expire. This is why you should regularly check and refresh them from the client.
If the channel is no longer valid (as will happen when the app isn't used for a long time and the URI expires) you'll get an error in the repsonse when you try and send the message.
You shoudl use this method to detect URIs that are no longer valid.
There is no way to get a list of URIs that are no longer valid or to test validity without sending a message.
There is no way to ask the server for any expired notification channels however if you look t the response codes coming back from the MS services when you're attempting to send a notification (from your server) you'll be able to determine if the channel has expired. If you look at Push Notification Service Response Codes for Windows Phone you'll note that basically if you get a 404 Not Found back from the service then the channel has been expired and you should stop sending to it. It's worthwhile handling the other cases as well. Eg. Handling 200 OK / QueueFull messages correctly allows you to lighten the workload on your server by pausing notifications for that subscription for a period of time.
Related
I have created a bot in one scenario it will call an API and it will take same time to get the output from that API, if in between user type anything it will start working on the text which user sent recently. I want till API output is not received, if user sent any messages it will get ignored.
If your bot is integrated into some app then you can actually disable the send button until you receive an answer for the previous question.
I am setting one session when user is requesting to talk with Live Agent, Then i am checking if that session is in progress and any new message is coming from user then i am just ignoring them.
Whenever my app posts ephemeral message to Slack channel (in response to a query by a user), I am unable to get the timestamp of my Slack app response. As I want to delete it once the user has made a selection using one of the buttons. Although I have subscribed to 'message.channels' event, I don't get a notification to my app whenever my app posts in the channel (in response to the user input), therefore, I am unable to get the timestamp of the message which I'll use to delete it. All I want is the timestamp of the message posted by my app so that I can delete it but I am unable to receive the timestamp. Please help!
For e.g. in Giphy app for Slack. Let's say the user invokes the app by calling '/giphy [dog]' where 'dog' is just an example of a search term. The app responds by sending a gif and user can either send it, shuffle to the next one or cancel it. I want a similar capability of cancelling the app response but I need the timestamp of the message in order to do so therefore I am asking for help.
Thanks.
Your approach can not work, because Slack is handling ephemeral messages differently from "normal" messages. They are only visible by one user and can not be modified by API methods (e.g. deletion).
But of course its possible to replace ephemeral messages. Here is how:
Your app can just reply to the interactive message request from Slack with a new message. That new message will by default override the original message including ephemeral messages.
You can reply in two ways:
Directly reply to the request from Slack with a message within 3 seconds
Send a message to the response_url from the Slack request within 30 minutes.
See here for the official documentation on how to respond to interactive messages.
This approach works both with interactive messages and slash commands.
See also this answer for a similar situation.
I am working on a project in Twilio and Podio, where I am using this code from Podio using POST
POST IN PODIO
FROM URL: https://[(Ref Setting) Setting Value 1]:[(Ref Setting) Setting Value 2]#api.twilio.com/2010-04-01/Accounts/[(Ref Setting) Setting Value 1]/Messages.json
POST PARMS: To=[(Ref Lead) Mobile Phone]&MessagingServiceSid=[(Ref Setting) Setting Value 3]&Body=[(Variable) strMessages]
---This works fine, and I can send my message no problem, I am using a MessagingServiceSid because my volume has increased I have about 4 numbers in the messaging service.
The problem I am encountering is I had a Twilio Studio Flow set up to handle the incoming text messages when I was just sending from the sid, and I am wanting to figure how if I can make sure that when someone responds to my messages they get sent to the studio flow set up to handle the responses. I am also wanting to get the responses back into Podio.
I have tried changing the Numbers settings in messages settings to that particular studio flow, but when I do that, it takes the number out of the Messaging service that I am using to send the messages.
You need to assign numbers and studio flow to a messaging service.
To assign a number to messaging service:
While configuring a phone number you need to go to its "messaging" section and configure with the messaging service.
To connect messaging service and studio:
1) Goto studio flow -> click on the trigger -> copy the webhook URL
2) Goto messaging service -> inbound setting -> paste the URL in request URL
To get the response back to your servers(I am not familiar with Podio), add an HTTP request block in your studio flow. In that add a request URL pointing towards your server and in the request body you can add the body of text which looks something like FROM:{{trigger.message.From}} BODY:{{trigger.message.Body}}
I tried to follow Abhijeets answer, but unfortunately due to the way messaging services and Twilio phone numbers differ, it's not possible to have the SMS replies work correctly.
I tried to do something similar to you. I was triggering the Flow execution by POSTing to the REST API url trigger, and I used the "Send & wait for reply" widget to send and receive a reply from a number. It worked perfectly when only sending from one phone number, but when I switched the "Send & wait for reply" widget to use a messaging service to send it instead, the responses always triggered the "Incoming Message" start of the Twilio Flow. So it made an entirely new execution, and my previous execution never was completed.
After reading a lot of documentation I could never get around this, so what I did was instead just purchase and assign additional phone numbers to the Twilio flow. In my application, I triggered the Flow execution using these phone numbers (randomly), and then the "Send & wait for reply" widget used this phone number to send out the text message. That ended up working for me, since I was only using messaging services to send out SMS messages with multiple different phone numbers.
It is my very first time to write a slack bot and i am wondering how to design it.
The bot supposed to be available and respond to end-users' messages immediately.
The thing is that I need that the bot will also send schedules messages to registered users with automation results.
Use case example:
A user sends a message to the bot and registered to a service that
will check for changes in X. On a specific interval, my backend will
call an automation that checks for those changes and will send a
message to the user with the results.
What will be the best practice for this scenario?
Here is a basic outline.
1. Basic setup
Slack app with bot user
Database
Scheduler (e.g. local CRON service, or web-cron like cron-job.org)
2. Registration
Use Events API to listen to messages from users send via mention (app_mention) or direct message (message.im)
You app needs to store the received "registration" from each user in a database
Respond to user request directly if needed with chat.postMessage
3. Scheduled response
Scheduler calls your app
Your app check if responses are due with a database query
If yes: App sends responses to users via chat.postMessage (but not more than one message per sec due to rate limiting)
On facebook Chatbot or others platform we can send message directly to the user.
So for one question we can send multiple answer.
Now, that i'm developing for Google Home, I need to do the same.
I didn't find this opttion.
Dialogflow HTTP call to my server is the only output available.
So is there anything i missed to send message back to user in case I have a multiple messages answer?
(Or do I have to bufferise very message my hook creates before sending it back?)
Thanks
The conversation model for the Google Assistant is different - you can only send a message to the user in response to the user sending you a message. You can only send a single response, but it may have multiple parts (up to two Simple responses, containing messages, plus other features such as cards and carousels).
If you need to send multiple things back - you may need to rethink how you're doing it or how much you're sending back at a time. The Assistant is primarily for audible responses, and a long audible response is generally not a good UX.