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

628
Vistas
How do you resolve: The parameters (String) don't match the method signature for ScriptApp.getOAuthToken in Google Apps Script?

I'm trying to get information from a squareup api into Google Sheets, but I'm not quite sure how to deal with the bearer token and misalignment with the ScriptApp method signature. Thank you!

 function squareLocations() {

  var url = "https://connect.squareup.com/v2/locations";
  var headers = {
                "Square-Version": "2022-01-20",
                "Authorization": token,
                "Content-Type": 'application/json'
                }
  var data =    { 
                'locations': {
                  'id': locationID,
                  'name': locationName,
                  'address': locationAdress,
                             }
                }
  const params = {
    headers: head,
    method: "get",
    muteHttpExceptions: true,
    payload: JSON.stringify(data)
    }
    
  var response = UrlFetchApp.fetch(url, headers);
  
  var responseCode = response.getResponseCode();
  var responseBody = JSON.parse(response.getContextText());
  var json = JSON.parse(responseBody);
  if (responseCode === 200)
    {
        responseJSON.error = false;
        return responseJSON;
    }
    else
    {
        responseJSON.error = true;
        responseJSON.message = `Request failed. Expected 200, got ${responseCode}: ${responseBody}`;
        return responseJSON;
    }
  
  
  }
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