I'm trying to use Google Calendar API via JavaScript and keep getting the 401 error response while using the following code:
$.ajax({
dataType: "json",
url: "https://www.googleapis.com/calendar/v3/users/me/calendarList/<calendarID>?key=<my api key>",
success: function(result){
$('#result').html(result);
}
});
Is there something wrong in my usage of the API and how should I use the oAuth
? I already have a clientID
and secretID
from the Google console but don't know how to use those.
Thanks.