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

335
Visualizações
Why does urlfetch() give me "Service invoked too many times for one day" in this context using GAS to get API data?

I've been trying to get all candidates from Catsone into a Google Sheet and although the code is apparently according to their API instruction, I'm getting the above mentioned error and I'm not sure where to look for the issue.

Here's the code I'm running:

const API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXX";

function getallcandidates() {
  const url = 'https://api.catsone.com/v3/candidates';
  const params = {
    'muteHttpExceptions': true,
    'method': 'GET',
    'headers': {
      'Content-Type': 'application/json',
      'Authorization': 'Token' + API_KEY
    }
  };

  const response = UrlFetchApp.fetch(url, params);
  const data = response.getContentText();
  const json = JSON.parse(data);
  Logger.log('Data: ' + json)
}

These are their instructions for authentication: https://docs.catsone.com/api/v3/#authentication

This is what successfully I got whe I tried calling it from Postman:

var myHeaders = new Headers();
myHeaders.append("Authorization", "Token XXXXXXXXXXXXXXXXXXXX");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.catsone.com/v3/candidates", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Appreciate any help.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When I saw your added Javascript and your Google Apps Script, if the value of const API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXX"; has no space at the top character, how about the following modification?

Modified script:

From:

'Authorization': 'Token' + API_KEY

To:

'Authorization': 'Token ' + API_KEY
  • From your additional Javascript, 'Token' is modified to 'Token '.
about 4 years ago · Juan Pablo Isaza Relatório
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