// GET https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle
var user = await graphClient.Me
.Request()
.Select(u => new {
u.DisplayName,
u.JobTitle
})
.GetAsync();
// GET https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle
let user = await client.api('/me')
.select('displayName', 'jobTitle')
.get();
// GET https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle
final User user = graphClient.me()
.buildRequest()
.select("DisplayName,JobTitle")
.get();
# GET https://graph.microsoft.com/v1.0/users/{user-id}?$select=displayName,jobTitle
$userId = "71766077-aacc-470a-be5e-ba47db3b2e88"
# The -Property parameter causes a $select parameter to be included in the request
$user = Get-MgUser -UserId $userId -Property DisplayName,JobTitle
重要
Microsoft Graph SDK for Go は現在プレビュー段階です。 運用環境でのこの SDK の使用はサポートされていません。
// GET https://graph.microsoft.com/v1.0/me/messages/{message-id}
string messageId = "AQMkAGUy..";
var message = await graphClient.Me.Messages[messageId]
.Request()
.GetAsync();
// GET https://graph.microsoft.com/v1.0/me/messages/{message-id}
let messageId = 'AQMkAGUy..';
let messages = await client.api(`/me/messages/${messageId}`)
.get();
// GET https://graph.microsoft.com/v1.0/me/messages/{message-id}
final String messageId = "AQMkAGUy..";
final Message message = graphClient.me().messages(messageId)
.buildRequest()
.get();
// GET https://graph.microsoft.com/v1.0/me/messages/{message-id}?$expand=attachments
string messageId = "AQMkAGUy...";
var message = await graphClient.Me.Messages[messageId]
.Request()
.Expand("attachments")
.GetAsync();
// GET https://graph.microsoft.com/v1.0/me/messages?$expand=attachments
let messageId = 'AQMkAGUy..';
let message = await client.api(`/me/messages/${messageId}`)
.expand('attachments')
.get();
// GET https://graph.microsoft.com/v1.0/me/messages/{message-id}?$expand=attachments
final String messageId = "AQMkAGUy...";
final Message message = graphClient.me().messages(messageId)
.buildRequest()
.expand("attachments")
.get();
# GET https://graph.microsoft.com/v1.0/users/{user-id}/messages?$expand=attachments
$userId = "71766077-aacc-470a-be5e-ba47db3b2e88"
$messageId = "AQMkAGUy.."
# -ExpandProperty is equivalent to $expand
$message = Get-MgUserMessage -UserId $userId -MessageId $messageId -ExpandProperty Attachments
重要
Microsoft Graph SDK for Go は現在プレビュー段階です。 運用環境でのこの SDK の使用はサポートされていません。
// POST https://graph.microsoft.com/v1.0/me/calendars
var calendar = new Calendar
{
Name = "Volunteer"
};
var newCalendar = await graphClient.Me.Calendars
.Request()
.AddAsync(calendar);
// POST https://graph.microsoft.com/v1.0/me/calendars
final Calendar calendar = new Calendar();
calendar.Name = "Volunteer";
final Calendar newCalendar = graphClient.me().calendars()
.buildRequest()
.post(calendar);
// PATCH https://graph.microsoft.com/v1.0/teams/{team-id}
var team = new Team
{
FunSettings = new TeamFunSettings
{
AllowGiphy = true,
GiphyContentRating = GiphyRatingType.Strict
}
};
var teamId = "71766077-aacc-470a-be5e-ba47db3b2e88";
await graphClient.Teams[teamId]
.Request()
.UpdateAsync(team);
// PATCH https://graph.microsoft.com/v1.0/teams/{team-id}
final Team team = new Team();
team.FunSettings = new TeamFunSettings();
team.FunSettings.AllowGiphy = true;
team.FunSettings.GiphyContentRating = GiphyRatingType.STRICT;
final String teamId = "71766077-aacc-470a-be5e-ba47db3b2e88";
graphClient.teams(teamId)
.buildRequest()
.patch(team);
// GET https://graph.microsoft.com/v1.0/users/{user-id}/events
var events = await graphClient.Me.Events
.Request()
.Header("Prefer",@"outlook.timezone=""Pacific Standard Time""")
.Select( e => new {
e.Subject,
e.Body,
e.BodyPreview
})
.GetAsync();
// GET https://graph.microsoft.com/v1.0/me/events
let events = await client.api('/me/events')
.header('Prefer','outlook.timezone="Pacific Standard Time"')
.select('subject,body,bodyPreview,organizer,attendees,start,end,location')
.get();
// GET https://graph.microsoft.com/v1.0/users/{user-id}/events
final Event events = graphClient.me().events()
.buildRequest(new HeaderOption("Prefer","outlook.timezone=\"Pacific Standard Time\""))
.select("Subject,Body,BodyPreview")
.get();
# GET https://graph.microsoft.com/v1.0/users/{user-id}/events
$userId = "71766077-aacc-470a-be5e-ba47db3b2e88"
$requestUri = "/v1.0/users/" + $userId + "/events"
$events = Invoke-GraphRequest -Method GET -Uri $requestUri `
-Headers @{ Prefer = "outlook.timezone=""Pacific Standard Time""" }
重要
Microsoft Graph SDK for Go は現在プレビュー段階です。 運用環境でのこの SDK の使用はサポートされていません。
//GET https://graph.microsoft.com/v1.0/me/calendarView
var queryOptions = new List<QueryOption>()
{
new QueryOption("startdate", "2020-12-01T00:00:00Z"),
new QueryOption("enddate", "2020-12-30T00:00:00Z")
};
var calendar = await graphClient.Me.CalendarView()
.Request(queryOptions)
.GetAsync();
// GET https://graph.microsoft.com/v1.0/me/calendar/calendarView
const start = '2020-01-01T19:00:00';
const end = '2020-01-07T19:00:00';
let calendar = await client
.api(`/me/calendar/calendarView?startDateTime=${start}&endDateTime=${end}`)
.get();
//GET https://graph.microsoft.com/v1.0/me/calendarView
final IEventCollectionPage calendar = graphClient.me().calendarView()
.buildRequest(new QueryOption("startdate", "2020-12-01T00:00:00Z"),
new QueryOption("enddate", "2020-12-30T00:00:00Z"))
.get();