Get New Access Token in program code

I’m successfully using the ‘Get New Access Token’ button in Postman. I’m using the returned token, to create a calendar event outlook.com . Now, I’m trying to do the same thing in C#. What I started with was to create a header key/value pair for each item on the ‘Get New Access Token’ dialog box in Postman. My code is below. I’m currently getting a (403) Forbidden error. Any help would be greatly appreciated.

string lstrEndPoint = @“https://outlook.office.com/api/v2.0/me/events”;

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(lstrEndPoint);

request.Method = “GET”;
request.Accept = “application/json”;

request.Credentials = new NetworkCredential(“myemail”, “mypassword”);
request.UserAgent = “Test”;

request.Headers.Add(“Grant-Type”, “Authorization Code”);
request.Headers.Add(“Callback-URL”, “https://outlook.live.com/calendar/0/view/month”);
request.Headers.Add(“Auth-URL”, “url obtained from Azure Active Directory admin center”);
request.Headers.Add(“Access-Token-URL”, “url obtained from Azure Active Directory admin center”);
request.Headers.Add(“Client-ID”, “string obtained from Azure Active Directory admin center”);
request.Headers.Add(“Client-Secret”, “string obtained from Azure Active Directory admin center”);
request.Headers.Add(“Scope”, “https://outlook.office.com/calendars.readwrite”);
request.Headers.Add(“State”, “State”);
request.Headers.Add(“Client-Authentication”, “Send as Basic Auth header”);

HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse();

This error occured that you do not have permission to view the requested resource . While sometimes it is due to reconfigured permissions. The top reasons for this error are permissions.
please check for any Authorisation key because when your are get an request in postman for accessing the token value you have to pass the authorisation key in against of the api request .
Thanks