Slack api activate users.getPresence() method - amazon-web-services

I have problem with slack api exactly every change in slack is saved in separate json file.But problem is that I want to get when user's active/away change in json,but I can't get this information in json.I found that there is user.read scope with users.getPresence() method.Also users.info() method in user.read scope works and I have json with that information.Any ideas why one method works but another doesn't work?

You seem to be using the Slack Web API in place of the Slack RTM and events. What you need is to subscribe to the presence_change event. Ensure you subscribe to presence events for the specified users using presence_sub. You will be notified when a user changes the presence and from the response you can fetch and parse your json. Find more about this event here

Related

DialogFlow, modify user request

for my dialogflow project I would like to intercept the user request before the dialogflow responds with the appropriated intent.
My goal:
-The user sends a request with an input message
-I access this message, I transform it (I apply a function to it) and then it is delivered to the dialogflow (so dialog.
I'm using a webhook linked to an specific intent. I'm using cloud functions to handle the webhook.
I would like to access the request using this webhook, modify the original request and allow dialogflow to respond according to this new modified request.
I hope I've made myself clear.
Thank you very much in advance!
I think it is not possible using a webhook, I suggest you to take a look at the Dialogflow fulfillment documentation. As you can see in the architecture representation, your webhook is behind of the intent matched, so the user request has been processed by Dialogflow and the fulfillment will perform actions based on the matched intent, so you only be able to modify the task on the service that you defined within the fulfillment and its response.
You could be able to do this according to your use-case, if you're using a custom development to make calls to the Dialogflow API, you can add an additional step between End-User and Dialogflow where you could intercept the user request, modify it and then send it to the Dialogflow API.
If you’re using any integrations such as Action on Google or Dialogflow Hangouts, this will not be possible since these services are the ones that manage the calls to the Dialogflow API.

Can I send an HTTP request to an Alexa's Skill Endpoint in order to trigger a reprompt in Alexa?

The scenario would be this.
I would start the skill with the corresponding command ("Alexa, do whatever.."), handle the subsequent LaunchRequest in the Skill Endpoint, and later (minutes later), Alexa would prompt the user with some question.
I'd like to know if I can trigger that late prompt (reprompt actually) in Alexa by sending a request to the corresponding Endpoint from a third Web Service. I guess I can handle HTTP request in the Endpoint (AWS Lambda function or whatever), but I don't know if I can trigger reactions in Alexa withouth it starting them first.
I don't think this would be allowed as it would break a fundamental privacy issue whereby interactions need to be initiated by the user and so be against the Alexa TOS.
If your "reprompt" doesn't actually require some 3rd party trigger e.g if you don't what to run something in response to a code event, then you could look at the reminders API.
You do need to request their permission initially to do this, so it would potentially change your flow somewhat, but then you could prompt them to re-engage with your skill this way.

messages API twitter Challenge-Response Checks

I've seen that twitter changed their endpoints to get and send direct messages, I noticed from a reply from here that it is a workaround to be able to send messages with well-known libraries such as tweepy, but all I need in this case is to list the messages in my inbox.
I've noticed that there is an account activity api which I can use to achieve this goal.
But, I do not understand how to implement Challenge-Response Checks, can you provide an example? how twitter checks this? it is through a post request to my site? to what specific URI they do this? I tried sending a pipedream url as webhook (to see what kind of request they were doing, but absolutely no request was shown)
The account activity endpoint is part of Twitter's Premium product - so you may need to pay to use it. They have comprehensive documentation on the CRC - that includes a sample Python implementation.
I think you will find it easier to use to use the GET direct_messages/events/list API call.
That will list all of the messages in your inbox for the last 30 days.

Aftership webhook tracking API

I am developing one e-commerce app project where I have to track the order status. I use Aftership Webhook API. Webhook provides a tracking event updates to our specified webhook URL(defined in our server). I read documentation but I dont know the proper approach to test the API. and in documentation it is also not defined. Can anyone tell or suggest me how can I test or track the updates.
To test Aftership API, first, you can follow the API reference to get your API key. And to tracking an order with webhook, your need to do the POST /trackings to https://api.aftership.com/v4 beforehand with body like(you can add optional parameter to the request body):
{"tracking": {"tracking_number": "<order tracking number>"}
And then you can follow the webhook documentation and add your webhook URL and configure the types of updates you want to get. At this point, you should be able to see the tracking update HTTP request coming into your webhook URL. Remember it will only send callback request when there is tracking status update.
Also, you can use other tracking APIs to get the status, update the tracking or delete it now.

getting all notifications

I can easily get the unread notifications with this query:
https://graph.facebook.com/USER_ID/notifications?access_token=ACCESS_TOKEN
Is it possible to all the notifications (marked as read) too?
Yes, you can specify the parameter include_read as 1 to indicate you wish to receive read notifications.
https://graph.facebook.com/USER_ID/notifications?include_read=1&access_token=ACCESS_TOKEN
this link may be help you
http://developers.facebook.com/docs/howtos/notifications-api/
Using The API
Applications can generate notifications by issuing a HTTP POST request to the /user_id/notifications Graph API, with a app access_token.
POST /{recipient_userid}/notifications?access_token= … &template= … &href= …