How to do alias in mixpanel on already signedup users? - mixpanel

I wasn't using the alias initially in my app, theres about some 100 users now signed up and events are recorded. Now I would want to do alias on the existing users with some identity string.

For additional context, when the Mixpanel alias method is called, behind the scenes, an event named '$create_alias' is triggered to establish the mapping between your internal uuid and the Mixpanel anonymous distinct_id. To alias users that have already signed up, you could send a '$create_alias' event to the /track API for each user that you would like to alias. You could even batch send these events in batches of up to 50. Further documentation can be found here: https://mixpanel.com/help/reference/http#distinct-id-alias
As a note, this event will not count towards your monthly quota or appear in your Mixpanel project!

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.

Can't get a list owned by me in Google Calendar API

Using Google Calendar API v3 to get the calendar list.
However, some users are not able to retrieve their own owner's calendar.
I tried using the Try this API for CalendarList#list to retrieve it,
but it did not return the owner's calendar.
https://developers.google.com/calendar/v3/reference/calendarList/list
However, if the user specifies calendarId as primary in CalendarList#get,
it can be retrieved successfully.
https://developers.google.com/calendar/v3/reference/calendarList/get
Do you have any advice for me?
Can't get a list owned by me in Google Calendar API
Answer: There is no endpoint which will return a full list of all calendars Owned or that the user simply has access to. As this endpoint does not exist the answer to your question is you cant so its working as intended.
In actually you have misunderstood what the calendarlist is. See below
What is calendarList and how does it work?
The calendarList.List is mealy the list that appears on the bottom left hand side of the UI window. There is no guarantee that a user will have anything in this list as it depends upon how the user added the calendar to the list in the first place. The user could also have deleted it form the list. The UI tends to do it automatically but if it was added programmaticlly it will probably not appear it the users calendarlist. So you should not be relying upon the calendarlist to contain a list of all the calendars a user has access to. please see Events and calendars
All users do however have a primary calendar you can always do calender.get on primary and you will get back the primary calendar for that user.

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.

Accepting calendar invites via Google API

How do I accept a calendar invite using something like the Google Calendar API or the Google Gmail API?
Bonus points if you can point me how to do it in Ruby, but just a hint at which API I should be using would be more than fine.
You should be using events patch.
First create an Event with just the information you want to change. In this case, this will be the single attendee (even if there are multiple attendees) whose response you want to modify (which should be the same as the user under which the call is made), and the corresponding response status ("accepted", "declined", "tentative").
Then you execute patch, passing in the event id and the sparse event created above.
An example in Java is at https://stackoverflow.com/a/41054893/80075

Yammer API Find Pending Users

Is it possible to find a list of Yammer users in the 'pending' state using the API?
(we have a growing list of old invites that need to be purged regularly)
Tried a number of options:
The find all users endpoint, paging to 50 per page seems to only return 'active' users (scanned 100+ pages).
https://www.yammer.com/api/v1/users.json
The find by email endpoint returns all user states, although requires knowing the email.
The export users API endpoint produces a .zip file
Pending users were recently added as mentionable:
https://about.yammer.com/yammer-blog/mentioning-pending-users-designing-building-testing-features-yammer Should this recent change have also made pending users visible via the users.json endpoint ?
I know pending users can be identified in the manual user.csv extract by having no join date, no deletion and no suspended date, although how can they be identified via the API? users.json seems to not provide this functionality.
Has anyone been able to automate the deletion of pending users in Yammer via the API?
You can use the Data Export API. Extract the users.csv from the ZIP file using code and then filter for pending users. Pending users do not have a joined_at, suspended_at, or deleted_at date.
NOTE: If you are intended to "remove" a pending user, you must always check if that email address also has an active user associated. An email address can show up multiple times in users.csv. When you do remove a user always suspend the user because it can be undone.
Here's an endpoint you can run a GET on an return the JSON output of the pending user list:
https://www.yammer.com/<your Yammer network>/contacts/network
Example:
https://www.yammer.com/contoso.com/contacts/network
Note: this is an undocumented endpoint so the functionality could change at any time.

Resources