Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
Can't create event through REST API in chrome extension which worked before

Basically I have this piece of code written in my chrome extension...

await fetch(
    "https://www.googleapis.com/calendar/v3/calendars/primary/events?sendUpdates=all&sendNotifications=true&alt=json&key=<API_KEY>",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer " + token.token, // Token is proper... verified
        Accept: "application/json",
      },
      body: JSON.stringify({
        end: {
          dateTime: "03-02-2022" + "T23:59:00.000+05:30",
        },
        start: {
          dateTime: "03-02-2022" + "T23:00:00.000+05:30",
        },
        eventType: "default",
        description: "event",
        summary: "Digital Assignment",
      }),
    }
  )
    .then(async (res) => {
      return res.json();
    })
    .then((data) => {
      resolve();
      console.log(data);
    })

This used to work before... but for some reason now it doesn't work... The API hits with error

{"error": {"code":400,"errors":[{"domain":"global","message":"Bad Request","reason":"badRequest"}],"message":"Bad Request"}}

I even tried on Google's API explorer... It also gives same error... Are there new updates to API... I read documentation but I'm not able to figure it out...

For more details, you can check this repo where I'm using calendar API... https://github.com/sudonims/vtop-da-deadline/blob/master/background.js#L60

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!