Is there a slack api for updating user status in the future? - slack

With reference to setting custom user status on slack the documentation covers how to pass the timestamp when it would expire, but I could not find any mention of how to set the starting timestamp.
My question is if there is a slack api that would allow setting the user status, especially when the start time for the status is in the future?

There are no arguments or API methods for schedule a future custom status unfortunately. To accomplish this, you would have to schedule it server-side using a cron job or similar.
Slack is working on a new platform, currently in beta, that in its final form should allow you to create "scheduled triggers" that could then call a function that updates a user's status as part of a workflow. User token/authorization support is not yet supported in the beta but should be there soon.

Related

How to be aware of the creation of a new event in a google calendar? [duplicate]

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

How do you get information on the transaction status in braintree asynchonously?

So when I submit a braintree order for settlement, there will/can be multiple state changes until I get my money. It can settle, stay in settling, get declined, and so on.
How can I get this information without having to call their API constantly? Is there some kind of webhook for that? Because in my tests, I only get updates for disbursements, which is (if I understood it correctly) basically the last step of the whole transaction.
There are webhooks for some events, but not for specifically when a transaction changes status.
You can, however, use the Search API to create a script or cron job that checks for status changes over a period of time.
If you have additional questions about webhooks or using the API, contact Support.

Triggering scheduled reminders based on new Intercom customers

I don't even know if SO is the right place for this question but I thought I'd give it a go as I've found answers on here before.
I'm trying to solve the following issue using widely available SaaS tools if possible as non devs will be using/managing this process.
We are trying to set up an internal scheduled reminder system for our team to make following up with our customers easier, Our work tool set is pretty standard:
Our CRM is Intercom,
Slack is used for internal chat
Notion for task management
Stripe for payments.
We would want it to go a little like this:
1.Customer signs up.
2.Intercom tags new customer.
3.Tag Triggers scheduled reminders (After 1, 3, 5, 7 days etc.) in Slack or Notion (preferably)/ or something else.
I've looked into Triggering reminders in Slack based on new messages in a channel as well as Using Zapier and IFTTT but haven't found a way thus far.
Any advice on tools/services that would help would be appreciated.
This is easily achievable on zapier.
It would look something like this.
trigger (customer signs up), Intercom: New Company
optional: add a filter where it will only continue if the new company has certain
tags
action, "delay by zapier" 1 day
do something, ie. post to slack/send email..
action, "delay by zapier" 2 days
do something, ie. post to slack/send email..
action, "delay by zapier" 2 days
do something, ie. post to slack/send email..
action, "delay by zapier" 2 days
do something, ie. post to slack/send email..

Slack logon trigger

I want to create something in Slack that sends a message (starting by calling someone with '#') to a channel when specific users login. I've checked ifttt and zapier. I also checked the slack api to create something myself, but I couldn't really find anything usefull.
Anyone has any ideas?
Slack does not track user login or logoff in a traditional sense. Instead, users are always always "logged in" and available to receive messages once they have joined a team / channel.
There also is the concept of "presence", which is related, but not the same thing. User presence can change multiple times during a few minutes, e.g. if the user is on a mobile. I am guessing you would not want to send the user your message that often.
Still you can poll the presence information of a user with the API users.getPresence , which could be used to implement a script that polls this information on a regular basis and send your message. You also want to filter out presence changes below a certain duration threshold.
Keep in mind though that the rate limit for API methods is 1 per second. So depending on how many users you have in your workspace there will be a significant delay between the user becoming "present" and your script being able to send the message.
There is a workaround for that to have a google sheet as a database for the users and you can trigger by day once and timestamp it.
So the best trigger is a private message or public and you can use filter when mentioning or signin or signout it depends on the trigger word then you pass the filter since zapier won't count your zaps if you used fiter as a second step.

Google Calendar event Created/Updated/Deleted Webhook?

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

Resources