Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6863699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:49:02+00:00 2026-05-27T02:49:02+00:00

I am writing a PHP application that’s supposed to allow users to add certain

  • 0

I am writing a PHP application that’s supposed to allow users to add certain events to a private Google Calendar. The calendar is owned by me, and I need a way for PHP to communicate with the calendar API using fixed credentials (everyone can add events using a form on the website, but the calendar itself is not publicly visible).

From what I have read, this is possible using ClientLogin in the v1 API. In the v3 API, however, the available options are OAuth2.0 or the API key. Using the API key doesn’t seem to work, since it can only be used for requests that don’t require authorization, and OAuth doesn’t seem right either, because users are not supposed to access their own calendars, but the one my application uses.

I thought about getting the OAuth token programatically, but that’s bound to break sooner or later, since the OAuth dialog can use captchas.

This seems to be such a standard use case — a web application that lets users interact with a single calendar in some predefined ways — yet I can’t find any documentation on how to make it happen in the v3 API. Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:49:03+00:00Added an answer on May 27, 2026 at 2:49 am

    You will need to use both the Developer Key (API Key) and OAuth2. The developer key authenticates who wrote the software and is used for things like quota which is on a per developer basis not a per user basis. OAuth2 is for user authentication and will be need to access the non-public calendar.

    OAuth2 has a renew token from which you can generate a session token and this means that you will not need to screen scrape the OAuth screens to get authenticated. To get this I would write a little command line application, or you use a one off PHP page.

    1. Under the Google Api Console go to API Access
    2. Generate a new Client ID and choose Installed Application ( as you will be authenticating you server as you not as your user)
    3. Either using a console app or a one off PHP page authenticate using OAuth and your google account (the one with the calendar you want access to)
    4. In the return from the authentication there should be a renew token, (called renew or refresh or something similar). Save this string and make it available to your PHP site.
    5. When you need to access the service your OAuth library should have a renew/refresh call. There is an example using .Net below.

    private IAuthorizationState CreateAuthorization(NativeApplicationClient arg)
     {
       // Get the auth URL:
       IAuthorizationState state = new AuthorizationState(new[] { AdsenseService.Scopes.AdsenseReadonly.GetStringValue() });
       state.Callback = new Uri(NativeApplicationClient.OutOfBandCallbackUrl);
       if (refreshToken.IsNotNullOrEmpty()) // refreshToken you stored in step 4
       {
         try
         {
           state.RefreshToken = refreshToken;
           if (arg.RefreshToken(state))     // This is calling out to the OAuth servers with the refresh token getting back a session token, returns true if successful.
           {
             if (state.RefreshToken != refreshToken) // if the refresh token has changed, save it.
             {
               PersistRefreshToken(authorization.RefreshToken);
             }
             return this.authorization = state; // Retain the authorization state, this is what will authenticate your calls.
           }
         }
         catch (ProtocolException ex) {...}
    

    The AuthorisationState that has now been renewed can then be used to authenticate call you make to the API. this state can be used many time until it expires and then can be refreshed. As you are authenticating your application as yourself not as a user this AuthorisationState can be shared by all you sessions. Both the current AuthorisationState and the refresh token should be kept securely on your server and never sent to the client, if you ever sent these as part of a response your clients would have the same privileges as your code application

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application that would allow users to edit a calendar, its description
Greetings, Overflowers! I am writing an application in PHP that will allow for editing
I'm writing a PHP application that shows promotions for a certain time frame. In
I am writing a PHP application that will have the ability to edit settings
I'm writing an application in PHP that uses a LOT of global variables that
I'm writing a CMS application in PHP and one of the requirements is that
In a PHP application I am writing, I would like to have users enter
I am writing a add-on module which is integrated with an existing PHP application;
I am writing a web application in PHP that will store large numbers of
I'm writing a PHP application that manages some LDAP entries. I have one page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.