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

334
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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