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

267
Views
Sending data with fetch. How to include variable in body

I use the API of a online service to send the email of a client that just made an order from my eshop. I do this using fetch in javascript. What i want you to help me with is how to iclude the variable, that has as value the email of the client, to the body of my request. The variable is newClientMail and the body of the request is body: '{"email": }'.
body: '{"email": newClientMail}' if i write it that way i get an internal server error status 500.


let newClientMail = clientEmail.replace('/', '');

fetch('https://useapi.useinbox.com/inbox/v1/contactlists/61b212ba8813690001cd5228/add', {
        method: 'POST', 
        headers: {'Content-Type': 'application/json',
                   'Authorization': 'Bearer ' + authToken},
        body: '{"email": }'                                                            
        })
        })
        .then(function (response) {
        return response.json(); 
         })
        .then(function (data) {
         console.log(data);
        })

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!