Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

619
Views
¿Cómo se resuelve: los parámetros (String) no coinciden con la firma del método para ScriptApp.getOAuthToken en Google Apps Script?

Estoy tratando de obtener información de una API cuadrada en Hojas de cálculo de Google, pero no estoy muy seguro de cómo lidiar con el token del portador y la desalineación con la firma del método ScriptApp. ¡Gracias!

 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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!