Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda