Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda