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

282
Views
Código de estado: 422 (error: {tipo: 'validación', mensaje: 'mensaje no válido'})

Estoy tratando de escribir la siguiente función de publicación de curl con autenticación básica en javascript de vainilla.

 curl -X POST \ https://api.livechatinc.com/v3.3/agent/action/list_chats \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <your_access_token>' \ -d '{}'

Este es mi código en javascript.

 (async () => { const rawResponse = await fetch(url, { method: 'POST', headers: { 'Content-Type' : 'application/json', 'Authorization': 'Basic ' + btoa(username+":"+password) }, body: { "filters.group_ids" : "1", "limit" : 1 } }); const content = await rawResponse.json(); console.log(content); })();

Sigo recibiendo este error "error: mensaje: "mensaje no válido" tipo: "validación""

El método curl funciona perfectamente en cartero. Leí la documentación sobre este error e intenté eliminar el encabezado del tipo de contenido. No funcionó. Cualquier ayuda es apreciada.

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!