How can I create meeting with 3 persons using Google Calendar's API? - calendar

I am building a recruiting platform where an employer can book a meeting with a potential candidate. The owner of the website must be in this meeting.
So, basically, I would need to create a Google Meet with 3 invitations (us + 2 other people with email that are changing). Is there a way to achieve that using the Calendar API?
Thanks

When creating Calendar Events with Google Meet using Events.insert method, you need to do the following:
Set conferenceDataVersion parameter to 1
Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData.
To create new conference details, use createRequest field of conferenceData. Set conferenceSolutionKey type to "hangoutsMeet" and set a random string for requestId in the request body.
Sample conferenceData:
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "7qxalsvy0exxaje"
}
}
If you want to send meeting invite to different people using Events.insert method, you need to do the following:
Set sendUpdates parameter to "all" to send notifications to all the guests invited.
Add event guests' using attendees properties in the request body.
Sample:
"attendees": [
{
"email": "user1#email.com"
},
{
"email": "user2#email.com"
}
],
Sample Events.insert parameters and request body:
{
"end": {
"dateTime": "2021-01-01T04:00:00+08:00"
},
"start": {
"dateTime": "2021-01-01T03:00:00+08:00"
},
"attendees": [
{
"email": "user1#email.com"
},
{
"email": "user2#email.com"
}
],
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "7qxalsvy0exxaje"
}
},
"summary": "Sample Meeting"
}
Output:
References:
Create Events using Calendar API
Add video and phone conferences to events
Calendar API Reference

Related

Create Event linked to Team Channel - Microsoft Api Graph

I'm trying to create an event into a calendar that mocks an event created directly on Microsoft Teams. So basically when you create an event via Microsoft Teams you can specify the group & the channel that must be part of the event.
I'm using the proper endpoint: https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http.
This is the info I'm passing as post request :
{
subject:"Event Subjct",
isOrganizer: true,
start: {
dateTime:"2020-12-29T12:00:00",
timeZone:"Pacific Standard Time"
},
end: {
dateTime:"2020-12-29T14:00:00",
timeZone:"Pacific Standard Time"
},
isAllDay: false,
allowNewTimeProposals: true,
isOnlineMeeting: true,
attendees: {
{
emailAddress: {
address:"<groupName#emailaddress.ext>", <-- got directly from Azure
name:"<TeamGroupName>"
},
type:"required"
}
},
hideAttendees: false,
type: "singleInstance",
transactionId: "<UNIQUE_ID>",
onlineMeetingProvider: "teamsForBusiness"
}
Note: all values between <..> are placeholder.
The event is correctly created but there's no reference on the Team channel group specified in the attendees field. I've search the definition of attendees array and there's nothing specific to note a group+channel in the attendee collection : https://learn.microsoft.com/en-us/graph/api/resources/attendee?view=graph-rest-1.0
Any help?
Thanks
You need to use the following API call to create the event in the Groups. For example, you need to use:
POST https://graph.microsoft.com/v1.0/groups/01d4ee64-15ce-491e-bad1-b91aa3223df4/events
Content-type: application/json
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2019-06-16T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-06-16T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Cafe"
},
"attendees": [
{
"emailAddress": {
"address":"adelev#contoso.onmicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
]
}

How to create a new google meet using google calendar api

I need implement a javascript project that creates a new google meet according to the user signed in and adds the event to the calendar and gets the url of the google meet. How can i create a new google meet using Google Calendar API in JS.
Answer:
You need to use the conferenceData.createRequest parameter of the Events resource when creating a Calendar.Events: insert request to add a Meet link to a Calendar Event.
More Information:
As per the documention for Events: insert and the Event resource reperesentation:
conferenceDataVersion: integer
Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. Acceptable values are 0 to 1, inclusive.
conferenceData.createRequest: nested object
A request to generate a new conference and attach it to the event. The data is generated asynchronously. To see whether the data is present check the status field.
Either conferenceSolution and at least one entryPoint, or createRequest is required.
conferenceData.createRequest.conferenceSolutionKey.type: string
The conference solution type.
If a client encounters an unfamiliar or empty type, it should still be able to display the entry points. However, it should disallow modifications.
The possible values are:
"eventHangout" for Hangouts for consumers (http://hangouts.google.com)
"eventNamedHangout" for classic Hangouts for G Suite users (http://hangouts.google.com)
"hangoutsMeet" for Google Meet (http://meet.google.com)
"addOn" for 3P conference providers
conferenceData.createRequest.requestId: string
The client-generated unique ID for this request.
Clients should regenerate this ID for every new request. If an ID provided is the same as for the previous request, the request is ignored.
With this information we can generate a Calendar Event creation request with a Meet link as the conference solution.
Example Request:
gapi.client.calendar.events.insert({
"calendarId": "primary",
"conferenceDataVersion": 1,
"resource": {
"end": {
"date": "2020-10-24"
},
"start": {
"date": "2020-10-23"
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "some-random-string"
}
},
"summary": "titles are cool"
}
});
NB: In order for a Meet link to be generated, you must set conferenceData.createRequest.requestId to any random string. For each new meet link you wish to create, you must use a different string in the request.
References:
Events: insert | Calendar API | Google Developers
Events | Calendar API | Google Developers
If you aren't using the node library, the request with axios is below. I did not realize from the answer above conferenceDataVersion is a query param.
let event = {
summary: "some text",
location: "some text",
description: "some text",
start: {
dateTime: start,
timeZone: timeZone,
},
end: {
dateTime: end,
timeZone: timeZone,
},
recurrence: [],
attendees: [
{ email: 'johndoe#whatever.com' },
],
reminders: {
useDefault: true,
},
conferenceData: {
createRequest: {
conferenceSolutionKey: {
type: 'hangoutsMeet',
},
requestId: 'somerequestid',
},
},
};
const createEventRequest = await axios({
url: `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?conferenceDataVersion=1`,
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
},
data: event,
});
Extending #Brit's comment in googleapis npm package the way it should be executed will be
let response = await calendar.events.insert({
auth: auth,
calendarId: calendarId,
resource: event,
conferenceDataVersion: 1
});
with event as
let event = {
'summary': `Appointment.`,
'description': `Description`,
'start': {
'dateTime': dateTime['start'],
'timeZone': 'Asia/Kolkata'
},
'end': {
'dateTime': dateTime['end'],
'timeZone': 'Asia/Kolkata'
},
'attendees': [
{'email': '...#gmail.com'},
],
'reminders': {
'useDefault': false,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10},
],
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "JksKJJSK1KJSK"
}
},
};

microsoft graph filter assigned role

In Azure Active Directory I created an app, in the manifest file I've update the appRoles with the following value:
"appRoles": [
{
"allowedMemberTypes": [
"User"
],
"displayName": "Client manager",
"id": "bf77e391-0bbf-4e33-854b-a384a5ac0630",
"isEnabled": true,
"description": "Client manager can manage all client actions.",
"value": "ClientManager"
}]
I updated my user so that my assigned role is no longer Default Access but is Client manager
With Graph api I'm trying to retrieve this assigned role.
I tried this uri but for some reason it will not return my role(s).
https://graph.microsoft.com/beta/me/appRoleAssignments?$filter=resourceId eq 04dcaab1-7219-4689-8510-4672e957ac11$select=appRoleId
But the response is:
{
"error": {
"code": "BadRequest",
"message": "Invalid filter clause",
"innerError": {
"request-id": "ce3cb456-956b-41c5-84a2-cdcdfe1ac3c5",
"date": "2018-11-05T20:54:08"
}
}
}
I could create a workaround requesting all my roles, for all my applications but this is something I would like to avoid. This would end up with the following uri:
https://graph.microsoft.com/beta/me/appRoleAssignments?$select=resourceId,appRoleId
and results in this json, where I need to filter out my applicationid.
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#appRoleAssignments(resourceId,appRoleId)",
"value": [
{
"appRoleId": "00000000-0000-0000-0000-000000000000",
"resourceId": "667cc3aa-00b9-4526-bde5-b81312ed5afb"
},
{
"appRoleId": "00000000-0000-0000-0000-000000000000",
"resourceId": "64b92ac1-4a56-478c-8774-5c584fb200e5"
},
{
"appRoleId": "bf77e391-0bbf-4e33-854b-a384a5ac0630",
"resourceId": "04dcaab1-7219-4689-8510-4672e957ac11"
}
]
}
I tried several solutions proposed on StackOverflow already but for some reason, all the eq filters don't work. I'm testing my query with the Graph explorer. My desired result should be something like this:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#appRoleAssignments(appRoleId)",
"value": [
{
"appRoleId": "bf77e391-0bbf-4e33-854b-a384a5ac0630"
}
]
}
It seems not support to filter resourceId with https://graph.microsoft.com/beta/me/appRoleAssignments.
As mentioned in the doc:
Not all parameters are supported across all Microsoft Graph APIs, and support might differ significantly between the v1.0 and beta endpoints.
Also, if we filter the id with GET https://graph.microsoft.com/beta/me/appRoleAssignments?$filter=id eq 'xxxxxxx', it will work fine. So I think the format of the query should be correct, the only possibility is it is not supported as mentioned in the doc.

"Send To Messenger" page scoped user id, different to messenger id

When using the "Send To Messenger" plugin, the response received is:
{
"object": "page",
"entry": [
{
"id": "410441912660258",
"time": 1506529761355,
"messaging": [
{
"recipient": {
"id": "410441912660258"
},
"timestamp": 1506529761355,
"sender": {
"id": "1388094137927363"
},
"optin": {
"ref": "login"
}
}
]
}
]
}
However, when I interact with Messenger using the same Messenger Account, Facebook sends:
{
"originalRequest": {
"source": "facebook",
"data": {
"sender": {
"id": "1271682282961502"
},
"recipient": {
"id": "1818762375111057"
},
"message": {
"mid": "mid.$cAAZ2J6JWBDZk9XGKQVexCxoKu27Y",
"text": "hi",
"seq": 17289
},
"timestamp": 1506529788481
}
}
}
Note that, despite using the same Messenger account, the sender/recipient IDs are different. So I can't match any users up from the Messenger Chat vs the Send To Messenger button.
I believe this is because the "Send To Messenger" button is using the Page Scoped User ID of the relevant Facebook Page, instead of the Facebook App. Is there any way to match these two IDs or, to tell the Send To Messenger button to use the APP ID instead of the Page ID?
You can use the ID matching API
https://developers.facebook.com/docs/messenger-platform/identity/id-matching

Is it possible to add a description to the Cloud Endpoint fields in the API Explorer?

I have seen this in the Google API's. Is it possible for Cloud Endpoints as well?
https://developers.google.com/apis-explorer/#p/adexchangebuyer/v1.2/adexchangebuyer.accounts.get
It's totally possible. We've had some StackOverflow posts about monkey patching and this would be another prime example.
For example:
How do I specify my own icons so they show up in a Google Endpoints API discovery document?
For this case, the content served at /_ah/spi/BackendService.getApiConfigs contains your API config and the "description" you want here is for a "parameter".
So for example in the method
#endpoints.method(MySchema, MySchema,
path='myschema/{strField}', name='myschema.echo')
def MySchemaEcho(self, request):
return request
the field strField is a path "parameter" and so in the API config we would see
{
...
"methods": {
"myapi.myschema.echo": {
...
"request": {
...
"parameters": {
"strField": {
"required": true,
"type": "string"
}
}
},
...
}
...
}
}
To get your description in there you would need to add it to the dictionary listed under strField so that it reads
"strField": {
"required": true,
"type": "string",
"description": "Most important field that ever was."
}

Resources