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

119
Views
Enviar matriz de JavaScript al webhook

Estoy tratando de obtener datos de una API, enviar los datos obtenidos a una matriz y luego enviar (publicar) esa matriz con los datos en un webhook. Intenté description: data, pero no funciona. ¿Puede alguien ayudarme o es posible con js?

 const api = "http://ip-api.com/json/" var ipinfo = [ ] async function getIP() { const response = await fetch (api) const data = await response.json(); const { city, zip, country, countryCode, lat, lon, org, query, region, regionname, timezone } = data; ipinfo.push(data); console.log(ipinfo) } getIP(); function sendMessage() { fetch( 'WEBHOOK URL', { method: 'post', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify ({ allowed_mentions: { parse: ['users', 'roles'], }, // embeds to be sent embeds: [{ title: 'New IP logged', description: "ipinfo" + ipinfo, }, ], }), } ); }
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!