TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Teemee Tang
NA
111
10.4k
Error encountered when creating event in Microsoft Graph exp
Jul 2 2018 12:26 AM
Error encountered when creating event in Microsoft Graph explorer for c#
Error message:
StatusCode: 403, ReasonPhrase: 'Forbidden',
Codes :
private
static
async Task<
bool
> CreateAppointmentAsync(HttpClient httpClient, EventModel eventModel)
{
var stringContent = JsonConvert.SerializeObject(eventModel);
string
URL = GraphResource + GraphVersion +
"/me/calendar/events"
;
var response = await httpClient.PostAsync(URL,
new
StringContent(stringContent, Encoding.UTF8,
"application/json"
));
//var response = await httpClient.PostAsync(GraphResource + GraphVersion + "/me/events",
//new StringContent(stringContent, Encoding.UTF8, "application/json"));
return
response.IsSuccessStatusCode;
}
Event model
public
class
EventModel
{
public
string
subject {
get
;
set
; }
public
Start start {
get
;
set
; }
public
End end {
get
;
set
; }
public
List<Attendees> Attendees {
get
;
set
; }
}
public
class
Start
{
public
DateTime dateTime {
get
;
set
; }
public
string
timeZone {
get
;
set
; }
}
public
class
End
{
public
DateTime dateTime {
get
;
set
; }
public
string
timeZone {
get
;
set
; }
}
public
class
Attendees
{
public
EmailAddress emailAddress {
get
;
set
; }
public
string
type {
get
;
set
; }
}
Reply
Answers (
1
)
C# go back by pressing a key
I want to get date and insert in to data grid by using those