title: How can I have my server add events to a google calendar using the client library for PHP?
body: <p>I have very little experience working with the google api and I'm finding it difficult to find relevant information on certain subjects.</p>
  
  <p>What I'm trying to do is create a calendar that requires no log in information from the user.  I want my server to add events to the calendar based off of information in a database.</p>
  
  <p>I have gone into my google calendars, created a new one, and worked up some code to add events to the calendar.  Then I use the iframe code that google provides to embed the calendar into my site.</p>
  
  <p>The problem I'm running into is that the server wants the user to be logged in as me to add events to the calendar.  Since the server is the one adding the events, I'm not really sure how to work around this.  <a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount" rel="nofollow">I know I need to make/use a service account so my server can "delegate domain-wide authority"</a>, but I'm not sure how to do this using the client library for PHP.  No examples are provided by google.  I had to download a p12 file that my server needs to make these api calls, but I'm not sure how to point to the file using the client library.  Is it possible to use the php client library to hook into a service account to make these api calls?  If so, how?</p>
  
  <p>Any help is greatly appreciated.</p>