Literalmente solo estoy siguiendo el código en este sitio pero tengo este error, no estoy seguro de por qué
// https://github.com/visionmedia/superagent#install const superagent = require('superagent'); superagent .auth('my strings') .post(`https://api.telnyx.com/2010-04-01/Accounts/my string/Messages.json`) .send({ From: '', // Your Telnyx number To: '', Body: "Is this working, World!" }) .then((response) => { console.log(response.body); });nota: acabo de escribir mis cadenas en lugar del código real para la privacidad
el método viene primero, inviértalo: ...post().auth()... :
// https://github.com/visionmedia/superagent#install const superagent = require('superagent'); superagent .post(`https://api.telnyx.com/2010-04-01/Accounts/my string/Messages.json`) .auth('my strings') .send({ From: '', // Your Telnyx number To: '', Body: "Is this working, World!" }) .then((response) => { console.log(response.body); });