How to create meeting using RubyOutlook gem? - ruby

I am new here using ruby and outlook and found the gem RubyOutlook which is wrapper around office365 and ruby
How do i create a meeting request using RubyOutlook gem and do we have any help file for doing it

The gem's readme is scarce, so you have to look in the source code.
After creating an oauth token, as described in the readme, you need to call create_event with the token, event json payload, calendar folder (nil for default calendar) and the email of the user who would be the owner of the event:
require 'ruby_outlook'
outlook_client = RubyOutlook::Client.new
# ...
# create oauth token, as described in the readme
# ...
event_payload =
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2014-02-02T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2014-02-02T19:00:00",
"TimeZone": "Pacific Standard Time"
},
"Attendees": [
{
"EmailAddress": {
"Address": "john#example.com",
"Name": "John Doe"
},
"Type": "Required"
}
]
}
outlook_client.create_event(token, event_payload, nil, 'john#example.com')
Here's the relevant Outlook API documentation for creating events. This is where I took the event payload.

Related

MS Teams - automatic addin integration

I built a MS Teams Add-In. If I create a new meeting, I have to add the Add-In every time manually to this meeting.
Is there any way to integrate it to every (new) meeting by default?
Thank you!
Currently there is no way to integrate automatic addin in meeting. Alternatively you can create an event as online meeting using Graph API with below request.
POST https://graph.microsoft.com/v1.0/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does noon work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab#contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
Please go through this documentation for more info.

Outlook/Office365 API - Get Calendar events with Extensions

I am using the Office365 API for calendar events. I am able to create an event successfully with Extensions (custom data) like below...
But, when I get calendar events it does not return back any Extensions data field.
GET https://outlook.office.com/api/v2.0/me/events
How do I get the Extensions back in the events data?
POST: https://outlook.office.com/api/v2.0/me/events
authorization: bearer {token}
content-type: application/json
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"Extensions": [
{
"#odata.type": "Microsoft.OutlookServices.OpenTypeExtension",
"ExtensionName": "Com.Contoso.Referral",
"CompanyName": "Wingtip Toys",
"ExpirationDate": "2015-12-30T11:00:00.000Z",
"DealValue": 10000,
"TopModels": [
3001,
4002,
5003
],
"TopSalespersons": [
"Dana Swope",
"Fanny Downs",
"Randi Welch"
]
}]
}
You could get extension using the below api:
GET https://outlook.office.com/api/v2.0/me/events('{event_id}')/extensions('{extensionId}')
For example:
GET https://outlook.office.com/api/v2.0/me/messages('AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVl===')/extensions('Com.Contoso.Referral')
For more information, please refer to the below link:
Get extension

How can I change "Created By" in Google Calendar using google calendar api?

I've given the creator object with name and email id, but still it gets saved in the google calendar with my gmail ID only.
{
"end": {
"dateTime": "2017-07-20T20:30:00.392227",
"timeZone": "Asia/Kolkata"
},
"start": {
"dateTime": "2017-07-20T20:00:00.392227",
"timeZone": "Asia/Kolkata"
},
"summary": "Birthday Party",
"creator": {
"displayName": "Lara",
"email": "lara#gmail.com"
"self": true
}
}
What should I do to change the Creator or "Created By" under events in Google Calendar?
I don't think these properties (creator, creator.displayName, creator.email, creator.id, creator.self) are editable as they are marked as Read-only property in Events resources. You may only use them as is.

custom field in calendar entry office365

We have an office365 setup and use the mail and calendar API to ingrate with our enviremenet.
Is it possible to add a custom field to calendar entry and be able to access and update via the calendar API?
We can use the data extension API to store custom data in a message, event, or contact of the user's account.
Here is an example that to create extension when create an appointment:
POST: https://outlook.office.com/api/v2.0/me/events
authorization: bearer {token}
content-type: application/json
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2016-09-06T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"Extensions": [
{
"#odata.type": "Microsoft.OutlookServices.OpenTypeExtension",
"ExtensionName": "Com.Contoso.Referral",
"CompanyName": "Wingtip Toys",
"ExpirationDate": "2015-12-30T11:00:00.000Z",
"DealValue": 10000,
"TopModels": [
3001,
4002,
5003
],
"TopSalespersons": [
"Dana Swope",
"Fanny Downs",
"Randi Welch"
]
}]
}
Get the extension on a exist object:
GET https://outlook.office.com/api/v2.0/me/events/{eventId}/extensions('{extensionId}')
GET https://outlook.office.com/api/v2.0/me/events/{eventId}/extensions('Microsoft.OutlookServices.OpenTypeExtension.Com.Contoso.Referral')
More detail about this API, you can refer here.

Find out Conflicting Events using office365 Rest Calendar API

I wanted to check that while creating new Event using Api need to check that is there any event present or create on same date and time.I mean how to check conflicting calendar event during creating new event using Rest API?
Any help must appreciate.
Thanks in advance.
Instead of find the conflicts for the calendar event, we can use the Find meeting times feature (preview).
Here is an example for your reference:
POST https://outlook.office.com/api/beta/me/findmeetingtimes
Prefer: outlook.timezone="Pacific Standard Time"
Content-Type: application/json
{
"Attendees": [
{
"Type": "Required",
"EmailAddress": {
"Address": "fannyd#prosewareltd.onmicrosoft.com"
}
}
],
"TimeConstraint": {
"Timeslots": [
{
"Start": {
"Date": "2016-05-20",
"Time": "7:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"Date": "2016-05-20",
"Time": "17:00:00",
"TimeZone": "Pacific Standard Time"
}
}
]
},
"MeetingDuration": "PT1H"
}
Refer to here about more detail.

Resources