How to detect a new user in Slack? - slack-api

I'm using Slack API and want to detect an event when user first joins a team but cannot find such type of event in docs.
What should I look for?

I think team_join might be the event you're looking for? Depending on whether you need to respond immediately (and the consequences of missing an event if your bot is offline), you might also consider just calling users.list periodically and comparing to the list of already-seen users.

Related

Access call history in app for Microsoft Teams

While it seems it is not possible for an app to register incoming calls, I wondered if it would be possible to access the call history of the current user?
It looks like there is a Graph API to get information of a specific call by id, I didn't find anything about getting the call history or the last call.
This could be a workaround for our approach: We want to enable the employees to make several notes on incoming calls and reference them with existing items in another web application.
Is there any way to achieve what I'm trying to do?
There seems to be a new Preview way of and application subscribing to a call event though still no way to get the full history.
Application
CallRecords.Read.All:
Subscribe to new call records (POST /beta/subscriptions).
There are more details here https://learn.microsoft.com/en-us/graph/cloud-communications-callrecords but it suggests you could capture the incoming call and allow notes as you want.

Find the voice task currently assigned to a specific worker

This sounds pretty straightforward, but I'm not sure it's something I can do. I want to know what voice task a specific worker is currently working on (if any) without having to store this information on my side when the task is assigned to that worker.
The reason why I'm looking for this because I'm using conferences to pick up incoming calls to agents and I want to implement whisper/barge/coach for supervisors.
They'd know which agents are currently on a call (based on the agent's Busy activity) and based on the workerSid of the agent they want to coach, I want to be able to get the voice task they're currently working on and join that conference (since the TaskSid is also the conference friendly name).
I could loop through the current open tasks, trying to find the right one, but there doesn't seem to be anything on a task that is in an assigned status to indicate who it was assigned to.
The only way I can see to do this using only information I can get from Twilio is a bit too messy:
make a REST API call to https://taskrouter.twilio.com/v1/Workspaces/[workspaceSid]/Workers/[workerSid]/Reservations to get all reservations for that worker for all the tasks that currently exist in the workspace.
find all accepted reservations
loop through the tasks the reservations were made for
and find the latest voice task of those to use.
Any other way would seem to involve looping through conferences that are currently in progress, then loop through their participants to find the call leg made to the contact_uri of the agent to coach to identify the right conference to join, which would be even messier in my opinion.
I'm wondering if there's something obvious that I'm missing.
Twilio developer evangelist here.
The way that you've described seems to be the best way I can find to get this information from the API without storing anything yourself.
If you don't want to store the data in your own server, then you could update a worker's attributes with the current voice task SID. You still have to maintain listening for the end of the call and removing the attribute though.

How to set up user 'tagging' with Parse

I am currently making an app with Parse in which users can upload photos and other users can comment on the photos. I would like to set up a method by which a user can 'tag' another user in a comment, similar to facebook/instagram by typing #username.
I would like this to then send a notification to the mentioned user, but this can be done easily with Parse push notifications. How would i go about setting up the tag feature?
Create a cloud afterSave() function that scans the comment for a user tag (#username). If found, query for the user(s). If username(s) match existing user(s), trigger notification(s).
This involves quite a lot of things to develop if you don't already support notifications. But my outline is what you need to do. How is something you need to try for yourself and then ask specific questions here on SO if you have problems.
You can implement face recognition with OpenCV or natively, check https://developer.apple.com/library/ios/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_detect_faces/ci_detect_faces.html

Eventbrite API: What does event_list_attendees modified_after compare to?

I looked through the questions and found a question somewhat related but it wasn't the same.
If you use the event_list_attendees api call you get back a list of attendees. Those attendees have a modified field. One of the possible parameters in the api call is modified_after.
My question is regarding what triggers the modified field to update? Is this a user profile related field or is it related to this particular event ticket purchase? The api describes these two as the following:
modified_after Return only attendees whose “modified” value is equal
to or after this date/time (e.g., “2013-01-28 00:00:00″)
modified The date and time the event was last modified, in ISO 8601
format (e.g., “2007-12-31 23:59:59″).
Perhaps to explain why I am wondering what triggers modified to update. The goal is to create a small, one day use, mobile website that will allow users to see who has shown up so far for a local event I am working with. I know the api does not directly support this functionality. In my case however "close enough" is "good enough". If someone's ticket being scanned at the door triggers the modified field that would be sufficient.
So, does it?
Great question!
The modified attribute relates only to the individual attendee in the order. So, it won't be triggered by the account wide profile changes for that respective user. However, if a user logs in to Eventbrite and changes the information that specifically relates to this event (example: they change the spelling on their last name for this specific order).
Alternatively, you can actually use /event_list_attendees and set "display_full_barcodes" to "true" to see the status of the barcodes. When the barcode is used, you'll know that someone has been scanned in.
If you come up with a cool hack, then we'd love to check it out!
Hope that helps!

Missing events through the Eventbrite event_search API

I'm using the event_search API method to let my users find their Eventbrite events. I've been getting a lot of complaints from users that their events don't show up. And indeed, it seems that loads of events simply aren't returned by event_search.
One example: http://blogher12.eventbrite.com/. It's a big event, it's starting in a few days time and it has a very distinctive name. It's typically an event that should be very easy to find through event_search.
Yet, it's not anywhere to be seen in event_search's results, no matter what search term I try. You can try yourself at http://developer.eventbrite.com/doc/events/event_search/ - enter 'BlogHer' in the 'keywords' field and you'll get a small handful of fringe events that mention "BlogHer" in their description but not the main event.
This is just one of many missing events I've seen in the past few weeks. I initially thought that the EventBrite API perhaps didn't return events for which ticket sales had closed, which would have explained some of the missing events. But I really can't see any reason for BlogHer to be missing in action.
Is there a trick to get event_search to return all events?
The event owner has configured that event to be 'private', which prevents it from being shared via Eventbrite's public search index.
If you think the event should be public (and accessible via the API), feel free to use the 'contact the host' link on the event page to pass your suggestion on to the event organizer.

Resources