Google calendars list api not return all calendars list - google-api

I try to get list of all calendars. Before it I add list of calendars and all responses of it haven't errors.
For example. I add calendar by call gapi.client.calendar.calendars.insert(calendar)
That response
conferenceProperties: {allowedConferenceSolutionTypes: Array(1)}
etag: "\"mLdC9UBbokhJHET35TaxkwSqyN8\""
id: "6nvf0pgoqtrj66hek501das2e4#group.calendar.google.com"
kind: "calendar#calendar"
result: {kind: 'calendar#calendar', etag: '"mLdC9UBbokhJHET35TaxkwSqyN8"', id: '6nvf0pgoqtrj66hek501das2e4#group.calendar.google.com', summary: 'Alejandro Martinez', timeZone: 'UTC', …}
summary: "Alejandro Martinez"
timeZone: "UTC"
After that I check my google calendar and see that calendar in list.
Next I try to add events in it. Because I use list of calendars and theirs events I firstly check for has it calendar been added. And try to get list of calendars to call - gapi.client.calendar.calendarList.list()
And some times, have been added calendars not returend in the gapi.client.calendar.calendarList.list() response. I see it in calendars list in google calendars, I have successfull response when I add it, but I don't have it in calendars list response.

Related

Get Recent Campaign Sends from Mailchimp API

I'm trying to pull the latest sends from all my campaigns in Mailchimp via the 3.0 API. The only way I seem to be able to do this is:
1) Search for a given member by email
/3.0/search-members?query=joe#example.com
2) Get the member ID and request their activity
3.0/lists/{LIST ID}/members/{USER ID}/activity
3) Pull the content of the email in their activity feed:
3.0/campaigns/{CAMPAIGN ID}/content
The problem with this is that I need to know the user's email in advance and then search by each user individually, meaning many wasted of API calls.
Is there an endpoint for campaigns that I can request the last sends for a given date range?
The /campaigns endpoint returns campaigns for a given list and each returned object does include a recipients property.
You may also want to checkout:
/search-campaigns
And:
/reports/{campaign_id}/sent-to

Google Classroom: Find userId from the google doc

How can I find the userId of the student to which a CourseWorkSubmission has been submitted?
Steps:
Student is assigned coursework using Google Classrooms.
Teacher views coursework (docs.google.com URL).
I click Add On, to try and pull out student info, but can't find the context for the student (e.g. userId, actorId) or even the submissionId in order to make a call to the API to get the information.
Any help or pointers gratefully received :)
References:
Have checked out the Google Classroom API:
https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get
And the Google Drive API:
https://developers.google.com/drive/v3/web/about-sdk
When you do your get of the studentSubmission here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get the response will contain a userId. That userID is the Students google ID you're looking for.
Go ahead and run the Try this API functionality on the https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get page and you should see what I"m talking about.
The full response information is listed here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions
If you're having a problem finding the relevant courseWork ID, then use the list capability here https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/list (Put a - in for the courseWorkId)

Tracking Opens using MailChimp API V3

I'm looking to replicate the functionality of this call in V3 of the MailChimp API:
https://apidocs.mailchimp.com/api/2.0/reports/opened.php
Is there a way to track campaign opens for an email address in V3?
I've been trying the Report/campaign/email-activity/subscriber URL and I'm able to return all their details but the Activity field is always empty no matter who I call.
Edit: The only way I've found so far is to query the Member's Activity. This gives an output on all the 'opens' for a specific email address but sadly not a list of campaign specific opens.
If your campaign is multivariate (has more than one email format), then you have to use the campaignId of the combinations to get email-activity. You can get those campaignId's using the endpoint /campaigns/{campaign_id}. It will be under variate_settings -> combinations -> id in the response

Google Calendar API V3 - Attendees

In Google Contacts you can create a group.
You assign contacts to the group.
You go to Google Calendar, create a new event add the Group as guests (which adds them as attendees).
If you query the event using Google Calendar Api V3 you can get a list of attendees but the only data is DisplayName, Email and ResponseStatus.
Question: Is there no way to match up the attendees of a Calendar event with your google contacts? You could match using DisplayName and Email or combination of both but that will be prone to error.
Google Calendar events.get returns an events resource
an event resource only contains the following information about an attendee
"attendees": [
{
"id": string,
"email": string,
"displayName": string,
"organizer": boolean,
"self": boolean,
"resource": boolean,
"optional": boolean,
"responseStatus": string,
"comment": string,
"additionalGuests": integer
}
],
The Google Contacts api is an old Gdata api, that being said its very limited to what you can do with it. I am not even sure if you can search on them or if you just get a full list of all of a users contacts back Contacts.Getcontacts in which case you are just going to have to scan though them yourself.
If you are looking for more information on the person in question a crazy idea would be to try the People.search method in the Google+ api. If you where to say search on the name of the person, get a list back of all the people matching that persons name if you are lucky they have email public you could then match the email to that. However this will only work if the person in question has their email address set to public.
Could you try and describe a bit in your question exactly what it is you are trying to achieve with this?

How to notify specific people with yammer REST api

I would like to notify a specific set of people when posting a message with Yammer's REST API. The desired effect should be the same as "Add people to notify" in the native web application:
After some research with the REST API documentation, i found the direct_to_id field in the request data object.
direct_to_id - Send a private message directly to the user indicated.
I'm not sure what this attribute actually does, so I tried the following:
var data = {
"body": "test message",
"group_id": XXXXXX, //a valid group id
"direct_to_id": XXXXXXXXXX, //a valid user id
};
but after I add the "direct_to_id" field to my post, i get a 400 (bad request) error. I also don't know if this method works with notifications to multiple users.
Ok, i figured it out by reverse engineering the yammer embed widget. When posting a message with people to be notified, yammer embed set a "cc" field in the web form, according to fiddler:
In javascript, simply do this:
var data = {
"body": "test message",
"group_id": XXXXXX,
"cc": "[[user:XXXXXX]],[[user:XXXXXX]]",
};
This approach is not documented in Yammer's API so I'm not sure if it will be supported in the future. In the meanwhile, I really wish that Yammer had better documentation. It would save developers lots of time and trouble.

Resources